Joystick

Function NumJoysticks()

Returns the number of joysticks detected.


Function NumJoyAxes(joy_num)

Returns the number of axes detected on a joystick.

Axes are normally either the analog sticks or trigger buttons but can be anything with multiple values between no activation and max activation.


Function NumJoyButtons(joy_num)

Returns the number of buttons on a joystick.


Function NumJoyHats(joy_num)

Returns the number of hats on a joystick.


Function NumJoyTrackBalls(joy_num)

Returns the number of trackballs detected on a joystick.


Function JoyAxis(joy_num, joy_axis)

Returns the value of an axis on a joystick.


Function JoyButton(joy_num, joy_button)

Returns true if the given button was pressed and false otherwise.


Function JoyHat(joy_num, joy_hat)

Returns the position of the Hat.

Possible Hat Positions:

  • HAT_CENTERED
  • HAT_LEFT
  • HAT_RIGHT
  • HAT_UP
  • HAT_DOWN
  • HAT_RIGHTUP
  • HAT_RIGHTDOWN
  • HAT_LEFTUP
  • HAT_LEFTDOWN

Sub GetJoyTrackBall(joy_num, ball, byref dx, byref dy)

Gets the axis values of a track ball.


Function JoyName$(joy_num)

Returns the joystick name.


Function JoystickIsConnected(joy_num)

Returns true if joystick is connected, or false if it isn’t.


Sub JoyRumblePlay(joy_num, strength, duration)

Rumbles a joystick at a specified strength for the specifed duration.

  • Strength - A value between 0 and 1.
  • Duration - Value is in milliseconds.

Sub JoyRumbleStop(joy_num)

Stops the rumble on a joystick


Function JoystickIsHaptic(joy_num)

Returns true if joystick has the ability to rumble.