The Key Events in GameMaker: Studio

By Michael Rohde

The Keyboard Event in GameMaker: Studio is good for when the player needs to press the key continuously, such as for moving an Instance across the Room. Key Events are one type of event that you can add to your game.

When you click Add Event, you may notice there are three different options for the keyboard: Keyboard, Key Press, and Key Release. Use the Key Press and Key Release Events to trigger an Action once each time an assigned key is pressed or released.

Each of the Key Events has a submenu, as shown in this figure, from which you can assign a key for the Action. Use <Left>, <Right>, and so on for the arrow keys on the keyboard.

The Keyboard has many options to fit your many needs.

The Keyboard has many options to fit your many needs.

The Keypad, Digits, Letters, Function keys, and Others have a tertiary menu. This figure shows the third-level submenu for Letters — say, if you want to assign W for moving up, A for moving left, D for moving right, and so on (as opposed to using the arrow keys).

Most of the keys are pretty obvious, except for No Key and Any Key. These Events check for when the player doesn’t press a key at all or presses any key on the keyboard.

Also note that the keys for the numeric keypad only work if the player has NumLock toggled.