Package swingtree.input
Enum Class Keyboard.Key
- All Implemented Interfaces:
Serializable
,Comparable<Keyboard.Key>
,Constable
- Enclosing class:
- Keyboard
This enum represents all the keys on the keyboard which can be queried for their current state.
This is a mapping of the
KeyEvent
constants to a more readable and type safe enum.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
This method checks if this key is currently pressed on the keyboard by checking if it is in a list of currently pressed keys.static Keyboard.Key
Returns the enum constant of this class with the specified name.static Keyboard.Key[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
-
ENTER
-
BACK_SPACE
-
TAB
-
CANCEL
-
CLEAR
-
SHIFT
-
CONTROL
-
ALT
-
PAUSE
-
CAPS_LOCK
-
ESCAPE
-
SPACE
-
PAGE_UP
-
PAGE_DOWN
-
END
-
HOME
-
LEFT
-
UP
-
RIGHT
-
DOWN
-
COMMA
-
MINUS
-
PERIOD
-
SLASH
-
ZERO
-
ONE
-
TWO
-
THREE
-
FOUR
-
FIVE
-
SIX
-
SEVEN
-
EIGHT
-
NINE
-
SEMICOLON
-
EQUALS
-
A
-
B
-
C
-
D
-
E
-
F
-
G
-
H
-
I
-
J
-
K
-
L
-
M
-
N
-
O
-
P
-
Q
-
R
-
S
-
T
-
U
-
V
-
W
-
X
-
Y
-
Z
-
OPEN_BRACKET
-
BACK_SLASH
-
CLOSE_BRACKET
-
NUMPAD_0
-
NUMPAD_1
-
NUMPAD_2
-
NUMPAD_3
-
NUMPAD_4
-
NUMPAD_5
-
NUMPAD_6
-
NUMPAD_7
-
NUMPAD_8
-
NUMPAD_9
-
MULTIPLY
-
ADD
-
SEPARATOR
-
SUBTRACT
-
DECIMAL
-
DIVIDE
-
DELETE
-
NUM_LOCK
-
SCROLL_LOCK
-
F1
-
F2
-
F3
-
F4
-
F5
-
F6
-
F7
-
F8
-
F9
-
F10
-
F11
-
F12
-
F13
-
F14
-
F15
-
F16
-
F17
-
F18
-
F19
-
F20
-
F21
-
F22
-
F23
-
F24
-
PRINTSCREEN
-
INSERT
-
HELP
-
META
-
BACK_QUOTE
-
QUOTE
-
-
Field Details
-
code
public final int code
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
isPressed
public boolean isPressed()This method checks if this key is currently pressed on the keyboard by checking if it is in a list of currently pressed keys.- Returns:
- The truth value determining if this key is currently pressed on the keyboard.
-