markdown-toolbar-element icon indicating copy to clipboard operation
markdown-toolbar-element copied to clipboard

Hotkeys don't work on Windows with non en-us keyboard layout

Open Reeywhaar opened this issue 6 years ago • 1 comments

Current way of matching hotkey with event.key property leads to broken hotkeys on Windows (Chrome, Vivaldi at least) as, for example with ru-RU locale on keybord hitting cmd+b will send event with key property set to cyrillic "и" and not "b".

First it was found in https://github.com/umputun/remark/issues/404

Images provided by @Andrew-Shtein prove difference in key prop

Issue located here: https://github.com/github/markdown-toolbar-element/blob/dd0ffba8d9ad9d64471d3be41b3b7e1b77aa3545/index.js#L228-L236

Reeywhaar avatar Aug 13 '19 23:08 Reeywhaar

@muan not bug. That's not issue. It's expected, if you wanna create multilanguage support just add another hotkey data to div, for example:

[hotkey${currentKeyboardLang}="${event.key}"]

@koddsson, @mintbridge, @keithamus

afwn90cj93201nixr2e1re avatar Nov 15 '19 19:11 afwn90cj93201nixr2e1re