A plea for scancodes

Guys and girl(s), when you make a game with keyboard input, please remember that not everybody is using a qwerty keymap. There are others, like azerty (French), qwertz, bépo, dvorak, and another one whose name I forgot.

So for example wasd for movement is pretty terrible and totally unplayable on an azerty keyboard… *Unless* you use scancodes and not ascii codes to bind keys to actions. That is to say, use the position of the key on the keyboard and not the letter that’s printed on it.

How to do that will depend on your framework/engine/OS of choice.

Other solutions:
– use non-moving keys like shift, alt, ctrl, space, the arrows, return, etc. (Some combinations can be problematic, for example DOWN+LEFT+CTRL doesn’t work here.)
– let the player choose his or her key mappings.

I can change my keymap to qwerty before playing your game, and set it back to azerty after, but it’s a pain…

Comments

26. Aug 2010 · 20:30 UTC
Remappable keys is probably the ideal solution, but I don’t think many frameworks have support for it built in, and it’s something that would take time away from actually making the game… I’ll have to try and remember to add it to whatever framework I plan to use next time.
snowyowl
26. Aug 2010 · 20:42 UTC
Well, Game Maker has remappable keys but not scancodes, so I’ll take that into consideration in future. I tend to use the arrow keys for controls anyway.
PsySal
26. Aug 2010 · 21:10 UTC
Ah, awesome. What’s amazing about this is I didn’t understand that’s how scancodes work. Remappable keys is good, but why does it have to be one or the other? Use scancodes and make them remappable.
26. Aug 2010 · 21:43 UTC
I picked up a crazy DVORAK keyboard that does switching in hardware. So any time I have to play something, I can switch modes with a key combo. Windows supports a hotkey for mode switching (default: CTRL+SHIFT). I use that on my netbook, and it’s not so bad. I think every OS supports a mode switch key, so instead of being annoyed, you could compromise.
26. Aug 2010 · 22:04 UTC
Even if you were to use scancodes (and I’ve never heard of a game doing so), what would you write in the instructions? “Press the key that would be W on a QWERTY keyboard”?
27. Aug 2010 · 22:56 UTC
or implement a vuia-movement instead of wasd-movement 😉 (NEO 2.0 anyone?)