Event Window.JoyAxisMove (gb.sdl)

Event JoyAxisMove ( )

Raised when the stick (or assimilated) of an enabled joystick is moved while the Window has the focus.

You get information about the axis moved with the Joystick class.

Example

PUBLIC SUB screen_JoyAxisMove()

  ' Move the player using the first stick
  ' X axis
  IF (Joystick.Id = 0) THEN
    IF (Joystick.Axis > 0) THEN MoveX = 1
    IF (Joystick.Axis < 0) THEN MoveX = -1
    IF (Joystick.Axis = 0) THEN MoveX = 0
  ENDIF
  ' Y axis
  IF (Joystick.Id = 1) THEN
    IF (Joystick.Axis > 0) THEN MoveY = 1
    IF (Joystick.Axis < 0) THEN MoveY = -1
    IF (Joystick.Axis = 0) THEN MoveY = 0
  ENDIF

END