Class KeyCodeEvent<H extends EventHandler>

Type Parameters:
H - handler type
All Implemented Interfaces:
HasNativeEvent
Direct Known Subclasses:
KeyDownEvent, KeyUpEvent

public abstract class KeyCodeEvent<H extends EventHandler> extends KeyEvent<H>
Key up and key down are both events based upon a given key code.
  • Constructor Details

    • KeyCodeEvent

      public KeyCodeEvent()
  • Method Details

    • isArrow

      public static boolean isArrow(int keyCode)
      Does the key code represent an arrow key?
      Parameters:
      keyCode - the key code
      Returns:
      if it is an arrow key code
    • getNativeKeyCode

      public int getNativeKeyCode()
      Gets the native key code. These key codes are enumerated in the KeyCodes class.
      Returns:
      the key code
    • isDownArrow

      public boolean isDownArrow()
      Is this a key down arrow?
      Returns:
      whether this is a down arrow key event
    • isLeftArrow

      public boolean isLeftArrow()
      Is this a left arrow?
      Returns:
      whether this is a left arrow key event
    • isRightArrow

      public boolean isRightArrow()
      Is this a right arrow?
      Returns:
      whether this is a right arrow key event
    • isUpArrow

      public boolean isUpArrow()
      Is this a up arrow?
      Returns:
      whether this is a right arrow key event
    • toDebugString

      public String toDebugString()
      Description copied from class: Event
      This is a method used primarily for debugging. It gives a string representation of the event details. This does not override the toString method because the compiler cannot always optimize toString out correctly. Event types should override as desired.
      Overrides:
      toDebugString in class Event<H extends EventHandler>
      Returns:
      a string representing the event's specifics.