4 ms·
Thanks a lot for sharing! Very interesting experiment. That said, please please, no "WASD". This is very uncomfortable on non-QWERTY keyboard layouts. There
by s_gourichon 6y ago
Thanks a lot for sharing! Very interesting experiment.
That said, please please, no "WASD". This is very uncomfortable on non-QWERTY keyboard layouts.
There are two solutions to this.
# Best solution
Game programmer always mean "the group of physically-positioned keys that happen to be labelled WASD on the programmer's keyboard", not "whatever keys that are actually labelled WASD on the player's keyboard".
So, wherever possible, use an API that refers to key position, not key symbol. This is possible in most programming environments, e.g. in Javascript using https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEve...
# Alternative solution
Alternatively, use keys that are stable across most common Latin keyboards layout, which means no AMQWYZ.
ESDF is fine, as are RDFG, TFGH, or the traditional IJKL (see https://en.wikipedia.org/wiki/Arrow_keys https://en.wikipedia.org/wiki/Arrow_keys for more).
If you want to be kind to Dvorak, Bepo, Colemak and other users, prefer the first solution!
https://en.wikipedia.org/wiki/Keyboard_layout#QWERTY-based_Latin-script_keyboard_layouts https://en.wikipedia.org/wiki/Keyboard_layout#QWERTY-based_L...
- wilsonrocks 6y agoI did not know about key codes and physical position! Thank you!
- pantelisk 6y agoWoaah.. this never occurred to me. Thank you, for the suggestion. Didn't know about "KeyboardEvent.code". And of course.. arrowkeys, kinda ashamed I didn't think of that!
- moron4hire 6y ago`KeyboardEvent.code` used to be the only way we had to read key events in JS. They `key` field didn't come out until about 5 years ago.
- FullyFunctional 6y agoFunny. I had to look for WASD on my Dvorak keyboard, but that said, we are a minority. My bigger recommendation would just be to quickly mention which keys are relevant as I was left wondering if I was missing something.
- profinger 6y agoIt does do that at the beginning before you start
- FullyFunctional 6y agothanks, I must have missed that
- rangewookie 6y agoGiven that WASD is a standard in gaming I'm surprised by this approach. Do many games / game engines use key position? Isn't it easier to just add key remapping so outliers can configure freely?
- ChickeNES 6y agoYes, just allowing the keys to be remapped is simpler and would serve all users with non-standard setups, not just the handful that use alternative keyboard layouts.
- rkagerer 6y agoI'm surprised most Dvorakers don't already tend to have a utility installed to let them remap temporarily or for an application. This must be a common occurrence?
- kleiba 6y ago...or just install the US keyboard layout as an alternative to the one you typically use.
- codetrotter 6y agoTo be really pedantic, keycodes only help when the layout is being remapped in software by the operating system. There are dozens of us that use hardware Dvorak mapping. Dozens! :p So to be clear, the ideal thing to do is to allow the player to define in-game which keys should do what. But realistically speaking, I’m not going to complain because I brought this on myself when I chose to use a hardware controlled Dvorak layout. Still worth it btw ^^ I do note however, that the project is open source on GitHub, so if any of my fellow hardware controlled alternate keyboard layout peoples want to take a stab at submitting a PR for a keyboard binding config menu for the game I say go for it :)
- tomc1985 6y ago> ESDF is fine, as are RDFG, TFGH, or the traditional IJKL (see https://en.wikipedia.org/wiki/Arrow_keys https://en.wikipedia.org/wiki/Arrow_keys for more). Ugh, no. FPS has standardized on WASD over the last 20 years and people trying to reinterpret this are the bane of a positive experience. Positional keys? Sure. Whatever's in WASD's place is fine. But splitting hairs for the <1% of users using nonstandard stuff (like a dvorak keyboard, which after a lifetime of computer nerditry I still have never seen in-the-wild) will lose you a huge chunk of your audience. WASD or die
- p1necone 6y ago"Alternatively, use keys that are stable across most common Latin keyboards layout, which means no AMQWYZ." No no no no no this is a terrible idea. Don't make 99% of peoples experience non standard just so that people with non qwerty keyboards (who are probably expecting to need to remap controls anyway) have automagic defaults. Just default to the most common thing (WASD) and let people remap keybinds to whatever they want in case that doesn't fit. I'm a pretty avid gamer and I've literally never opened a PC first person/third person shooter (or other real time genres with a similar perspective) released in the last 15 years or so that didn't have movement mapped to WASD by default. Not doing so would make your game feel very unpolished. If you care about accessibility at all you need to allow button remapping anyway, even if you go with positional keybinding.