hotkeys icon indicating copy to clipboard operation
hotkeys copied to clipboard

Multi-language issues: check key code, instead of value

Open Iworb opened this issue 4 years ago • 3 comments

[ ] 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.

Iworb avatar Apr 19 '21 16:04 Iworb

Do you want to create a PR?

NetanelBasal avatar Apr 20 '21 05:04 NetanelBasal

No, its issue report

Iworb avatar Apr 20 '21 05:04 Iworb

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

rabiedadi avatar Jul 25 '22 20:07 rabiedadi

There is any update for this problem? @NetanelBasal

ItaiBarkav avatar Jul 18 '23 12:07 ItaiBarkav

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();

TekVanDo avatar Nov 04 '23 16:11 TekVanDo