Package me.hackware.api.event.impl
Class KeyPressEvent
java.lang.Object
me.hackware.api.event.Event
me.hackware.api.event.impl.KeyPressEvent
Fired when a key is pressed, released, or repeated.
Cancellable — cancelling prevents the key event from propagating.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionKeyPressEvent(int key, int scanCode, KeyPressEvent.Action action, int modifiers) -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyPressEvent.ActionfromGlfw(int action) Whether this is a press, release, or repeat.intgetKey()GLFW key code.intBitfield of held modifier keys (Shift, Ctrl, Alt, Super).intPlatform-specific scan code.booleanisPress()booleanMethods inherited from class me.hackware.api.event.Event
cancel, isCancelled
-
Constructor Details
-
KeyPressEvent
-
-
Method Details
-
getKey
public int getKey()GLFW key code. -
getScanCode
public int getScanCode()Platform-specific scan code. -
getAction
Whether this is a press, release, or repeat. -
getModifiers
public int getModifiers()Bitfield of held modifier keys (Shift, Ctrl, Alt, Super). -
isPress
public boolean isPress() -
isRelease
public boolean isRelease() -
fromGlfw
-