public class JoystickEvent extends Event
Event.Type.JOYSTICK_CONNECETED
,
Event.Type.JOYSTICK_DISCONNECTED
,
Event.Type.JOYSTICK_BUTTON_PRESSED
,
Event.Type.JOYSTICK_BUTTON_RELEASED
or
Event.Type.JOYSTICK_MOVED
.Event.Type
Modifier and Type | Field and Description |
---|---|
int |
joystickId
The index of the joystick that caused this event.
|
Constructor and Description |
---|
JoystickEvent(int type,
int joystickId)
Constructs a new joystick event.
|
Modifier and Type | Method and Description |
---|---|
JoystickEvent |
asJoystickEvent()
Attempts to cast this event to a
JoystickEvent . |
asJoystickButtonEvent, asJoystickMoveEvent, asKeyEvent, asMouseButtonEvent, asMouseEvent, asMouseWheelEvent, asSizeEvent, asTextEvent
public final int joystickId
Joystick.JOYSTICK_COUNT
(exclusive).public JoystickEvent(int type, int joystickId)
type
- the type of the event.
This must be a valid ordinal in the Event.Type
enumeration.joystickId
- the joystick ID.public JoystickEvent asJoystickEvent()
Event
JoystickEvent
.asJoystickEvent
in class Event
JoystickEvent
if its type is one of
Event.Type.JOYSTICK_CONNECETED
, Event.Type.JOYSTICK_DISCONNECTED
,
Event.Type.JOYSTICK_BUTTON_PRESSED
, Event.Type.JOYSTICK_BUTTON_RELEASED
or
Event.Type.JOYSTICK_MOVED
, null
otherwise.