Interface MouseEvent
- All Superinterfaces:
Event
Provides contextual information about mouse movement and what button caused the event.
-
Method Summary
Modifier and TypeMethodDescriptionGets the button that was pressed to trigger this event, orMouseButton.NONE
if this button is not related to a mouse button action.org.bukkit.entity.Player
Gets the player that caused this eventorg.joml.Vector2f
Gets the screen coordinates of the viewer's cursorGets the scroll direction, orScrollDirection.NONE
, if this event is not related to a scroll action.org.joml.Vector3f
Gets the world space position of the viewer's cursorboolean
Tests if the viewer has the shift key held down.Methods inherited from interface com.juliewoolie.dom.event.Event
getCurrentTarget, getDocument, getPhase, getTarget, getType, isBubbling, isCancellable, isCancelled, isComposed, isPropagationStopped, preventDefault, stopPropagation
-
Method Details
-
isShiftPressed
boolean isShiftPressed()Tests if the viewer has the shift key held down.- Returns:
true
, if the shift key was pressedfalse
otherwise
-
getButton
MouseButton getButton()Gets the button that was pressed to trigger this event, orMouseButton.NONE
if this button is not related to a mouse button action.- Returns:
- Pressed button
-
getScrollDirection
ScrollDirection getScrollDirection()Gets the scroll direction, orScrollDirection.NONE
, if this event is not related to a scroll action.- Returns:
- Scroll direction.
-
getScreenPosition
org.joml.Vector2f getScreenPosition()Gets the screen coordinates of the viewer's cursor- Returns:
- Cursor screen position
-
getWorldPosition
org.joml.Vector3f getWorldPosition()Gets the world space position of the viewer's cursor- Returns:
- Cursor world position
-
getPlayer
org.bukkit.entity.Player getPlayer()Gets the player that caused this event- Returns:
- Player
-