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.
The function will take a keycode value as returned by the function ord (only capital letters from A-Z or numbers from 0-9), or any of the vk_* constants listed on the main Keyboard Input page.
NOTE This function is only available for the standard Windows target and the result is independent of which application has focus. On all other platforms it behaves the same as keyboard_check.
keyboard_check_direct(key);
Argument | Type | Description |
---|---|---|
key | Virtual Key Constant (vk_*) | The key to check the down state of. |
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.