hotkeys
hotkeys copied to clipboard
Multi-language issues: check key code, instead of value
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behavior
If you have multiple languages in your system, like I do, this module will work exaclty for language you're defined: shift.meta.p will work for English, but not for russian shift.meta.з, which has same key code, but different key value.
Expected behavior
Add ability to check key code, not just key value.
Minimal reproduction of the problem with instructions
- Add some localization to your system with letters, different than English;
- Create shortcut for English keys;
- Switch localization and try to use this hotkey.
Do you want to create a PR?
No, its issue report
I think using keycode instead of key value is better solution I had a problem when I add shortcuts for '(' and ')' to toggle panels but they are not firing in mac devices because the key values of the same buttons are 0 and 9 in mac keyboard
There is any update for this problem? @NetanelBasal
I think this task can be closed.
I took some time to get, but angular EventManager supports event.code syntax like shift.code.KeyP instead of shift.p
This will work regardless of the keyboard layout :
this.hotkeys.addShortcut({ keys: 'shift.code.KeyR', }).subscribe();