vue-shortkey icon indicating copy to clipboard operation
vue-shortkey copied to clipboard

Shortkeys are not working when language is changed

Open hdodov opened this issue 6 years ago • 2 comments

I have key combinations involving Alt and Shift. On Windows, those two keys are used to switch the input language. If I have a shortkey for Alt+A, it works perfectly if I'm writing in English. However, if I accidentally switch to my other language (Bulgarian), the shortkey no longer works. I guess it's because the a key is now ь, and I have no combination set for Alt+ь.

However, I noticed that when I press the a, it has the same keycode (65) no matter what language I'm writing in. Perhaps an option can be implemented that allows you to use keycodes to monitor the keys?

hdodov avatar Feb 27 '19 08:02 hdodov

I am facing the same issue. In my case, I need the key combinations to work in English, Russian and Ukrainian. As a temporary workaround, I'm using this setup with "multi keys":

  <div
    v-shortkey.once="{en: ['shift', 's'], ru: ['shift', 'ы'], ua: ['shift', 'і']}"
    @shortkey="() => onShiftS()"
  >

savandriy avatar Mar 30 '19 19:03 savandriy

I just switched to hotkeys. It doesn't have that problem and did the job for me. Depends on how important reactivity is for you.

hdodov avatar Mar 30 '19 21:03 hdodov