gamepad_button_value


Description

With this function you can get the current value of an analogue button, from 0 to 1, where 0 is no pressure and 1 is full pressure. You supply the gamepad slot index to check, along with either a button constant (as listed here), or an integer value between 0 and gamepad_button_count() -1.


Syntax:

gamepad_button_value(device, button);

Argument Description
device Which gamepad device "slot" to check.
button Which gamepad button constant to check for.


Returns:

Real


Example:

speed = gamepad_button_value(0, gp_shoulderrb) * 4;

The above code uses the analogue trigger value from the gamepad plugged into device "slot" 0 to set the speed of the instance.