public final class JoystickButtonEvent extends JoystickEvent
Event.Type.JOYSTICK_BUTTON_PRESSED or
Event.Type.JOYSTICK_BUTTON_RELEASED.Event.Type| Modifier and Type | Field and Description |
|---|---|
int |
button
The index of the button that was pressed or released.
|
joystickId| Constructor and Description |
|---|
JoystickButtonEvent(int type,
int joystickId,
int button)
Constructs a new joystick button event.
|
| Modifier and Type | Method and Description |
|---|---|
JoystickButtonEvent |
asJoystickButtonEvent()
Attempts to cast this event to a
JoystickButtonEvent. |
asJoystickEventasJoystickMoveEvent, asKeyEvent, asMouseButtonEvent, asMouseEvent, asMouseWheelEvent, asSizeEvent, asTextEventpublic final int button
Joystick.BUTTON_COUNT (exclusive).public JoystickButtonEvent(int type,
int joystickId,
int button)
type - the type of the event.
This must be a valid ordinal in the Event.Type enumeration.joystickId - the joystick ID.button - the index of the button that was pressed.public JoystickButtonEvent asJoystickButtonEvent()
EventJoystickButtonEvent.asJoystickButtonEvent in class EventJoystickButtonEvent if its type is either
Event.Type.JOYSTICK_BUTTON_PRESSED or Event.Type.JOYSTICK_BUTTON_RELEASED,
null otherwise.