Enum Class KeyCode
- All Implemented Interfaces:
Serializable
,Comparable<KeyCode>
,Constable
Set of key codes for
KeyEvent
objects.- Since:
- JavaFX 2.0
-
Nested Class Summary
Nested classes/interfaces declared in class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionConstant for theA
key.Constant for the Accept or Commit function key.Constant for theAdd
key.Constant for theAgain
key.Constant for the All Candidates function key.Constant for the Alphanumeric function key.Constant for theAlt
key.Constant for the AltGraph function key.Constant for theAmpersand
key.Constant for theAsterisk
key.Constant for the "@" key.Constant for theB
key.Constant for theBack Quote
key.Constant for the back slash key, "\"Constant for theBackspace
key.Constant for the Begin key.Constant for theLeft Brace
key.Constant for theRight Brace
key.Constant for theC
key.Constant for theCancel
key.Constant for theCaps Lock
key.Constant for theChannel Down
key.Constant for theChannel Up
key.Constant for the "^" key.Constant for theClear
key.Constant for the close bracket key, "]"Constant for the Code Input function key.Constant for the ":" key.Constant for theColored Key 0
key.Constant for theColored Key 1
key.Constant for theColored Key 2
key.Constant for theColored Key 3
key.Constant for the comma key, ","Constant for the AppleCommand
key.Constant for the input method on/off key.Constant for the Microsoft Windows Context Menu key.Constant for theCtrl
key.Constant for the Convert function key.Constant for theCopy
key.Constant for theCut
key.Constant for theD
key.Constant for theDead Abovedot
key.Constant for theDead Abovering
key.Constant for theDead Acute
key.Constant for theDead Breve
key.Constant for theDead Caron
key.Constant for theDead Cedilla
key.Constant for theDead Circumflex
key.Constant for theDead Diaeresis
key.Constant for theDead Doubleacute
key.Constant for theDead Grave
key.Constant for theDead Iota
key.Constant for theDead Macron
key.Constant for theDead Ogonek
key.Constant for theDead Semivoiced Sound
key.Constant for theDead Tilde
key.Constant for theDead Voiced Sound
key.Constant for theDecimal
key.Constant for theDelete
key.Constant for the0
key.Constant for the1
key.Constant for the2
key.Constant for the3
key.Constant for the4
key.Constant for the5
key.Constant for the6
key.Constant for the7
key.Constant for the8
key.Constant for the9
key.Constant for theDivide
key.Constant for the "$" key.Constant for the non-numpad down arrow key.Constant for theE
key.Constant for theEject
key.Constant for theEnd
key.Constant for theEnter
key.Constant for the equals key, "="Constant for theEsc
key.Constant for the Euro currency sign key.Constant for the "!" key.Constant for theF
key.Constant for the F1 function key.Constant for the F10 function key.Constant for the F11 function key.Constant for the F12 function key.Constant for the F13 function key.Constant for the F14 function key.Constant for the F15 function key.Constant for the F16 function key.Constant for the F17 function key.Constant for the F18 function key.Constant for the F19 function key.Constant for the F2 function key.Constant for the F20 function key.Constant for the F21 function key.Constant for the F22 function key.Constant for the F23 function key.Constant for the F24 function key.Constant for the F3 function key.Constant for the F4 function key.Constant for the F5 function key.Constant for the F6 function key.Constant for the F7 function key.Constant for the F8 function key.Constant for the F9 function key.Constant for theFast Forward
key.Constant for input method support on Asian Keyboards.Constant for theFind
key.Constant for the Full-Width Characters function key.Constant for theG
key.Constant for theGame A
key.Constant for theGame B
key.Constant for theGame C
key.Constant for theGame D
key.Constant for theGreater
key.Constant for theH
key.Constant for the Half-Width Characters function key.Constant for theHelp
key.Constant for the Hiragana function key.Constant for theHome
key.Constant for theI
key.Constant for theInfo
key.Constant for the input method on/off key.Constant for theInsert
key.Constant for the inverted exclamation mark key.Constant for theJ
key.Constant for the Japanese-Hiragana function key.Constant for the Japanese-Katakana function key.Constant for the Japanese-Roman function key.Constant for theK
key.Constant for theKana
key.Constant for the locking Kana function key.Constant for theKanji
key.Constant for the Katakana function key.Constant for the numeric keypad down arrow key.Constant for the numeric keypad left arrow key.Constant for the numeric keypad right arrow key.Constant for the numeric keypad up arrow key.Constant for theL
key.Constant for the non-numpad left arrow key.Constant for the "(" key.Constant for theLess
key.Constant for theM
key.Constant for theMeta
key.Constant for the minus key, "-"Constant for theMode Change
key.Constant for theMultiply
key.Constant for theMute
key.Constant for theN
key.Constant for the Don't Convert function key.Constant for theNum Lock
key.Constant for the "#" key.Constant for theNumpad 0
key.Constant for theNumpad 1
key.Constant for theNumpad 2
key.Constant for theNumpad 3
key.Constant for theNumpad 4
key.Constant for theNumpad 5
key.Constant for theNumpad 6
key.Constant for theNumpad 7
key.Constant for theNumpad 8
key.Constant for theNumpad 9
key.Constant for theO
key.Constant for the open bracket key, "["Constant for theP
key.Constant for thePage Down
key.Constant for thePage Up
key.Constant for thePaste
key.Constant for thePause
key.Constant for the period key, "."Constant for thePlay
key.Constant for the "+" key.Constant for thePound
key.Constant for thePower
key.Constant for the Previous Candidate function key.Constant for thePrint Screen
key.Constant for theProperties
key.Constant for theQ
key.Constant for theQuote
key.Constant for theDouble Quote
key.Constant for theR
key.Constant for theRecord
key.Constant for theRewind
key.Constant for the non-numpad right arrow key.Constant for the ")" key.Constant for the Roman Characters function key.Constant for theS
key.Constant for theScroll Lock
key.Constant for the semicolon key, ";"Constant for the Numpad Separator key.Constant for theShift
key.Constant for theShortcut
key.Constant for the forward slash key, "/"Constant for theSoftkey 0
key.Constant for theSoftkey 1
key.Constant for theSoftkey 2
key.Constant for theSoftkey 3
key.Constant for theSoftkey 4
key.Constant for theSoftkey 5
key.Constant for theSoftkey 6
key.Constant for theSoftkey 7
key.Constant for theSoftkey 8
key.Constant for theSoftkey 9
key.Constant for theSpace
key.Constant for theStar
key.Constant for theStop
key.Constant for theSubtract
key.Constant for theT
key.Constant for theTab
key.Constant for theNext Track
key.Constant for thePrevious Track
key.Constant for theU
key.This value is used to indicate that the keyCode is unknown.Constant for the "_" key.Constant for theUndo
key.Constant for the non-numpad up arrow key.Constant for theV
key.Constant for theVolume Down
key.Constant for theVolume Up
key.Constant for theW
key.Constant for the Microsoft Windows "Windows" key.Constant for theX
key.Constant for theY
key.Constant for theZ
key. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
getChar()
Returns the character element of this key code, which is simply a mapping of the underlying platform code returned bygetCode()
.final int
getCode()
Returns the underlying platform code used to represent thecharacter
in the key code.static KeyCode
getKeyCode
(String name) Parses textual representation of a key.final String
getName()
Gets name of this key code.final boolean
Left, right, up, down keys (including the keypad arrows)final boolean
All Digit keys (including the keypad digits)final boolean
Function keys like F1, F2, etc...final boolean
All keys on the keypadfinal boolean
All keys with lettersfinal boolean
All multimedia keys (channel up/down, volume control, etc...)final boolean
Keys that could act as a modifierfinal boolean
Navigation keys are arrow keys and Page Down, Page Up, Home, End (including keypad keys)final boolean
Space, tab and enterstatic KeyCode
Returns the enum constant of this class with the specified name.static KeyCode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ENTER
Constant for theEnter
key. -
BACK_SPACE
Constant for theBackspace
key. -
TAB
Constant for theTab
key. -
CANCEL
Constant for theCancel
key. -
CLEAR
Constant for theClear
key. -
SHIFT
Constant for theShift
key. -
CONTROL
Constant for theCtrl
key. -
ALT
Constant for theAlt
key. -
PAUSE
Constant for thePause
key. -
CAPS
Constant for theCaps Lock
key. -
ESCAPE
Constant for theEsc
key. -
SPACE
Constant for theSpace
key. -
PAGE_UP
Constant for thePage Up
key. -
PAGE_DOWN
Constant for thePage Down
key. -
END
Constant for theEnd
key. -
HOME
Constant for theHome
key. -
LEFT
Constant for the non-numpad left arrow key. -
UP
Constant for the non-numpad up arrow key. -
RIGHT
Constant for the non-numpad right arrow key. -
DOWN
Constant for the non-numpad down arrow key. -
COMMA
Constant for the comma key, "," -
MINUS
Constant for the minus key, "-" -
PERIOD
Constant for the period key, "." -
SLASH
Constant for the forward slash key, "/" -
DIGIT0
Constant for the0
key. -
DIGIT1
Constant for the1
key. -
DIGIT2
Constant for the2
key. -
DIGIT3
Constant for the3
key. -
DIGIT4
Constant for the4
key. -
DIGIT5
Constant for the5
key. -
DIGIT6
Constant for the6
key. -
DIGIT7
Constant for the7
key. -
DIGIT8
Constant for the8
key. -
DIGIT9
Constant for the9
key. -
SEMICOLON
Constant for the semicolon key, ";" -
EQUALS
Constant for the equals key, "=" -
A
Constant for theA
key. -
B
Constant for theB
key. -
C
Constant for theC
key. -
D
Constant for theD
key. -
E
Constant for theE
key. -
F
Constant for theF
key. -
G
Constant for theG
key. -
H
Constant for theH
key. -
I
Constant for theI
key. -
J
Constant for theJ
key. -
K
Constant for theK
key. -
L
Constant for theL
key. -
M
Constant for theM
key. -
N
Constant for theN
key. -
O
Constant for theO
key. -
P
Constant for theP
key. -
Q
Constant for theQ
key. -
R
Constant for theR
key. -
S
Constant for theS
key. -
T
Constant for theT
key. -
U
Constant for theU
key. -
V
Constant for theV
key. -
W
Constant for theW
key. -
X
Constant for theX
key. -
Y
Constant for theY
key. -
Z
Constant for theZ
key. -
OPEN_BRACKET
Constant for the open bracket key, "[" -
BACK_SLASH
Constant for the back slash key, "\" -
CLOSE_BRACKET
Constant for the close bracket key, "]" -
NUMPAD0
Constant for theNumpad 0
key. -
NUMPAD1
Constant for theNumpad 1
key. -
NUMPAD2
Constant for theNumpad 2
key. -
NUMPAD3
Constant for theNumpad 3
key. -
NUMPAD4
Constant for theNumpad 4
key. -
NUMPAD5
Constant for theNumpad 5
key. -
NUMPAD6
Constant for theNumpad 6
key. -
NUMPAD7
Constant for theNumpad 7
key. -
NUMPAD8
Constant for theNumpad 8
key. -
NUMPAD9
Constant for theNumpad 9
key. -
MULTIPLY
Constant for theMultiply
key. -
ADD
Constant for theAdd
key. -
SEPARATOR
Constant for the Numpad Separator key. -
SUBTRACT
Constant for theSubtract
key. -
DECIMAL
Constant for theDecimal
key. -
DIVIDE
Constant for theDivide
key. -
DELETE
Constant for theDelete
key. -
NUM_LOCK
Constant for theNum Lock
key. -
SCROLL_LOCK
Constant for theScroll Lock
key. -
F1
Constant for the F1 function key. -
F2
Constant for the F2 function key. -
F3
Constant for the F3 function key. -
F4
Constant for the F4 function key. -
F5
Constant for the F5 function key. -
F6
Constant for the F6 function key. -
F7
Constant for the F7 function key. -
F8
Constant for the F8 function key. -
F9
Constant for the F9 function key. -
F10
Constant for the F10 function key. -
F11
Constant for the F11 function key. -
F12
Constant for the F12 function key. -
F13
Constant for the F13 function key. -
F14
Constant for the F14 function key. -
F15
Constant for the F15 function key. -
F16
Constant for the F16 function key. -
F17
Constant for the F17 function key. -
F18
Constant for the F18 function key. -
F19
Constant for the F19 function key. -
F20
Constant for the F20 function key. -
F21
Constant for the F21 function key. -
F22
Constant for the F22 function key. -
F23
Constant for the F23 function key. -
F24
Constant for the F24 function key. -
PRINTSCREEN
Constant for thePrint Screen
key. -
INSERT
Constant for theInsert
key. -
HELP
Constant for theHelp
key. -
META
Constant for theMeta
key. -
BACK_QUOTE
Constant for theBack Quote
key. -
QUOTE
Constant for theQuote
key. -
KP_UP
Constant for the numeric keypad up arrow key. -
KP_DOWN
Constant for the numeric keypad down arrow key. -
KP_LEFT
Constant for the numeric keypad left arrow key. -
KP_RIGHT
Constant for the numeric keypad right arrow key. -
DEAD_GRAVE
Constant for theDead Grave
key. -
DEAD_ACUTE
Constant for theDead Acute
key. -
DEAD_CIRCUMFLEX
Constant for theDead Circumflex
key. -
DEAD_TILDE
Constant for theDead Tilde
key. -
DEAD_MACRON
Constant for theDead Macron
key. -
DEAD_BREVE
Constant for theDead Breve
key. -
DEAD_ABOVEDOT
Constant for theDead Abovedot
key. -
DEAD_DIAERESIS
Constant for theDead Diaeresis
key. -
DEAD_ABOVERING
Constant for theDead Abovering
key. -
DEAD_DOUBLEACUTE
Constant for theDead Doubleacute
key. -
DEAD_CARON
Constant for theDead Caron
key. -
DEAD_CEDILLA
Constant for theDead Cedilla
key. -
DEAD_OGONEK
Constant for theDead Ogonek
key. -
DEAD_IOTA
Constant for theDead Iota
key. -
DEAD_VOICED_SOUND
Constant for theDead Voiced Sound
key. -
DEAD_SEMIVOICED_SOUND
Constant for theDead Semivoiced Sound
key. -
AMPERSAND
Constant for theAmpersand
key. -
ASTERISK
Constant for theAsterisk
key. -
QUOTEDBL
Constant for theDouble Quote
key. -
LESS
Constant for theLess
key. -
GREATER
Constant for theGreater
key. -
BRACELEFT
Constant for theLeft Brace
key. -
BRACERIGHT
Constant for theRight Brace
key. -
AT
Constant for the "@" key. -
COLON
Constant for the ":" key. -
CIRCUMFLEX
Constant for the "^" key. -
DOLLAR
Constant for the "$" key. -
EURO_SIGN
Constant for the Euro currency sign key. -
EXCLAMATION_MARK
Constant for the "!" key. -
INVERTED_EXCLAMATION_MARK
Constant for the inverted exclamation mark key. -
LEFT_PARENTHESIS
Constant for the "(" key. -
NUMBER_SIGN
Constant for the "#" key. -
PLUS
Constant for the "+" key. -
RIGHT_PARENTHESIS
Constant for the ")" key. -
UNDERSCORE
Constant for the "_" key. -
WINDOWS
Constant for the Microsoft Windows "Windows" key. It is used for both the left and right version of the key. -
CONTEXT_MENU
Constant for the Microsoft Windows Context Menu key. -
FINAL
Constant for input method support on Asian Keyboards. -
CONVERT
Constant for the Convert function key. -
NONCONVERT
Constant for the Don't Convert function key. -
ACCEPT
Constant for the Accept or Commit function key. -
MODECHANGE
Constant for theMode Change
key. -
KANA
Constant for theKana
key. -
KANJI
Constant for theKanji
key. -
ALPHANUMERIC
Constant for the Alphanumeric function key. -
KATAKANA
Constant for the Katakana function key. -
HIRAGANA
Constant for the Hiragana function key. -
FULL_WIDTH
Constant for the Full-Width Characters function key. -
HALF_WIDTH
Constant for the Half-Width Characters function key. -
ROMAN_CHARACTERS
Constant for the Roman Characters function key. -
ALL_CANDIDATES
Constant for the All Candidates function key. -
PREVIOUS_CANDIDATE
Constant for the Previous Candidate function key. -
CODE_INPUT
Constant for the Code Input function key. -
JAPANESE_KATAKANA
Constant for the Japanese-Katakana function key. This key switches to a Japanese input method and selects its Katakana input mode. -
JAPANESE_HIRAGANA
Constant for the Japanese-Hiragana function key. This key switches to a Japanese input method and selects its Hiragana input mode. -
JAPANESE_ROMAN
Constant for the Japanese-Roman function key. This key switches to a Japanese input method and selects its Roman-Direct input mode. -
KANA_LOCK
Constant for the locking Kana function key. This key locks the keyboard into a Kana layout. -
INPUT_METHOD_ON_OFF
Constant for the input method on/off key. -
CUT
Constant for theCut
key. -
COPY
Constant for theCopy
key. -
PASTE
Constant for thePaste
key. -
UNDO
Constant for theUndo
key. -
AGAIN
Constant for theAgain
key. -
FIND
Constant for theFind
key. -
PROPS
Constant for theProperties
key. -
STOP
Constant for theStop
key. -
COMPOSE
Constant for the input method on/off key. -
ALT_GRAPH
Constant for the AltGraph function key. -
BEGIN
Constant for the Begin key. -
UNDEFINED
This value is used to indicate that the keyCode is unknown. Key typed events do not have a keyCode value; this value is used instead. -
SOFTKEY_0
Constant for theSoftkey 0
key. -
SOFTKEY_1
Constant for theSoftkey 1
key. -
SOFTKEY_2
Constant for theSoftkey 2
key. -
SOFTKEY_3
Constant for theSoftkey 3
key. -
SOFTKEY_4
Constant for theSoftkey 4
key. -
SOFTKEY_5
Constant for theSoftkey 5
key. -
SOFTKEY_6
Constant for theSoftkey 6
key. -
SOFTKEY_7
Constant for theSoftkey 7
key. -
SOFTKEY_8
Constant for theSoftkey 8
key. -
SOFTKEY_9
Constant for theSoftkey 9
key. -
GAME_A
Constant for theGame A
key. -
GAME_B
Constant for theGame B
key. -
GAME_C
Constant for theGame C
key. -
GAME_D
Constant for theGame D
key. -
STAR
Constant for theStar
key. -
POUND
Constant for thePound
key. -
POWER
Constant for thePower
key. -
INFO
Constant for theInfo
key. -
COLORED_KEY_0
Constant for theColored Key 0
key. -
COLORED_KEY_1
Constant for theColored Key 1
key. -
COLORED_KEY_2
Constant for theColored Key 2
key. -
COLORED_KEY_3
Constant for theColored Key 3
key. -
EJECT_TOGGLE
Constant for theEject
key. -
PLAY
Constant for thePlay
key. -
RECORD
Constant for theRecord
key. -
FAST_FWD
Constant for theFast Forward
key. -
REWIND
Constant for theRewind
key. -
TRACK_PREV
Constant for thePrevious Track
key. -
TRACK_NEXT
Constant for theNext Track
key. -
CHANNEL_UP
Constant for theChannel Up
key. -
CHANNEL_DOWN
Constant for theChannel Down
key. -
VOLUME_UP
Constant for theVolume Up
key. -
VOLUME_DOWN
Constant for theVolume Down
key. -
MUTE
Constant for theMute
key. -
COMMAND
-
SHORTCUT
Constant for theShortcut
key.
-
-
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
-
isFunctionKey
public final boolean isFunctionKey()Function keys like F1, F2, etc...- Returns:
- true if this key code corresponds to a functional key
- Since:
- JavaFX 2.2
-
isArrowKey
public final boolean isArrowKey()Left, right, up, down keys (including the keypad arrows)- Returns:
- true if this key code corresponds to an arrow key
- Since:
- JavaFX 2.2
-
isModifierKey
public final boolean isModifierKey()Keys that could act as a modifier- Returns:
- true if this key code corresponds to a modifier key
- Since:
- JavaFX 2.2
-
isLetterKey
public final boolean isLetterKey()All keys with letters- Returns:
- true if this key code corresponds to a letter key
- Since:
- JavaFX 2.2
-
isDigitKey
public final boolean isDigitKey()All Digit keys (including the keypad digits)- Returns:
- true if this key code corresponds to a digit key
- Since:
- JavaFX 2.2
-
isKeypadKey
public final boolean isKeypadKey()All keys on the keypad- Returns:
- true if this key code corresponds to a keypad key
- Since:
- JavaFX 2.2
-
isWhitespaceKey
public final boolean isWhitespaceKey()Space, tab and enter- Returns:
- true if this key code corresponds to a whitespace key
- Since:
- JavaFX 2.2
-
isMediaKey
public final boolean isMediaKey()All multimedia keys (channel up/down, volume control, etc...)- Returns:
- true if this key code corresponds to a media key
- Since:
- JavaFX 2.2
-
getName
-
getChar
-
getCode
-
getKeyCode
-