gamepad_button_check_released

This function will return true or false depending on whether the given gamepad button is detected as having been released or not. Note that this function will only trigger once for the button the moment it has been released. For it to trigger again the button must first be pressed and then released once more. If you are checking an analogue button, then the check will take into consideration the threshold setting and only return true when the raw input value goes under the given threshold (you can get this raw value using the function gamepad_button_value()).

 

Syntax:

gamepad_button_check_released(device, button);

ArgumentTypeDescription
deviceRealWhich gamepad device "slot" to check.
buttonGamepad Button ConstantWhich gamepad button constant to check for.

 

Returns:

Boolean

 

Example:

if (gamepad_button_check_released(0, gp_select))
{
    audio_play_sound(snd_Button, 0, false);
    global.Pause = !global.Pause;
}

The above code will detect whether the "select" button of the gamepad connected to device "slot" 0 has been pressed or not and toggle the global "Pause" variable.