Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undo event not working on german keyboard layout #73

Closed
Coding-Kiwi opened this issue Jan 11, 2022 · 2 comments
Closed

undo event not working on german keyboard layout #73

Coding-Kiwi opened this issue Jan 11, 2022 · 2 comments
Labels
bug Something isn't working feature

Comments

@Coding-Kiwi
Copy link

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

@antonmedv
Copy link
Owner

Yes, it should be fixed.

@antonmedv
Copy link
Owner

Fixed in release 3.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature
Projects
None yet
Development

No branches or pull requests

2 participants