try key codes for all non-ascii input characters

This commit is contained in:
Martin Raifer
2022-02-11 16:17:26 +01:00
parent bb3ab9257a
commit 22bd62836d
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -54,7 +54,7 @@ export function utilKeybinding(namespace) {
// Prefer a match on `KeyboardEvent.key`
if (event.key !== undefined) {
tryKeyCode = (event.key.charCodeAt(0) > 255); // outside ISO-Latin-1
tryKeyCode = (event.key.charCodeAt(0) > 127); // outside ISO-Latin-1
isMatch = true;
if (binding.event.key === undefined) {
@@ -73,7 +73,7 @@ export function utilKeybinding(namespace) {
}
// Fallback match on `KeyboardEvent.keyCode`, can happen if:
// - `KeyboardEvent.key` is outside ASCII range (e.g. cyrillic - #4618)
// - `KeyboardEvent.key` is outside ASCII range (e.g. cyrillic - # )
// - alt/option/⌥ key is also requested (e.g. Spanish keyboard on MacOS - #8905)
if (!isMatch && (tryKeyCode || binding.event.modifiers.altKey)) {
isMatch = (event.keyCode === binding.event.keyCode);