Enum KeyType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<KeyType>

    public enum KeyType
    extends java.lang.Enum<KeyType>
    This enum is a categorization of the various keys available on a normal computer keyboard that are usable (detectable) by a terminal environment. For ordinary numbers, letters and symbols, the enum value is Character but please keep in mind that newline and tab, usually represented by \n and \t, are considered their own separate values by this enum (Enter and Tab).

    Previously (before Lanterna 3.0), this enum was embedded inside the Key class.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private KeyType()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static KeyType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static KeyType[] 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 KeyType Character
        This value corresponds to a regular character 'typed', usually alphanumeric or a symbol. The one special case here is the enter key which could be expected to be returned as a '\n' character but is actually returned as a separate KeyType (see below). Tab, backspace and some others works this way too.
      • Escape

        public static final KeyType Escape
      • Backspace

        public static final KeyType Backspace
      • ArrowLeft

        public static final KeyType ArrowLeft
      • ArrowRight

        public static final KeyType ArrowRight
      • ArrowUp

        public static final KeyType ArrowUp
      • ArrowDown

        public static final KeyType ArrowDown
      • Insert

        public static final KeyType Insert
      • Delete

        public static final KeyType Delete
      • Home

        public static final KeyType Home
      • End

        public static final KeyType End
      • PageUp

        public static final KeyType PageUp
      • PageDown

        public static final KeyType PageDown
      • Tab

        public static final KeyType Tab
      • ReverseTab

        public static final KeyType ReverseTab
      • Enter

        public static final KeyType Enter
      • F1

        public static final KeyType F1
      • F2

        public static final KeyType F2
      • F3

        public static final KeyType F3
      • F4

        public static final KeyType F4
      • F5

        public static final KeyType F5
      • F6

        public static final KeyType F6
      • F7

        public static final KeyType F7
      • F8

        public static final KeyType F8
      • F9

        public static final KeyType F9
      • F10

        public static final KeyType F10
      • F11

        public static final KeyType F11
      • F12

        public static final KeyType F12
      • F13

        public static final KeyType F13
      • F14

        public static final KeyType F14
      • F15

        public static final KeyType F15
      • F16

        public static final KeyType F16
      • F17

        public static final KeyType F17
      • F18

        public static final KeyType F18
      • F19

        public static final KeyType F19
      • Unknown

        public static final KeyType Unknown
      • CursorLocation

        public static final KeyType CursorLocation
        This value is only internally within Lanterna to understand where the cursor currently is, it's not expected to be returned by the API to an input read call.
      • MouseEvent

        public static final KeyType MouseEvent
        This type is not really a key stroke but actually a 'catch-all' for mouse related events. Please note that mouse event capturing must first be enabled and many terminals don't suppose this extension at all.
      • EOF

        public static final KeyType EOF
        This value is returned when you try to read input and the input stream has been closed.
    • Constructor Detail

      • KeyType

        private KeyType()
    • Method Detail

      • values

        public static KeyType[] 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 (KeyType c : KeyType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static KeyType 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