public final class JoystickMoveEvent extends JoystickEvent
Event.Type.JOYSTICK_MOVED
.Event.Type
Modifier and Type | Field and Description |
---|---|
Joystick.Axis |
joyAxis
The joystick or gamepad axis that was moved.
|
float |
position
The position that the axis was moved to, ranging between -100 and 100.
|
joystickId
Constructor and Description |
---|
JoystickMoveEvent(int type,
int joystickId,
int joyAxis,
float position)
Constructs a new joystick axis event.
|
Modifier and Type | Method and Description |
---|---|
JoystickMoveEvent |
asJoystickMoveEvent()
Attempts to cast this event to a
JoystickMoveEvent . |
asJoystickEvent
asJoystickButtonEvent, asKeyEvent, asMouseButtonEvent, asMouseEvent, asMouseWheelEvent, asSizeEvent, asTextEvent
public final Joystick.Axis joyAxis
public final float position
public JoystickMoveEvent(int type, int joystickId, int joyAxis, float position)
type
- the type of the event.
This must be a valid ordinal in the Event.Type
enumeration.joystickId
- the joystick ID.joyAxis
- the joystick axis that was moved.
This must be a valid ordinal in the Joystick.Axis
enumeration.position
- the position that the axis was moved to.public JoystickMoveEvent asJoystickMoveEvent()
Event
JoystickMoveEvent
.asJoystickMoveEvent
in class Event
JoystickButtonEvent
if its type is
Event.Type.JOYSTICK_MOVED
, null
otherwise.