Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Reeywhaar opened this issue Aug 13, 2019 · 1 comment
Open

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

Reeywhaar opened this issue Aug 13, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@Reeywhaar
Copy link

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 umputun/remark42#404

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

Issue located here:

function shortcut(toolbar: Element, event: KeyboardEvent) {
if ((event.metaKey && modifierKey === 'Meta') || (event.ctrlKey && modifierKey === 'Control')) {
const button = toolbar.querySelector(`[hotkey="${event.key}"]`)
if (button) {
button.click()
event.preventDefault()
}
}
}

@Reeywhaar Reeywhaar changed the title Hotkeys don't work on Windows with non en-us locale Hotkeys don't work on Windows with non en-us keyboard layout Aug 13, 2019
@muan muan added the bug Something isn't working label Aug 14, 2019
@afwn90cj93201nixr2e1re
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants