Closed vladdekhanov closed 11 months ago
I was under the impression that typically keyboard shortcuts are often standardized by key name rather than physical location on the keyboard.
I checked both Mac and Windows via these support articles as an example.
Changing the locale does not change these shortcuts. This is more relevant for application shortcuts. But I can see the issue for something like a game. Is that what you are working on?
Keystrokes uses key specifically so it is locale independent, so this is actually desired. Perhaps we need some sort of key code syntax though to allow you to choose.
@vladdekhanov alright, I've added the ability to bind code names in bindings and combos. All you need to do is prefix the name with @
. For example, binding the keys in the position of the QUERTY keyboard's A and X key can be done with the combo @KeyA + @KeyX
. Let me know if you have any feedback.
See the 1.5.0 release to try it out.
Thanks for raising this one @vladdekhanov
Thanks a lot and very appreciate your quick response. I've got a flu and wasn't available to response. Thank you for solution with @
symbol. It definitely works in most cases. Looking forward to try it out and wish you a merry Christmas.
Describe the bug Library doesn't support
code
orwhich
property to make hotkey language agnostic. It compare event key by value due to works with only one keyboard layout.To Reproduce Imagine you have keyboard with 2 layouts: native language and english (i.e. French and English).
Steps to reproduce the behavior:
bindKey('H', { onPressed: () => { ... }, onReleased: () => { ... }, });