| button - standard physical position, 1..21; see the controller guide. port (optional) - stable controller slot, 0..15; 0 by default. |
|
Returns 1 while the standard gamepad button is held, or 0 otherwise. Button 1 is the south face button (A on Xbox, Cross on PlayStation); button 2 is east, 3 west and 4 north. Missing buttons return 0. Raw JoyDown numbering is independent. 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. |
; GamepadDown 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,"GamepadDown: "+GamepadDown(1)
Flip
Wend
End