GamepadDeadZone stick#[,trigger#][,port]

Parameters

stick - radial dead zone for both sticks, 0..0.95.
trigger (optional) - dead zone for each trigger, 0..0.95; 0.05 by default.
port (optional) - stable controller slot, 0..15; 0 by default.

Description

Sets the dead zones for GamepadAxis on the connected port. New connections default to 0.15 for sticks and 0.05 for triggers. Zero disables the corresponding dead zone. Values are clamped; non-finite values become zero. Raw Joy axes are unchanged. An absent port is ignored; configure after JoyConnected reports a connection.

Supported on Windows, macOS, iOS, Android and web, subject to device and platform capabilities. Input requires application focus; device presence and names remain queryable in the background.

See also: Controller guide and button table, JoyType, FlushJoy, Controller playground.

Example

; GamepadDeadZone example
Graphics 800,480,32,2
SetBuffer BackBuffer()
While Not KeyHit(1)
    Cls
    Text 20,20,"Connect a controller, then press a pad button. Esc exits."
    GamepadDeadZone 0.2,0.05
    Text 20,50,"Move the left stick: small drift is filtered out."
    Oval 390+GamepadAxis(1)*180,230+GamepadAxis(2)*180,20,20
    Flip
Wend
End

Index