Class KeyPressEvent

java.lang.Object
me.hackware.api.event.Event
me.hackware.api.event.impl.KeyPressEvent

public class KeyPressEvent extends Event
Fired when a key is pressed, released, or repeated. Cancellable — cancelling prevents the key event from propagating.
  • Constructor Details

    • KeyPressEvent

      public KeyPressEvent(int key, int scanCode, KeyPressEvent.Action action, int modifiers)
  • Method Details

    • getKey

      public int getKey()
      GLFW key code.
    • getScanCode

      public int getScanCode()
      Platform-specific scan code.
    • getAction

      public KeyPressEvent.Action 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

      public static KeyPressEvent.Action fromGlfw(int action)