Class KeyEvent
java.lang.Object
dev.myriadclient.api.event.Cancellable
dev.myriadclient.api.event.events.KeyEvent
A keyboard key was pressed, released or repeated (held down) in the game window, in a screen or not. Posted on the
render thread before Minecraft handles it; a typed character follows as a
CharEvent. Cancel it to hide it
from Minecraft (no key binding, no screen input).-
Constructor Summary
ConstructorsConstructorDescriptionKeyEvent(int key, int scancode, int action, int modifiers, boolean inScreen) Core's; only Myriad makes these. -
Method Summary
Modifier and TypeMethodDescriptionintaction()InputConstants.PRESS,InputConstants.RELEASEorInputConstants.REPEAT.booleaninScreen()Whether a screen was open when the key changed.booleanisPress()Whether the key went down (not a repeat).booleanWhether the key came up.intkey()Which key, by its position on the keyboard: anInputConstants.KEY_*value (Q is where a US layout has it).intThe modifier keys held, asInputConstants.MOD_*bits (MOD_SHIFT,MOD_CONTROL...).intscancode()What the key types on the player's layout (an SDL keycode:'q'for the key labelled Q, wherever it is).Methods inherited from class Cancellable
cancel, isCancelled, setCancelled
-
Constructor Details
-
KeyEvent
@Internal public KeyEvent(int key, int scancode, int action, int modifiers, boolean inScreen) Core's; only Myriad makes these.
-
-
Method Details
-
key
public int key()Which key, by its position on the keyboard: anInputConstants.KEY_*value (Q is where a US layout has it). -
scancode
public int scancode()What the key types on the player's layout (an SDL keycode:'q'for the key labelled Q, wherever it is). -
action
public int action()InputConstants.PRESS,InputConstants.RELEASEorInputConstants.REPEAT. -
modifiers
public int modifiers()The modifier keys held, asInputConstants.MOD_*bits (MOD_SHIFT,MOD_CONTROL...). -
inScreen
public boolean inScreen()Whether a screen was open when the key changed. -
isPress
public boolean isPress()Whether the key went down (not a repeat). -
isRelease
public boolean isRelease()Whether the key came up.
-