You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the german qwertz layout, pressing cltr + z does nothing because the z key is KeyY
Keyboard events are messy in javascript, the mozilla docs marks event.which, event.keyCode and event.charCode as deprecated and tells you to use event.key but as the PR #58 shows, event.key might be 'z' in german and english, no matter what layout but 'я' in russian.
I don't know why they deprecate all numeric properties and give us no alternative and the keyboard.getLayoutMap api is still experimental.
But it should also be noted that big libraries like mousetrap also rely on event.keyCode and many many js projects use the classic if event.keyCode === 13 to check for enter, so its not sure if it will ever be deprecated since it would break a lot of code.
What do you think about using event.keyCode ?
I would suggest as a fix you could make the isUndo and isRedo functions somehow configurable, that way we could also configure it to be ctrl+z for undo and ctrl+y for redo instead of ctrl+z and ctrl+shift+z
The text was updated successfully, but these errors were encountered:
When using the german qwertz layout, pressing cltr + z does nothing because the z key is KeyY
Keyboard events are messy in javascript, the mozilla docs marks
event.which
,event.keyCode
andevent.charCode
as deprecated and tells you to useevent.key
but as the PR #58 shows,event.key
might be 'z' in german and english, no matter what layout but 'я' in russian.I don't know why they deprecate all numeric properties and give us no alternative and the keyboard.getLayoutMap api is still experimental.
But it should also be noted that big libraries like mousetrap also rely on
event.keyCode
and many many js projects use the classicif event.keyCode === 13
to check for enter, so its not sure if it will ever be deprecated since it would break a lot of code.What do you think about using
event.keyCode
?I would suggest as a fix you could make the isUndo and isRedo functions somehow configurable, that way we could also configure it to be ctrl+z for undo and ctrl+y for redo instead of ctrl+z and ctrl+shift+z
The text was updated successfully, but these errors were encountered: