Class AsyncModifiedInputEvent
java.lang.Object
org.bukkit.event.Event
xyz.gmitch215.socketmc.events.SocketEvent
xyz.gmitch215.socketmc.events.input.AsyncModifiedInputEvent
- Direct Known Subclasses:
AsyncPlayerClickMouseEvent
,AsyncPlayerPressKeyEvent
Represents an input event that can be modified using a keyboard modifier (Shift, Ctrl, Caps Lock, etc.).
Input events hook directly into the internal KeyboardHandler and are therefore called before any other click or input-related events.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionAsyncModifiedInputEvent
(@NotNull SocketPlayer player, int flags) Constructs a new ModifiedInputEvent. -
Method Summary
Modifier and TypeMethodDescriptionint
getFlags()
Gets all of the flags on the key press.boolean
Checks if an alt key was pressed.boolean
Checks if caps lock is enabled.boolean
Checks if a control key was pressed.boolean
Checks if num lock is enabled.boolean
Checks if a shift key was pressed.boolean
Checks if a super key was pressed.Methods inherited from class xyz.gmitch215.socketmc.events.SocketEvent
getHandlerList, getHandlers, getPlayer, getSocketPlayer, toString
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
AsyncModifiedInputEvent
Constructs a new ModifiedInputEvent.- Parameters:
player
- The player that triggered the event.flags
- The flags that were active when the event occurred.
-
-
Method Details
-
getFlags
public int getFlags()Gets all of the flags on the key press.- Returns:
- Bitfield for flags of the key press
-
isShiftPressed
public boolean isShiftPressed()Checks if a shift key was pressed.- Returns:
- True if a shift key was pressed during the key press
-
isCtrlPressed
public boolean isCtrlPressed()Checks if a control key was pressed.- Returns:
- True if a control key was pressed during the key press
-
isAltPressed
public boolean isAltPressed()Checks if an alt key was pressed.- Returns:
- True if an alt key was pressed during the key press
-
isSuperPressed
public boolean isSuperPressed()Checks if a super key was pressed.- Returns:
- True if a super key was pressed during the key press
-
isCapsLockPressed
public boolean isCapsLockPressed()Checks if caps lock is enabled.- Returns:
- True if the caps lock key was enabled during the key press
-
isNumLockPressed
public boolean isNumLockPressed()Checks if num lock is enabled.- Returns:
- True if the num lock key was enabled during the key press
-