react-hotkeys
react-hotkeys copied to clipboard
[BUG] key mapping with `alt+...` doesn't work because `alt` changes keyboard keys
Describe the bug
I'm trying to add the shortcut alt+h
but the real shortcut is actually alt+Ì
. If I press alt
then the key h
become Ì
. So I need to register alt+Ì
to handle alt+h
. I'm not sure if it's a bug or normal behavior.
How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys, etc) GlobalHotKeys
Expected behavior
Add the key map alt+h
.
Platform:
- react-hotkeys: 2.0.0
- Browser: Chrome 80.0.3987.87
- OS: macOS 10.15.3
- Keyboard: AZERTY
Are you willing and able to create a PR request to fix this issue? No unfortunately
Include the smallest log that includes your issue:
HotKeys (GLOBAL-E1💚): New 'Alt' keydown event (that has NOT passed through React app).
inject.js:38244 HotKeys (GLOBAL-E1💚-C0🔺): No matching actions found for 'Alt' keydown.
inject.js:40393 HotKeys (GLOBAL-E2💙): New (simulated) 'Alt' keypress event (that has NOT passed through React app).
inject.js:40630 HotKeys (GLOBAL-E2💙): Ignored 'Alt' keypress because it doesn't have any keypress handlers.
inject.js:40393 HotKeys (GLOBAL-E3💛): New 'Ì' keydown event (that has NOT passed through React app).
inject.js:38244 HotKeys (GLOBAL-E3💛-C0🔺): No matching actions found for 'Alt+Ì' keydown.
inject.js:40393 HotKeys (GLOBAL-E4💜): New 'Ì' keypress event (that has NOT passed through React app).
inject.js:40630 HotKeys (GLOBAL-E4💜): Ignored 'Alt+Ì' keypress because it doesn't have any keypress handlers.
inject.js:40393 HotKeys (GLOBAL-E5🧡): New 'Ì' keyup event (that has NOT passed through React app).
inject.js:40630 HotKeys (GLOBAL-E5🧡): Ignored 'Alt+Ì' keyup because it doesn't have any keyup handlers.
inject.js:40393 HotKeys (GLOBAL-E6❤️): New 'Alt' keyup event (that has NOT passed through React app).
inject.js:40630 HotKeys (GLOBAL-E6❤️): Ignored 'Alt+Ì' keyup because it doesn't have any keyup handlers.
inject.js:40949 HotKeys: Window focused - clearing key history
What Configuration options are you using? No option.
It works for me w.r.t. triggering the shortcut, but it also pastes in the special character as well =\
I was able to repro this issue on Mac in Chrome on react-hotkeys 2.0.0.
relates to #248, #215, & #232
https://github.com/greena13/react-hotkeys/issues/232#issuecomment-544253167
I'm afraid my advice in the short term is to avoid any key combinations with alt in them.
@ChristoRibeiro why was this issue closed?
Oops wrong issue closed. Sorry!