Enum KeyEvent.Type

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<KeyEvent.Type>
    Enclosing class:
    KeyEvent

    public static enum KeyEvent.Type
    extends java.lang.Enum<KeyEvent.Type>
    Defines the types of key events that can occur.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      Arrow
      An arrow key was pressed.
      Character
      A printable character was typed.
      Function
      A function key was pressed (F1-F35).
      Keypad
      A keypad key was pressed.
      Media
      A media key was pressed.
      ModifierKey
      A modifier key was pressed or released as its own event.
      Special
      A special key was pressed (Enter, Tab, Escape, etc.).
      Unknown
      An unrecognized key sequence.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static KeyEvent.Type valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static KeyEvent.Type[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • Character

        public static final KeyEvent.Type Character
        A printable character was typed.
      • Arrow

        public static final KeyEvent.Type Arrow
        An arrow key was pressed.
      • Function

        public static final KeyEvent.Type Function
        A function key was pressed (F1-F35).
      • Special

        public static final KeyEvent.Type Special
        A special key was pressed (Enter, Tab, Escape, etc.).
      • Keypad

        public static final KeyEvent.Type Keypad
        A keypad key was pressed.
      • Media

        public static final KeyEvent.Type Media
        A media key was pressed.
      • ModifierKey

        public static final KeyEvent.Type ModifierKey
        A modifier key was pressed or released as its own event. Only reported by the Kitty Keyboard Protocol with ReportAllKeys.
      • Unknown

        public static final KeyEvent.Type Unknown
        An unrecognized key sequence.
    • Method Detail

      • values

        public static KeyEvent.Type[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (KeyEvent.Type c : KeyEvent.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static KeyEvent.Type valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null