Package org.aesh.terminal
Enum Key
- All Implemented Interfaces:
Serializable,Comparable<Key>,java.lang.constant.Constable,KeyAction
ANSCII enum key chart
- Author:
- Ståle W. Pedersen
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLowercase a key.Uppercase A key.Ampersand (&) key.Apostrophe (') key.At (@) key.Lowercase b key.Uppercase B key.Backslash (\) key.Backspace key.Lowercase c key.Uppercase C key.Colon (:) key.Comma (,) key.Control + A key.Control + @ key.Control + B key.Control + C key.Control + D key.Control + Down arrow key.Control + E key.Control + F key.Control + G key.Control + H key.Control + I key.Control + J key.Control + K key.Control + L key.Control + Left arrow key.Control + M key.Control + N key.Control + O key.Control + P key.Control + Q key.Control + R key.Control + Right arrow key.Control + S key.Control + T key.Control + U key.Control + Up arrow key.Control + V key.Control + W key.Control + X key.Control + X followed by Control + U combination.Control + Y key.Control + Z key.Lowercase d key.Uppercase D key.Delete key.Dollar ($) key.Down arrow key.Down arrow key (alternate encoding).Lowercase e key.Uppercase E key.Number 8 key.End key.End key (alternate encoding).End key (alternate encoding).Enter key.Enter key (alternate encoding for Windows CR+LF).Equals (=) key.Escape key (also Control + [).Exclamation mark (!)Lowercase f key.Uppercase F key.File separator key (Control + \).Number 5 key.Number 4 key.Lowercase g key.Uppercase G key.Grave accent (`) key.Greater than (>) key.Group separator key (Control + ]).Lowercase h key.Uppercase H key.Hash (#) key.Hat (^) key.Home key.Home key (alternate encoding).Home key (alternate encoding).Lowercase i key.Uppercase I key.Insert key.Lowercase j key.Uppercase J key.Lowercase k key.Uppercase K key.Lowercase l key.Uppercase L key.Left arrow key.Left arrow key (alternate encoding).Left curly bracket ({) key.Left parenthesis (() key.Left square bracket ([) key.Less than (<) key.Lowercase m key.Uppercase M key.Meta (Alt) + a combination.Meta (Alt) + b combination.Meta (Alt) + Backspace combination.Meta (Alt) + c combination.Meta (Alt) + Control + D combination.Meta (Alt) + Control + J combination.Meta (Alt) + d combination.Meta (Alt) + e combination.Meta (Alt) + f combination.Meta (Alt) + l combination.Meta (Alt) + Right arrow key.Meta (Alt) + t combination.Meta (Alt) + u combination.Minus (-) key.Lowercase n key.Uppercase N key.Number 9 key.Lowercase o key.Uppercase O key.Number 1 key.Lowercase p key.Uppercase P key.Percent (%) key.Period (.) key.Page Down key.Page Down key (alternate encoding for Solaris).Page Up key.Page Up key (alternate encoding for Solaris).Plus (+) key.Lowercase q key.Uppercase Q key.Question mark (?)Quote (") key.Lowercase r key.Uppercase R key.Record separator key (Control + ^).Right arrow key.Right arrow key (alternate encoding).Right curly bracket (}) key.Right parenthesis ()) key.Right square bracket (]) key.Lowercase s key.Uppercase S key.Semicolon (;) key.Number 7 key.Number 6 key.Slash (/) key.Space key.Star (*) key.Lowercase t key.Uppercase T key.Number 3 key.Tilde (~) key.Number 2 key.Lowercase u key.Uppercase U key.Underscore (_) key.Unit separator key (Control + _).Up arrow key.Up arrow key (alternate encoding).Lowercase v key.Uppercase V key.Vertical bar (|) key.Lowercase w key.Uppercase W key.Windows escape sequence identifier.Windows escape sequence identifier (alternate).Lowercase x key.Uppercase X key.Lowercase y key.Uppercase Y key.Lowercase z key.Uppercase Z key.Number 0 key. -
Method Summary
Modifier and TypeMethodDescriptionbuffer()Get the key values as an IntBuffer.booleancontainKey(int[] input) Checks if this key's values are contained within the input array.booleanequalTo(int[] otherValues) Checks if this key's values are equal to the given array.booleanChecks if this key's values are equal to the given KeyAction.static KeyfindStartKey(int[] input) Finds the Key that matches the start of the input array.static KeyfindStartKey(int[] input, int position) Finds the Key that matches the input array starting at the given position.charReturns the key value as a character.intgetCodePointAt(int index) Get the code point at the specified index.intReturns the first key value.static KeygetKey(int[] otherValues) Finds the Key enum constant that matches the given values.int[]Returns the key values as an int array.Returns the key values converted to a String.booleaninputStartsWithKey(int[] input) Checks if the input array starts with this key's values.booleaninputStartsWithKey(int[] input, int position) Checks if the input array starts with this key's values at the given position.booleanChecks if this key represents an alphabetic character (a-z or A-Z).booleanisNumber()Checks if this key represents a numeric digit (0-9).booleanChecks if this key represents a printable character.static booleanisPrintable(int value) Checks if the given code point value represents a printable character.static booleanisPrintable(int[] keyValues) Checks if the given key values represent a single printable character.static booleanisPrintable(IntBuffer keyValues) Checks if the given IntBuffer key values represent a single printable character.intlength()Get the number of code points in this key action.static booleanstartsWithEscape(int[] input) Checks if the input starts with an escape sequence.static KeyReturns the enum constant of this type with the specified name.static Key[]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, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface org.aesh.terminal.KeyAction
bufferEquals, name
-
Enum Constant Details
-
CTRL_AT
Control + @ key. -
CTRL_A
Control + A key. -
CTRL_B
Control + B key. -
CTRL_C
Control + C key. -
CTRL_D
Control + D key. -
CTRL_E
Control + E key. -
CTRL_F
Control + F key. -
CTRL_G
Control + G key. -
CTRL_H
Control + H key. -
CTRL_I
Control + I key. -
CTRL_J
Control + J key. -
CTRL_K
Control + K key. -
CTRL_L
Control + L key. -
CTRL_M
Control + M key. -
CTRL_N
Control + N key. -
CTRL_O
Control + O key. -
CTRL_P
Control + P key. -
CTRL_Q
Control + Q key. -
CTRL_R
Control + R key. -
CTRL_S
Control + S key. -
CTRL_T
Control + T key. -
CTRL_U
Control + U key. -
CTRL_V
Control + V key. -
CTRL_W
Control + W key. -
CTRL_X
Control + X key. -
CTRL_Y
Control + Y key. -
CTRL_Z
Control + Z key. -
ESC
Escape key (also Control + [). -
FILE_SEPARATOR
File separator key (Control + \). -
GROUP_SEPARATOR
Group separator key (Control + ]). -
RECORD_SEPARATOR
Record separator key (Control + ^). -
UNIT_SEPARATOR
Unit separator key (Control + _). -
SPACE
Space key. -
EXCLAMATION
Exclamation mark (!) key. -
QUOTE
Quote (") key. -
HASH
Hash (#) key. -
DOLLAR
Dollar ($) key. -
PERCENT
Percent (%) key. -
AMPERSAND
Ampersand (&) key. -
APOSTROPHE
Apostrophe (') key. -
LEFT_PARANTHESIS
Left parenthesis (() key. -
RIGHT_PARANTHESIS
Right parenthesis ()) key. -
STAR
Star (*) key. -
PLUS
Plus (+) key. -
COMMA
Comma (,) key. -
MINUS
Minus (-) key. -
PERIOD
Period (.) key. -
SLASH
Slash (/) key. -
ZERO
Number 0 key. -
ONE
Number 1 key. -
TWO
Number 2 key. -
THREE
Number 3 key. -
FOUR
Number 4 key. -
FIVE
Number 5 key. -
SIX
Number 6 key. -
SEVEN
Number 7 key. -
EIGHT
Number 8 key. -
NINE
Number 9 key. -
COLON
Colon (:) key. -
SEMI_COLON
Semicolon (;) key. -
LESS_THAN
Less than (<) key. -
EQUALS
Equals (=) key. -
GREATER_THAN
Greater than (>) key. -
QUESTION_MARK
Question mark (?) key. -
AT
At (@) key. -
A
Uppercase A key. -
B
Uppercase B key. -
C
Uppercase C key. -
D
Uppercase D key. -
E
Uppercase E key. -
F
Uppercase F key. -
G
Uppercase G key. -
H
Uppercase H key. -
I
Uppercase I key. -
J
Uppercase J key. -
K
Uppercase K key. -
L
Uppercase L key. -
M
Uppercase M key. -
N
Uppercase N key. -
O
Uppercase O key. -
P
Uppercase P key. -
Q
Uppercase Q key. -
R
Uppercase R key. -
S
Uppercase S key. -
T
Uppercase T key. -
U
Uppercase U key. -
V
Uppercase V key. -
W
Uppercase W key. -
X
Uppercase X key. -
Y
Uppercase Y key. -
Z
Uppercase Z key. -
LEFT_SQUARE_BRACKET
Left square bracket ([) key. -
BACKSLASH
Backslash (\) key. -
RIGHT_SQUARE_BRACKET
Right square bracket (]) key. -
HAT
Hat (^) key. -
UNDERSCORE
Underscore (_) key. -
GRAVE
Grave accent (`) key. -
a
Lowercase a key. -
b
Lowercase b key. -
c
Lowercase c key. -
d
Lowercase d key. -
e
Lowercase e key. -
f
Lowercase f key. -
g
Lowercase g key. -
h
Lowercase h key. -
i
Lowercase i key. -
j
Lowercase j key. -
k
Lowercase k key. -
l
Lowercase l key. -
m
Lowercase m key. -
n
Lowercase n key. -
o
Lowercase o key. -
p
Lowercase p key. -
q
Lowercase q key. -
r
Lowercase r key. -
s
Lowercase s key. -
t
Lowercase t key. -
u
Lowercase u key. -
v
Lowercase v key. -
w
Lowercase w key. -
x
Lowercase x key. -
y
Lowercase y key. -
z
Lowercase z key. -
LEFT_CURLY_BRACKET
Left curly bracket ({) key. -
VERTICAL_BAR
Vertical bar (|) key. -
RIGHT_CURLY_BRACKET
Right curly bracket (}) key. -
TILDE
Tilde (~) key. -
BACKSPACE
Backspace key. -
WINDOWS_ESC
Windows escape sequence identifier. -
WINDOWS_ESC_2
Windows escape sequence identifier (alternate). -
UP
Up arrow key. -
DOWN
Down arrow key. -
RIGHT
Right arrow key. -
LEFT
Left arrow key. -
UP_2
Up arrow key (alternate encoding). -
DOWN_2
Down arrow key (alternate encoding). -
RIGHT_2
Right arrow key (alternate encoding). -
LEFT_2
Left arrow key (alternate encoding). -
META_a
Meta (Alt) + a combination. -
META_b
Meta (Alt) + b combination. -
META_c
Meta (Alt) + c combination. -
META_d
Meta (Alt) + d combination. -
META_e
Meta (Alt) + e combination. -
META_f
Meta (Alt) + f combination. -
META_l
Meta (Alt) + l combination. -
META_t
Meta (Alt) + t combination. -
META_u
Meta (Alt) + u combination. -
META_BACKSPACE
Meta (Alt) + Backspace combination. -
DELETE
Delete key. -
INSERT
Insert key. -
PGUP
Page Up key. -
PGUP_2
Page Up key (alternate encoding for Solaris). -
PGDOWN
Page Down key. -
PGDOWN_2
Page Down key (alternate encoding for Solaris). -
HOME
Home key. -
HOME_2
Home key (alternate encoding). -
HOME_3
Home key (alternate encoding). -
END
End key. -
END_2
End key (alternate encoding). -
END_3
End key (alternate encoding). -
META_CTRL_J
Meta (Alt) + Control + J combination. -
META_CTRL_D
Meta (Alt) + Control + D combination. -
CTRL_X_CTRL_U
Control + X followed by Control + U combination. -
CTRL_LEFT
Control + Left arrow key. -
CTRL_RIGHT
Control + Right arrow key. -
CTRL_UP
Control + Up arrow key. -
CTRL_DOWN
Control + Down arrow key. -
META_RIGHT
Meta (Alt) + Right arrow key. -
ENTER
Enter key. -
ENTER_2
Enter key (alternate encoding for Windows CR+LF).
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
isCharacter
public boolean isCharacter()Checks if this key represents an alphabetic character (a-z or A-Z).- Returns:
- true if this key is an alphabetic character
-
isNumber
public boolean isNumber()Checks if this key represents a numeric digit (0-9).- Returns:
- true if this key is a numeric digit
-
isPrintable
public boolean isPrintable()Checks if this key represents a printable character.- Returns:
- true if this key is a printable character
-
isPrintable
public static boolean isPrintable(int value) Checks if the given code point value represents a printable character.- Parameters:
value- the code point value to check- Returns:
- true if the value represents a printable character
-
isPrintable
public static boolean isPrintable(int[] keyValues) Checks if the given key values represent a single printable character.- Parameters:
keyValues- the array of key values to check- Returns:
- true if the values represent a single printable character
-
isPrintable
Checks if the given IntBuffer key values represent a single printable character.- Parameters:
keyValues- the IntBuffer of key values to check- Returns:
- true if the values represent a single printable character
-
getAsChar
public char getAsChar()Returns the key value as a character.- Returns:
- the first key value as a char
-
getKeyValues
public int[] getKeyValues()Returns the key values as an int array.- Returns:
- the array of key code points
-
getKeyValuesAsString
Returns the key values converted to a String.- Returns:
- the key values as a String
-
getFirstValue
public int getFirstValue()Returns the first key value.- Returns:
- the first code point value of this key
-
startsWithEscape
public static boolean startsWithEscape(int[] input) Checks if the input starts with an escape sequence.- Parameters:
input- the input array to check- Returns:
- true if the input starts with an escape character
-
getKey
Finds the Key enum constant that matches the given values.- Parameters:
otherValues- the key values to match- Returns:
- the matching Key, or null if no match is found
-
findStartKey
Finds the Key that matches the start of the input array.- Parameters:
input- the input array to search- Returns:
- the matching Key, or null if no match is found
-
findStartKey
Finds the Key that matches the input array starting at the given position.- Parameters:
input- the input array to searchposition- the starting position in the input array- Returns:
- the matching Key, or null if no match is found
-
inputStartsWithKey
public boolean inputStartsWithKey(int[] input) Checks if the input array starts with this key's values.- Parameters:
input- the input array to check- Returns:
- true if the input starts with this key's values
-
inputStartsWithKey
public boolean inputStartsWithKey(int[] input, int position) Checks if the input array starts with this key's values at the given position.- Parameters:
input- the input array to checkposition- the starting position in the input array- Returns:
- true if the input starts with this key's values at the given position
-
containKey
public boolean containKey(int[] input) Checks if this key's values are contained within the input array.- Parameters:
input- the input array to search- Returns:
- true if this key's values are found within the input
-
equalTo
public boolean equalTo(int[] otherValues) Checks if this key's values are equal to the given array.- Parameters:
otherValues- the values to compare- Returns:
- true if the values are equal
-
equalTo
Checks if this key's values are equal to the given KeyAction.- Parameters:
key- the KeyAction to compare- Returns:
- true if the values are equal
-
getCodePointAt
public int getCodePointAt(int index) Get the code point at the specified index.- Specified by:
getCodePointAtin interfaceKeyAction- Parameters:
index- the index of the code point- Returns:
- the code point at the given index
-
length
public int length()Get the number of code points in this key action. -
buffer
Get the key values as an IntBuffer.
-