Common keys used for games with keyboard control


#1

Hi,

I’d like to know which keys are most popular/familiar for gamers.

I’ve searched but I’m having a hard time finding any kind of dev guide for this. I just end up with coding examples of keyboard events. Does anyone know of such a guide that lists the common/standard keys used in game dev?

I’d like to hear what others here prefer, too. I’m a non-gamer trying to develop games :), so I’m not sure whats common or standard practice.

The game I’m working on atm is a platformer.

Thanks


#2

Hi dean.

It’s quite common, not to say obvious, to use the cursor keys for movement.
Those can be replaced (or being active at the same time) by W A S D.
In case of a platformer:
[Cursor up/W] - climb up a ladder
[Cursor down/S] - climb down a ladder/duck
[Cursor left/A] - move left
[Cursor right/D] - move right

For jumping I’d recommend the [Control] key.


#3

Thanks for the reply!

Yes, the arrows and WASD are what I have now. The ones that are less obvious are the JUMP and SHOOT keys. I.m using [SPACE] for jump and [J] for shoot atm, but I heard that some like to have those two keys next to each other. [CTRL] is good since there are two and can be used left and right handed. In that case,what would you use for SHOOT? The [SHIFT] keys?


#4

Different direction… but I like using the arrow keys and Z and X for actions


#5

I’d say Shift/Control for either shoot or jump are good.
Just avoid using [Space]! For more informaion take a look
at this thread: Link


#6

Thanks for that. I had no idea about that HW issue. This is good to know.


#7

Thanks! I’ve seen that some games use Z and X for actions. Since arrow keys and WASD seem to be standard, I would want to have the mirrored keys, . and /, on the other side too, for those using the WASD. Or maybe N and M, or L and K for clearer instructions, easier to see.


#8

Better yet, allow all of the above. Arrow keys and WASD to move. Z, M, L, and Shift for action 1. X, N, K, and Control for action 2.

Also, unless you have a good reason to distinguish “up” from “jump,” they should be the same key. You want to make the learning experience as simple as possible, and nothing is simpler than “press the direction you want to move.”


#9

Keep in mind that using Z and X for controls is quite awkward on QWERTZ keyboards, where Z and Y are swapped.


#10

Thanks player_03

I currently have a reason for a separate Jump button but might try to rethink that. My goal is to make it as easy to use as possible. Thanks for the advice!


#11

Thanks Gama11. I didn’t consider that. If I use Z for anything, I will also use Y so both will work.


#12

Also on French keyboards there is “ZQSD” instead of “WASD”. And on Dvorak there is “,AOE”.
In one our jam game the player on French layout was required 3 hands to play: for space, for arrows, and for mouse, because WASD was supported, but not ZQSD, poor guy :slight_smile:


#13

Thanks scorched. Looks like there’s no way to satisfy all keyboards. Maybe I should give the user an option to assign keys of their choice.


#14

I also know a way to get keys work cross-layout, but only for native targets: Layout-independent key events


#15

Yes, but the following keys satisfy Qwerty, Dvorak, and Azerty (what scorched called “French keyboards”):

public static var LEFT_KEYS(default, null):Array<Int> = [Keyboard.LEFT, Keyboard.A, Keyboard.Q];
public static var RIGHT_KEYS(default, null):Array<Int> = [Keyboard.RIGHT, Keyboard.D, Keyboard.E];
public static var UP_KEYS(default, null):Array<Int> = [Keyboard.UP, Keyboard.W, Keyboard.Z, Keyboard.COMMA];
public static var DOWN_KEYS(default, null):Array<Int> = [Keyboard.DOWN, Keyboard.S, Keyboard.O];
public static var ACTION_KEYS(default, null):Array<Int> = [Keyboard.SPACE, Keyboard.X, Keyboard.M];
public static var SECONDARY_ACTION_KEYS(default, null):Array<Int> = [Keyboard.SHIFT, Keyboard.C, Keyboard.V, Keyboard.N];
public static var JUMP_KEYS(default, null):Array<Int> = [Keyboard.SPACE, Keyboard.X, Keyboard.M, Keyboard.UP, Keyboard.W, Keyboard.Z, Keyboard.COMMA];
public static var PAUSE_KEYS(default, null):Array<Int> = [Keyboard.ESCAPE, Keyboard.P, Keyboard.ENTER, Keyboard.BACKSPACE];

Personally, I use Colemak (which can’t be reconciled with Qwerty), and it still works. I just use the arrow keys, X, and C.

I deliberately left out the Control key, since Control+W is (at least on Windows) a shortcut to close the active window.


#16

That’s great. Thanks player_03!