Package nl.saxion.app.interaction
Class MouseEvent
java.lang.Object
nl.saxion.app.interaction.MouseEvent
Details about the mouse interaction.
Gives information about which button was pressed
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getX()
X coordinate of the mouse cursorint
getY()
Y coordinate of the mouse cursorboolean
If left mouse button is used.boolean
If middle mouse button is used.boolean
Indicates if the mouse is pressed.boolean
Indicates if the mouse button is down and currently dragging.boolean
Indicates if the mouse button is released.boolean
If right mouse button is used.toString()
-
Constructor Details
-
MouseEvent
public MouseEvent(int mouseType, int mouseButton, int x, int y)
-
-
Method Details
-
isMouseDown
public boolean isMouseDown()Indicates if the mouse is pressed.- Returns:
- true, is mouse button is currently pressed.
-
isMouseUp
public boolean isMouseUp()Indicates if the mouse button is released.- Returns:
- true, is mouse button is currently released.
-
isMouseDragging
public boolean isMouseDragging()Indicates if the mouse button is down and currently dragging. Dragging means, it was already down and there is movement.- Returns:
- true, is mouse is currently pressed and dragging.
-
isLeftMouseButton
public boolean isLeftMouseButton()If left mouse button is used.- Returns:
- true, if left mouse button was used for this event.
-
isMiddleMouseButton
public boolean isMiddleMouseButton()If middle mouse button is used.- Returns:
- true, if middle mouse button was used for this event.
-
isRightMouseButton
public boolean isRightMouseButton()If right mouse button is used.- Returns:
- true, if right mouse button was used for this event.
-
getX
public int getX()X coordinate of the mouse cursor- Returns:
- X coordinate of the mouse cursor
-
getY
public int getY()Y coordinate of the mouse cursor- Returns:
- Y coordinate of the mouse cursor
-
toString
-