Returns whether the key with the particular keycode is pressed by checking the hardware directly.



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

Returns: Boolean


This function will return true if the key with the particular keycode is pressed, or false if it is not, by checking the hardware directly. It allows for a few more checks, in particular you can use keycodes vk_lshift, vk_lcontrol, vk_lalt, vk_rshift, vk_rcontrol and vk_ralt to check whether the left or right shift, control or alt key is pressed.

NOTE: This function is only available for the standard Windows target and the result is independent of which application has focus.


if keyboard_check_direct(vk_ralt) || keyboard_check_direct(vk_lalt)
   crouch = true;

The above code will check to see if either the left or right alt keys have been pressed, and if they have it sets the variable "crouch" to true.

Back: Keyboard Input
Next: keyboard_clear
© Copyright YoYo Games Ltd. 2018 All Rights Reserved