Joystick SensorΒΆ

../../../../_images/bge_sensor_joystick1.jpg

Joystick sensor.

The Joystick sensor triggers whenever the joystick moves. It also detects events on a range of ancillary controls on the joystick device (hat, buttons, etc.). More than one joystick may be used (see “Index”). The exact layout of the joystick controls will depend on the make and model of joystick used.

See Sensor Common Options for common options.

Special Options:

Index
Specifies which joystick to use.
All Events
Sensor triggers for all events on this joystick’s current type.
../../../../_images/bge_sensor_joystick_event.jpg

Joystick Events.

Event Type
A menu to select which joystick event to use.

Single Axis

../../../../_images/bge_sensor_joystick_singaxis.png

Joystick Single Axis.

Single Axis

Detect movement in a single joystick Axis.

Axis Number
  • 1 = Horizontal axis (left/right)
  • 2 = Vertical axis (forward/back)
  • 3 = Paddle axis up/down
  • 4 = Joystick axis twist left/right
Axis Threshold
Threshold at which joystick fires (Range 0 - 32768)

Hat

../../../../_images/bge_sensor_joystick_hat.png

Joystick Hat.

Hat

Detect movement of a specific hat control on the joystick.

Hat number
Specifies which hat to use (max. 2).
Hat Direction
Specifies the direction to use: up, down, left, right, up/right, up/left, down/right, down/left.

Axis

../../../../_images/bge_sensor_joystick_axis.jpg

Joystick Axis.

Axis
Axis Number
Specifies the axis (1 or 2).
Axis Threshold
Threshold at which joystick fires (Range 0 - 32768).
Axis Direction

Specifies the direction to use:

  • (Axis Number = 1) Joystick Left, Right, Up, Down
  • (Axis Number = 2) Paddle upper (Left); paddle Lower (Right);
  • Joystick twist left (Up) Joystick twist right (Down)

Button

../../../../_images/bge_sensor_joystick1.jpg

Joystick Button.

Button
Specify the button number to use.