Add support for `event.code`
Open
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 99
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 6
Description
While it may prove impossible to smooth over all OS / keyboard layout differences in `event.key`, providing access to mapping hotkeys to an [`event.code`](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_code_values) may help in some situations (for example WASD navigation)
[VS Code allows this via wrapping the code in `[]`](https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-layoutindependent-bindings): for example `[KeyA]` would match on `event.code === "KeyA"`.
This allows for some flexibility to map shortcuts to physical locations on the keyboard (eg WASD navigation etc.)
Contributor guide
Assessment
This issue has not been assessed yet.