hotkeys-js icon indicating copy to clipboard operation
hotkeys-js copied to clipboard

Cmd-backslash doesn't work on a non-US keyboard layout

Open borekb opened this issue 6 years ago • 6 comments

My Czech keyboard layout has the backslash (\) in the lower left corner of the keyboard:

Screenshot 2019-09-26 at 11 17 28

This is different from U.S. English layout on the ISO keyboard which looks like this:

Screenshot 2019-09-26 at 11 17 59

When I go to this project's homepage with my Czech keyboard, the backslash alone is registered:

Screenshot 2019-09-26 at 11 21 17

But when I try Cmd-\, only Cmd alone is registered:

Screenshot 2019-09-26 at 11 21 31

That means that Cmd-\ shortcuts are not working. Is there a way to fix this?

borekb avatar Sep 26 '19 09:09 borekb

https://github.com/jaywcjlove/hotkeys/blob/98ce2d6fb6d8100b7f98470f92d095cc147ac141/src/var.js#L34-L37

@borekb May be a problem with escape characters.

jaywcjlove avatar Sep 26 '19 09:09 jaywcjlove

Interestingly, on https://keycode.info/, I get the key code 220 (correct) but event.code is IntlBackslash instead of Backslash. Is this related?

Screenshot 2019-09-26 at 12 51 23

borekb avatar Sep 26 '19 10:09 borekb

@borekb This is right.

jaywcjlove avatar Sep 26 '19 11:09 jaywcjlove

@jaywcjlove but what to do about it? Hotkeys.js receives the correct code but still doesn't work correctly; would it need to be reworked to take event.code into account?

borekb avatar Sep 26 '19 11:09 borekb

@borekb I need to debug it.

jaywcjlove avatar Sep 26 '19 13:09 jaywcjlove

Hi @jaywcjlove , I wrote a bit about it here, tried hotkeys also and to see if it worked

https://kevinsimper.medium.com/why-keyboard-shortcuts-and-accessibility-in-other-keyboard-languages-rarely-works-8638abc15e71

kevinsimper avatar Aug 05 '21 12:08 kevinsimper