Enum Class KeyAction

java.lang.Object
java.lang.Enum<KeyAction>
org.inspirenxe.strata.api.input.KeyAction
All Implemented Interfaces:
Serializable, Comparable<KeyAction>, Constable

public enum KeyAction extends Enum<KeyAction>
What happened to a key.

A held key produces one PRESS, then REPEATs for keys that repeat, then one RELEASE. An engine that sends repeats sends them at its own rate for the keys it chooses. When an engine does not, Strata makes them for the arrow keys, Home, End, Page Up, Page Down, Backspace and Delete only, the first 400 ms after the press and then one every 33 ms, for the most recently pressed of those keys.

  • Enum Constant Details

    • PRESS

      public static final KeyAction PRESS
      The key went down.
    • REPEAT

      public static final KeyAction REPEAT
      The key is still held and repeating.
    • RELEASE

      public static final KeyAction RELEASE
      The key came up.
  • Method Details

    • values

      public static KeyAction[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static KeyAction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isDown

      public boolean isDown()
      Returns whether this is a press or a repeat: the moments when a held key should act, such as moving a caret again.
      Returns:
      true for PRESS and REPEAT