Joystick

Sends information about the Joystick state.

num joystick

Index number of the joystick to catch (if several joysticks are connected to the computer).

axis [1..N]

Positions of axis.

buttons [1..N]

Sends 1 if the Nth Button is pressed.

trackballs dx, dy [1..N]

Returns relative motion since the last calculation, these motion deltas are placed into dx and dy.

hats [1..N]

Gets the current state of a POV hat on a joystick according the following values:

  • HAT_CENTERED = 0
  • HAT_UP = 1
  • HAT_RIGHT = 2
  • HAT_DOWN = 4
  • HAT_LEFT = 8
  • HAT_RIGHTUP = 3
  • HAT_RIGHTDOWN = 6
  • HAT_LEFTUP = 9
  • HAT_LEFTDOWN = 12