mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 16:49:40 +02:00
try key codes for all non-ascii input characters
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user