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

Some keys do not get recognized on non-US keyboard layouts #47

Open
Bone008 opened this issue Dec 20, 2019 · 0 comments
Open

Some keys do not get recognized on non-US keyboard layouts #47

Bone008 opened this issue Dec 20, 2019 · 0 comments
Assignees

Comments

@Bone008
Copy link

Bone008 commented Dec 20, 2019

Describe the bug

After the fix for #40, some keys still don't get through, for example the German ä. I tracked it down to all keys which are in the _KEYCODE_MAP and different from the US layout. The ä key has keycode 222, which is ' on US keyboards, so that's what the library maps it to due to characterFromEvent(...) using event.which before accessing event.key.

I believe _KEYCODE_MAP should no longer be necessary and now does more harm than good, since event.key properly handles all special character transformations in a layout-aware fashion. There may be some edge cases I have missed, though.

Expected behavior:

Registering this shortcut should work when pressing the "ä" key on a German keyboard:

{ key: "ä", command: () => alert('test') }

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox 71
  • Version: 8.2.0
@omridevk omridevk self-assigned this Dec 20, 2019
@omridevk omridevk added the bug label Dec 20, 2019
@omridevk omridevk closed this as completed Jan 7, 2023
@omridevk omridevk reopened this Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants