Keyboard_check - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

NOTOC {{-}}

Notation

Description

Determines whether a key is currently being pressed or not. Accepts keyboard constants (eg. vk_space) for the space key.

Parameters

  • key, keyboard constant for which key to check the state of

Return Values

Returns a boolean (true or false) value whether or not the key is currently being pressed.

Example Call

if (keyboard_check(vk_right)) {
  x += 5;
}

Demonstrates checking if the right arrow key is pressed, and if so, moving 5 pixels to the right on screen.