[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!