[BUG] Special characters on Ctrl+Alt+(letter)
Describe the bug We have a series of hotkeys on the type Alt+Control+(letter) - however when the combination leads to a special character the action is not called - except if I define that special character as a hotkey. For instance pressing Ctrl+Alt+e leads to the key being é (English keyboard layout) or € (Danish keyboard layout) It might just be me not understanding howto configure it properly - but I don't think it reacts as expected.
Futhermore it seems that it sometimes doesn't release the keys when a special character is hit - but not something I have been able to consistently recreate. I do have a <GlobalHotKeys/> out in the root.
How are you using react hotkeys components? HotKeys
Expected behavior I expected to be able to just enter e.g. Alt+Control+e as hotkey - without looking at what special keys that will be written.
Platform (please complete the following information):
- Version of react-hotkeys:
- ^2.0.0
- Browser:
- IE 11
- Chrome 77.0.3865.75
- OS: [e.g. iOS]
- Windows 10
Are you willing and able to create a PR request to fix this issue? Haven't looked that much at the code - and as mentioned it might just be a configuration issue.
APPLICABLE TO v2.0.0-pre1 AND ABOVE: ======================
Include the smallest log that includes your issue:
Set logging to verbose (you'll need the development build if its possible):
import { configure } from 'react-hotkeys';
configure({
logLevel: 'verbose'
})
localhost-1568723186689.log - log of what happened when pressing Ctrl+Alt+e
What Configuration options are you using?
configure({
ignoreTags: [],
logLevel: 'verbose',
});
Hi @erikzielke, thanks for raising this to my attention. This appears to be an i18n issue, that I suspected may occur but have not really had access to enough differing keyboards to confirm.
So react-hotkeys has been encoded to expect the ´ character when alt+e is pressed (that's what happens on my keyboard). This is obviously an incorrect assumption about the way all English keyboards will behave.
I was hoping React would aid in standardising this information, but I will have to start looking into using some combination of keyCode and key in future to accommodate for this.
I'm afraid my advice in the short term is to avoid any key combinations with alt in them.