3 ms·
It's not really a problem with the APIs, it is a problem with the common knowledge of how keyboards work. There is no 1:1 keyboard position -> letter mapping,
by crote 3y ago
It's not really a problem with the APIs, it is a problem with the common knowledge of how keyboards work.
There is no 1:1 keyboard position -> letter mapping, nor is there a 1:1 letter -> keyboard position mapping. This means something like "detect a press and hold of whatever key results in the input 'w'" is impossible. You can detect an "input" event for it, but there is no guarantee that there will be a "keydown" or "keyup" event. Similarly, you can't have something like "show the label on the key which is normally labelled 'w' on a Qwerty keyboard". It is not guaranteed to have a character associated with it.
Technically nothing is stopping you from creating shortcuts, but you are going to have an awfully hard time creating them in a way which works for all users.