public final class MouseButtonEvent extends MouseEvent
Event.Type.MOUSE_BUTTON_PRESSED or
Event.Type.MOUSE_BUTTON_RELEASED.Event.Type| Modifier and Type | Field and Description |
|---|---|
Mouse.Button |
button
The mouse button that was pressed or released.
|
position| Constructor and Description |
|---|
MouseButtonEvent(int type,
int x,
int y,
int button)
Constructs a new mouse button event.
|
| Modifier and Type | Method and Description |
|---|---|
MouseButtonEvent |
asMouseButtonEvent()
Attempts to cast this event to a
MouseButtonEvent. |
asMouseEventasJoystickButtonEvent, asJoystickEvent, asJoystickMoveEvent, asKeyEvent, asMouseWheelEvent, asSizeEvent, asTextEventpublic final Mouse.Button button
public MouseButtonEvent(int type,
int x,
int y,
int button)
type - the type of the event.
This must be a valid ordinal in the Event.Type enumeration.x - the X coordinate of the mouse cursor relative to the window.y - the Y coordinate of the mouse cursor relative to the window.button - the button that was pressed.
This must be a valid ordinal in the Mouse.Button
enumeration.public MouseButtonEvent asMouseButtonEvent()
EventMouseButtonEvent.asMouseButtonEvent in class EventMouseButtonEvent if its type is either
Event.Type.MOUSE_BUTTON_PRESSED or Event.Type.MOUSE_BUTTON_RELEASED,
null otherwise.