keyboard_check_released

With this function you can check to see if a key has been released or not.

Unlike the keyboard_check function, this function will only return true once in the step the key is lifted, i.e. when it switches from held down in the previous step to no longer held down in the current step. So for it to return true again, the key must be first pressed and then released again. In all other steps, the function returns false.

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.

 

Syntax:

keyboard_check_released(key);

Argument Type Description
key Virtual Key Constant (vk_*) The key to check the released state of.

 

Returns:

Boolean

 

Example:

if keyboard_check_released(ord("P"))
{
    instance_create_layer(0, 0, "Controllers", obj_Pause);
}

The above code will check to see if the "P" key has been released and if so, create an instance of obj_Pause.