Returns whether the given key on the keyboard is currently held down.


GML Code Example


Argument Description
key The key to check the down state of.

Returns: Boolean


With this function you can check to see if a key is held down or not. Unlike the keyboard_check_pressed or keyboard_check_released functions which are only triggered once when the key is pressed or released, this function is triggered every step that the key is held down for.


GML Code Example

if keyboard_check(vk_left)
    x -= 5;

The above code will check to see if the arrow key is being pressed and move the instance 5 pixels left every step that it returns true.

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here