karalabe / hid

Gopher Interface Devices (USB HID)
Other
266 stars 132 forks source link

Question: USB HID Keyboard scan codes / ascii #25

Closed tobearlabs closed 9 months ago

tobearlabs commented 5 years ago

Thanks for this nice golang package. I use it to connect to a second usb keyboard. I receive the bytes from the connected keyboard representing the scancodes. (like 4 for "a").

Do u know an easy way to map/convert the incoming scancodes to runes or characters to receive a string in the end (even using the current operating system keyboard layout). I have a loop reading all inputs only from the second keyboard, which works fine, until enter is pressed. But now i have only the "scancodes" but need to get an ascii string.

Thanks in advance.

fimdomeio commented 5 years ago

https://github.com/yakshaveinc/go-keycodes/blob/master/keycodes.go

holiman commented 9 months ago

Answered