diff --git a/CHANGELOG.md b/CHANGELOG.md index 103cd46e9..4cd8f2c08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :bug: Bugfixes * Fix rendering of KeepRight issues ([#8963]) * Fix KeepRight warnings showing up as "Unknown" issues ([#8925]) +* Fix `⌥` + `W` keyboard shortcut not working on MacOS in certain system languages / keyboard layouts (e.g. Spanish) ([#8905]) #### :rocket: Presets * Optimize order of values in dropdowns of `access` fields ([#8945]) * Use value of `vehicle` tag as placeholder value of `access` fields for `motor_vehicle` and `bicycle` @@ -57,6 +58,7 @@ _Breaking developer changes, which may affect downstream projects or sites that [#8774]: https://github.com/openstreetmap/iD/pull/8774 [#8811]: https://github.com/openstreetmap/iD/issues/8811 +[#8905]: https://github.com/openstreetmap/iD/issues/8905 [#8925]: https://github.com/openstreetmap/iD/issues/8925 [#8927]: https://github.com/openstreetmap/iD/issues/8927 [#8944]: https://github.com/openstreetmap/iD/issues/8944 diff --git a/modules/util/keybinding.js b/modules/util/keybinding.js index 083bfac02..152e979b8 100644 --- a/modules/util/keybinding.js +++ b/modules/util/keybinding.js @@ -73,9 +73,9 @@ export function utilKeybinding(namespace) { } // Fallback match on `KeyboardEvent.keyCode`, can happen if: - // - browser doesn't support `KeyboardEvent.key` - // - `KeyboardEvent.key` is outside ISO-Latin-1 range (cyrillic?) - if (!isMatch && tryKeyCode) { + // - `KeyboardEvent.key` is outside ASCII range (e.g. cyrillic - #4618) + // - 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); }