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, asTextEventpublic 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()
EventJoystickEvent.asJoystickEvent in class EventJoystickEvent 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.