Closed drehtisch closed 3 years ago
I see an issue with the alternative "KeyboardEvent.key": the numpad number key values are the same as the top-row number key values, so I couldn't distinguish them.
Moreover, on an AZERTY layout the top-row number key values aren't numbers at all, but subject to the keyboard layout itself, meaning that it wouldn't be so easy to provide a default keyboard layout that works for everyone.
This isn't even considering keyboards which don't follow the latin alphabet, which would be affected even worse... although those are probably not in use at all on NS.
So most likely, we'll have to use KeyboardEvent.code. But then there's the issue that the code does not necessarily represent the button on a non-US keyboard layout...
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode