Class KeyEvent


public final class KeyEvent extends InputEvent
A keyboard event routed to the focused widget (bubbling to its ancestors until consumed). Key codes and modifiers follow Keys.
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeyEvent(int key, boolean pressed, boolean repeat, int modifiers)
    A key transition; key and modifiers are Keys constants.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether this is a press (or auto-repeat) rather than a release.
    boolean
     
    int
    key()
    The physical key, as a Keys constant, which is layout-independent.
    int
    Modifier mask held during the event; test it with the Keys.MOD_* bits.
     

    Methods inherited from class limn.scene.event.InputEvent

    consume, isConsumed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • KeyEvent

      public KeyEvent(int key, boolean pressed, boolean repeat, int modifiers)
      A key transition; key and modifiers are Keys constants.
  • Method Details

    • key

      public int key()
      The physical key, as a Keys constant, which is layout-independent.
    • isPressed

      public boolean isPressed()
      Whether this is a press (or auto-repeat) rather than a release.
    • isRepeat

      public boolean isRepeat()
      Returns:
      true for auto-repeat presses
    • modifiers

      public int modifiers()
      Modifier mask held during the event; test it with the Keys.MOD_* bits.
    • toString

      public String toString()
      Overrides:
      toString in class Object