java.lang.Object
java.lang.Enum<KeyType>
com.googlecode.lanterna.input.KeyType
All Implemented Interfaces:
Serializable, Comparable<KeyType>, java.lang.constant.Constable

public enum KeyType extends 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.

  • Enum Constant Details

    • 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 Details

    • KeyType

      private KeyType()
  • Method Details

    • values

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

      public static KeyType valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null