Enum Class KeyCode
- All Implemented Interfaces:
Serializable,Comparable<KeyCode>,Constable
-
Nested Class Summary
Nested classes/interfaces declared in class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionConstant for theAkey.Constant for the Accept or Commit function key.Constant for theAddkey.Constant for theAgainkey.Constant for the All Candidates function key.Constant for the Alphanumeric function key.Constant for theAltkey.Constant for the AltGraph function key.Constant for theAmpersandkey.Constant for theAsteriskkey.Constant for the "@" key.Constant for theBkey.Constant for theBack Quotekey.Constant for the back slash key, "\"Constant for theBackspacekey.Constant for the Begin key.Constant for theLeft Bracekey.Constant for theRight Bracekey.Constant for theCkey.Constant for theCancelkey.Constant for theCaps Lockkey.Constant for theChannel Downkey.Constant for theChannel Upkey.Constant for the "^" key.Constant for theClearkey.Constant for the close bracket key, "]"Constant for the Code Input function key.Constant for the ":" key.Constant for theColored Key 0key.Constant for theColored Key 1key.Constant for theColored Key 2key.Constant for theColored Key 3key.Constant for the comma key, ","Constant for the AppleCommandkey.Constant for the input method on/off key.Constant for the Microsoft Windows Context Menu key.Constant for theCtrlkey.Constant for the Convert function key.Constant for theCopykey.Constant for theCutkey.Constant for theDkey.Constant for theDead Abovedotkey.Constant for theDead Aboveringkey.Constant for theDead Acutekey.Constant for theDead Brevekey.Constant for theDead Caronkey.Constant for theDead Cedillakey.Constant for theDead Circumflexkey.Constant for theDead Diaeresiskey.Constant for theDead Doubleacutekey.Constant for theDead Gravekey.Constant for theDead Iotakey.Constant for theDead Macronkey.Constant for theDead Ogonekkey.Constant for theDead Semivoiced Soundkey.Constant for theDead Tildekey.Constant for theDead Voiced Soundkey.Constant for theDecimalkey.Constant for theDeletekey.Constant for the0key.Constant for the1key.Constant for the2key.Constant for the3key.Constant for the4key.Constant for the5key.Constant for the6key.Constant for the7key.Constant for the8key.Constant for the9key.Constant for theDividekey.Constant for the "$" key.Constant for the non-numpad down arrow key.Constant for theEkey.Constant for theEjectkey.Constant for theEndkey.Constant for theEnterkey.Constant for the equals key, "="Constant for theEsckey.Constant for the Euro currency sign key.Constant for the "!" key.Constant for theFkey.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 Forwardkey.Constant for input method support on Asian Keyboards.Constant for theFindkey.Constant for the Full-Width Characters function key.Constant for theGkey.Constant for theGame Akey.Constant for theGame Bkey.Constant for theGame Ckey.Constant for theGame Dkey.Constant for theGreaterkey.Constant for theHkey.Constant for the Half-Width Characters function key.Constant for theHelpkey.Constant for the Hiragana function key.Constant for theHomekey.Constant for theIkey.Constant for theInfokey.Constant for the input method on/off key.Constant for theInsertkey.Constant for the inverted exclamation mark key.Constant for theJkey.Constant for the Japanese-Hiragana function key.Constant for the Japanese-Katakana function key.Constant for the Japanese-Roman function key.Constant for theKkey.Constant for theKanakey.Constant for the locking Kana function key.Constant for theKanjikey.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 theLkey.Constant for the non-numpad left arrow key.Constant for the "(" key.Constant for theLesskey.Constant for theMkey.Constant for theMetakey.Constant for the minus key, "-"Constant for theMode Changekey.Constant for theMultiplykey.Constant for theMutekey.Constant for theNkey.Constant for the Don't Convert function key.Constant for theNum Lockkey.Constant for the "#" key.Constant for theNumpad 0key.Constant for theNumpad 1key.Constant for theNumpad 2key.Constant for theNumpad 3key.Constant for theNumpad 4key.Constant for theNumpad 5key.Constant for theNumpad 6key.Constant for theNumpad 7key.Constant for theNumpad 8key.Constant for theNumpad 9key.Constant for theOkey.Constant for the open bracket key, "["Constant for thePkey.Constant for thePage Downkey.Constant for thePage Upkey.Constant for thePastekey.Constant for thePausekey.Constant for the period key, "."Constant for thePlaykey.Constant for the "+" key.Constant for thePoundkey.Constant for thePowerkey.Constant for the Previous Candidate function key.Constant for thePrint Screenkey.Constant for thePropertieskey.Constant for theQkey.Constant for theQuotekey.Constant for theDouble Quotekey.Constant for theRkey.Constant for theRecordkey.Constant for theRewindkey.Constant for the non-numpad right arrow key.Constant for the ")" key.Constant for the Roman Characters function key.Constant for theSkey.Constant for theScroll Lockkey.Constant for the semicolon key, ";"Constant for the Numpad Separator key.Constant for theShiftkey.Constant for theShortcutkey.Constant for the forward slash key, "/"Constant for theSoftkey 0key.Constant for theSoftkey 1key.Constant for theSoftkey 2key.Constant for theSoftkey 3key.Constant for theSoftkey 4key.Constant for theSoftkey 5key.Constant for theSoftkey 6key.Constant for theSoftkey 7key.Constant for theSoftkey 8key.Constant for theSoftkey 9key.Constant for theSpacekey.Constant for theStarkey.Constant for theStopkey.Constant for theSubtractkey.Constant for theTkey.Constant for theTabkey.Constant for theNext Trackkey.Constant for thePrevious Trackkey.Constant for theUkey.This value is used to indicate that the keyCode is unknown.Constant for the "_" key.Constant for theUndokey.Constant for the non-numpad up arrow key.Constant for theVkey.Constant for theVolume Downkey.Constant for theVolume Upkey.Constant for theWkey.Constant for the Microsoft Windows "Windows" key.Constant for theXkey.Constant for theYkey.Constant for theZkey. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetChar()Returns the character element of this key code, which is simply a mapping of the underlying platform code returned bygetCode().final intgetCode()Returns the underlying platform code used to represent thecharacterin the key code.static KeyCodegetKeyCode(String name) Parses textual representation of a key.final StringgetName()Gets name of this key code.final booleanLeft, right, up, down keys (including the keypad arrows)final booleanAll Digit keys (including the keypad digits)final booleanFunction keys like F1, F2, etc...final booleanAll keys on the keypadfinal booleanAll keys with lettersfinal booleanAll multimedia keys (channel up/down, volume control, etc...)final booleanKeys that could act as a modifierfinal booleanNavigation keys are arrow keys and Page Down, Page Up, Home, End (including keypad keys)final booleanSpace, tab and enterstatic KeyCodeReturns 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 theEnterkey. -
BACK_SPACE
Constant for theBackspacekey. -
TAB
Constant for theTabkey. -
CANCEL
Constant for theCancelkey. -
CLEAR
Constant for theClearkey. -
SHIFT
Constant for theShiftkey. -
CONTROL
Constant for theCtrlkey. -
ALT
Constant for theAltkey. -
PAUSE
Constant for thePausekey. -
CAPS
Constant for theCaps Lockkey. -
ESCAPE
Constant for theEsckey. -
SPACE
Constant for theSpacekey. -
PAGE_UP
Constant for thePage Upkey. -
PAGE_DOWN
Constant for thePage Downkey. -
END
Constant for theEndkey. -
HOME
Constant for theHomekey. -
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 the0key. -
DIGIT1
Constant for the1key. -
DIGIT2
Constant for the2key. -
DIGIT3
Constant for the3key. -
DIGIT4
Constant for the4key. -
DIGIT5
Constant for the5key. -
DIGIT6
Constant for the6key. -
DIGIT7
Constant for the7key. -
DIGIT8
Constant for the8key. -
DIGIT9
Constant for the9key. -
SEMICOLON
Constant for the semicolon key, ";" -
EQUALS
Constant for the equals key, "=" -
A
Constant for theAkey. -
B
Constant for theBkey. -
C
Constant for theCkey. -
D
Constant for theDkey. -
E
Constant for theEkey. -
F
Constant for theFkey. -
G
Constant for theGkey. -
H
Constant for theHkey. -
I
Constant for theIkey. -
J
Constant for theJkey. -
K
Constant for theKkey. -
L
Constant for theLkey. -
M
Constant for theMkey. -
N
Constant for theNkey. -
O
Constant for theOkey. -
P
Constant for thePkey. -
Q
Constant for theQkey. -
R
Constant for theRkey. -
S
Constant for theSkey. -
T
Constant for theTkey. -
U
Constant for theUkey. -
V
Constant for theVkey. -
W
Constant for theWkey. -
X
Constant for theXkey. -
Y
Constant for theYkey. -
Z
Constant for theZkey. -
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 0key. -
NUMPAD1
Constant for theNumpad 1key. -
NUMPAD2
Constant for theNumpad 2key. -
NUMPAD3
Constant for theNumpad 3key. -
NUMPAD4
Constant for theNumpad 4key. -
NUMPAD5
Constant for theNumpad 5key. -
NUMPAD6
Constant for theNumpad 6key. -
NUMPAD7
Constant for theNumpad 7key. -
NUMPAD8
Constant for theNumpad 8key. -
NUMPAD9
Constant for theNumpad 9key. -
MULTIPLY
Constant for theMultiplykey. -
ADD
Constant for theAddkey. -
SEPARATOR
Constant for the Numpad Separator key. -
SUBTRACT
Constant for theSubtractkey. -
DECIMAL
Constant for theDecimalkey. -
DIVIDE
Constant for theDividekey. -
DELETE
Constant for theDeletekey. -
NUM_LOCK
Constant for theNum Lockkey. -
SCROLL_LOCK
Constant for theScroll Lockkey. -
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 Screenkey. -
INSERT
Constant for theInsertkey. -
HELP
Constant for theHelpkey. -
META
Constant for theMetakey. -
BACK_QUOTE
Constant for theBack Quotekey. -
QUOTE
Constant for theQuotekey. -
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 Gravekey. -
DEAD_ACUTE
Constant for theDead Acutekey. -
DEAD_CIRCUMFLEX
Constant for theDead Circumflexkey. -
DEAD_TILDE
Constant for theDead Tildekey. -
DEAD_MACRON
Constant for theDead Macronkey. -
DEAD_BREVE
Constant for theDead Brevekey. -
DEAD_ABOVEDOT
Constant for theDead Abovedotkey. -
DEAD_DIAERESIS
Constant for theDead Diaeresiskey. -
DEAD_ABOVERING
Constant for theDead Aboveringkey. -
DEAD_DOUBLEACUTE
Constant for theDead Doubleacutekey. -
DEAD_CARON
Constant for theDead Caronkey. -
DEAD_CEDILLA
Constant for theDead Cedillakey. -
DEAD_OGONEK
Constant for theDead Ogonekkey. -
DEAD_IOTA
Constant for theDead Iotakey. -
DEAD_VOICED_SOUND
Constant for theDead Voiced Soundkey. -
DEAD_SEMIVOICED_SOUND
Constant for theDead Semivoiced Soundkey. -
AMPERSAND
Constant for theAmpersandkey. -
ASTERISK
Constant for theAsteriskkey. -
QUOTEDBL
Constant for theDouble Quotekey. -
LESS
Constant for theLesskey. -
GREATER
Constant for theGreaterkey. -
BRACELEFT
Constant for theLeft Bracekey. -
BRACERIGHT
Constant for theRight Bracekey. -
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 Changekey. -
KANA
Constant for theKanakey. -
KANJI
Constant for theKanjikey. -
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 theCutkey. -
COPY
Constant for theCopykey. -
PASTE
Constant for thePastekey. -
UNDO
Constant for theUndokey. -
AGAIN
Constant for theAgainkey. -
FIND
Constant for theFindkey. -
PROPS
Constant for thePropertieskey. -
STOP
Constant for theStopkey. -
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 0key. -
SOFTKEY_1
Constant for theSoftkey 1key. -
SOFTKEY_2
Constant for theSoftkey 2key. -
SOFTKEY_3
Constant for theSoftkey 3key. -
SOFTKEY_4
Constant for theSoftkey 4key. -
SOFTKEY_5
Constant for theSoftkey 5key. -
SOFTKEY_6
Constant for theSoftkey 6key. -
SOFTKEY_7
Constant for theSoftkey 7key. -
SOFTKEY_8
Constant for theSoftkey 8key. -
SOFTKEY_9
Constant for theSoftkey 9key. -
GAME_A
Constant for theGame Akey. -
GAME_B
Constant for theGame Bkey. -
GAME_C
Constant for theGame Ckey. -
GAME_D
Constant for theGame Dkey. -
STAR
Constant for theStarkey. -
POUND
Constant for thePoundkey. -
POWER
Constant for thePowerkey. -
INFO
Constant for theInfokey. -
COLORED_KEY_0
Constant for theColored Key 0key. -
COLORED_KEY_1
Constant for theColored Key 1key. -
COLORED_KEY_2
Constant for theColored Key 2key. -
COLORED_KEY_3
Constant for theColored Key 3key. -
EJECT_TOGGLE
Constant for theEjectkey. -
PLAY
Constant for thePlaykey. -
RECORD
Constant for theRecordkey. -
FAST_FWD
Constant for theFast Forwardkey. -
REWIND
Constant for theRewindkey. -
TRACK_PREV
Constant for thePrevious Trackkey. -
TRACK_NEXT
Constant for theNext Trackkey. -
CHANNEL_UP
Constant for theChannel Upkey. -
CHANNEL_DOWN
Constant for theChannel Downkey. -
VOLUME_UP
Constant for theVolume Upkey. -
VOLUME_DOWN
Constant for theVolume Downkey. -
MUTE
Constant for theMutekey. -
COMMAND
-
SHORTCUT
Constant for theShortcutkey.
-
-
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
-