Name
JoyHat -- return state of joystick hat (V10.0)
Synopsis
state = JoyHat(port[, idx])
Function
This function returns the state of the hat of the joystick at the port specified by port. Joystick hats are also known as point-of-view d-pads. The returned state will be -1 if the hat is in the center, otherwise a value between 0 and 27000 will be returned. The optional argument idx can be used to specify the index of the joystick hat to use in case there are multiple hats on a controller. Indices start at 0.

port can range from 0 to the number of joysticks currently plugged in minus 1. You can find out the number of joysticks currently available using the CountJoysticks() function. Please note that under AmigaOS, port 0 addresses the standard joystick port although this is port 1 on classic Amiga hardware. Hollywood switches these ports for cross-platform consistency where port 0 shall always refer to the default joystick.

Inputs
port
port number (usually 0 for the standard Joystick port)
idx
optional: joystick index to query (defaults to 0)
Results
state
state of the joystick hat, ranging from -1 (center) to 27000

Show TOC