adds missing special char to the list

This commit is contained in:
Moss 2020-06-12 15:17:41 +02:00
parent c1c350a657
commit 2d79ab732b
2 changed files with 19 additions and 0 deletions

View File

@ -36,6 +36,7 @@ func NewUSBDriver(send SendUsbScanCodes, interval time.Duration) *usbDriver {
special := map[string]key.Code{
"enter": key.CodeReturnEnter,
"return": key.CodeReturnEnter,
"esc": key.CodeEscape,
"bs": key.CodeDeleteBackspace,
"del": key.CodeDeleteForward,
@ -67,6 +68,9 @@ func NewUSBDriver(send SendUsbScanCodes, interval time.Duration) *usbDriver {
"rightalt": key.CodeRightAlt,
"rightctrl": key.CodeRightControl,
"rightshift": key.CodeRightShift,
"leftsuper": key.CodeLeftGUI,
"rightsuper": key.CodeRightGUI,
"spacebar": key.CodeSpacebar,
}
scancodeIndex := make(map[string]key.Code)

View File

@ -29,6 +29,21 @@ func TestUSBDriver(t *testing.T) {
key.CodeLeftShift,
true,
},
{
"<leftsuper>",
key.CodeLeftGUI,
false,
},
{
"<spacebar>",
key.CodeSpacebar,
false,
},
{
"<return>",
key.CodeReturnEnter,
false,
},
{
"a",
key.CodeA,