JoyHatAngle ( [hat][,port] )

Parameters

hat (optional) - POV number, 1..4; 1 by default.
port (optional) - stable controller slot, 0..15; 0 by default.

Description

Returns a POV angle clockwise from up: 0,45,90,135,180,225,270,315. Returns -1 when centered, unfocused, unavailable or invalid. Hat 1 is also available through JoyHat(port).

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

; JoyHatAngle 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,"JoyHatAngle: "+JoyHatAngle()
    Flip
Wend
End

Index