| axis - raw axis number, 1..JoyAxes(port). port (optional) - stable controller slot, 0..15; 0 by default. |
|
Returns a raw axis in -1..1, or 0 for an absent port or invalid axis. No dead zone is applied. Hardware/driver order varies: use GamepadAxis for left/right sticks and independent triggers. 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. |
; JoyAxis 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."
Text 20,60,"JoyAxis: "+JoyAxis(1)
Flip
Wend
End