3 ms·
About WASD controls and alternative layouts: apparently JS supports key codes. [1] https://www.w3schools.com/jsref/event_key_keycode.asp https://www.w3schools.
by leni536 8y ago
About WASD controls and alternative layouts: apparently JS supports key codes.
[1] https://www.w3schools.com/jsref/event_key_keycode.asp https://www.w3schools.com/jsref/event_key_keycode.asp
[2] https://keycode.info/ https://keycode.info/
Edit: Apparently it is deprecated:
[3] https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEve...
[4] https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEve...
Also there doesn't seem to be a way to detect the user's preferred layout before pressing any keys, that would make printing the instructions hard.
- Aardwolf 8y agoThe linked article [3] links to KeyboardEvent.code which is not deprecated and still supports physical layout
- codetrotter 8y ago> Also there doesn't seem to be a way to detect the user's preferred layout before pressing any keys, that would make printing the instructions hard I am using a programmable keyboard that I’ve set up with a Dvorak-based layout. Here: https://configure.ergodox-ez.com/layouts/ENb6/latest/0 https://configure.ergodox-ez.com/layouts/ENb6/latest/0 Games defaulting to WASD are fine as long as they allow changing the keybindings in the game. I prefer that games do not try to detect keyboard layout because they’d probably get it wrong anyway.