gamepad_set_axis_deadzone

Set the dead-zone (input cut-off) for the axis values returned by the device.

Syntax:

gamepad_set_axis_deadzone(device, deadzone);


Argument Description
device Which gamepad device "slot" to check.
deadzone The dead zone value from 0 to 1.


Returns: N/A


Description

This function can be used to set the "dead zone" of the joystick axis. You specify the device slot to set, and then set a value from 0 to 1 and if the input amount is lower than the given value, the joystick axis is considered to be at 0. Note that this is a global setting that will affect all axis of all joysticks connected to the device slot specified.


Example:

if gamepad_is_connected(0) gamepad_set_axis_deadzone(0, 0.05);
if gamepad_is_connected(1) gamepad_set_axis_deadzone(1, 0.05);
if gamepad_is_connected(2) gamepad_set_axis_deadzone(2, 0.05);
if gamepad_is_connected(3) gamepad_set_axis_deadzone(3, 0.05);

The above code will set the dead zone of the joystick axis on any of 4 connected devices to 0.05.


Back: GamePad Input
Next: gamepad_set_colour
© Copyright YoYo Games Ltd. 2017 All Rights Reserved