Skip to content

keyboard_check_pressed

drewmccluskey edited this page Feb 12, 2019 · 4 revisions

keyboard_check_pressed

Returns if a keyboard key is being pressed

Syntax:

keyboard_check_pressed(key)
Argument Description
Keys key The keyboard button being checked if pressed

Returns: bool

Description:

This function will check if a specified key is being currently pressed and will run a function if so. This checks specifically the initial press, not the steps after while holding down the key.

Example:

if (keyboard_check_pressed(Keys.R))
{
    room_restart();
}

This code will restart the game room when the user presses the R key.

Back to Keyboard

Clone this wiki locally