Enum Class KeyCode
- All Implemented Interfaces:
- Serializable,- Comparable<KeyCode>,- Constable
Set of key codes for 
KeyEvent objects.- Since:
- JavaFX 2.0
- 
Nested Class SummaryNested classes/interfaces declared in class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum 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 SummaryModifier 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- 
ENTERConstant for theEnterkey.
- 
BACK_SPACEConstant for theBackspacekey.
- 
TABConstant for theTabkey.
- 
CANCELConstant for theCancelkey.
- 
CLEARConstant for theClearkey.
- 
SHIFTConstant for theShiftkey.
- 
CONTROLConstant for theCtrlkey.
- 
ALTConstant for theAltkey.
- 
PAUSEConstant for thePausekey.
- 
CAPSConstant for theCaps Lockkey.
- 
ESCAPEConstant for theEsckey.
- 
SPACEConstant for theSpacekey.
- 
PAGE_UPConstant for thePage Upkey.
- 
PAGE_DOWNConstant for thePage Downkey.
- 
ENDConstant for theEndkey.
- 
HOMEConstant for theHomekey.
- 
LEFTConstant for the non-numpad left arrow key.
- 
UPConstant for the non-numpad up arrow key.
- 
RIGHTConstant for the non-numpad right arrow key.
- 
DOWNConstant for the non-numpad down arrow key.
- 
COMMAConstant for the comma key, ","
- 
MINUSConstant for the minus key, "-"
- 
PERIODConstant for the period key, "."
- 
SLASHConstant for the forward slash key, "/"
- 
DIGIT0Constant for the0key.
- 
DIGIT1Constant for the1key.
- 
DIGIT2Constant for the2key.
- 
DIGIT3Constant for the3key.
- 
DIGIT4Constant for the4key.
- 
DIGIT5Constant for the5key.
- 
DIGIT6Constant for the6key.
- 
DIGIT7Constant for the7key.
- 
DIGIT8Constant for the8key.
- 
DIGIT9Constant for the9key.
- 
SEMICOLONConstant for the semicolon key, ";"
- 
EQUALSConstant for the equals key, "="
- 
AConstant for theAkey.
- 
BConstant for theBkey.
- 
CConstant for theCkey.
- 
DConstant for theDkey.
- 
EConstant for theEkey.
- 
FConstant for theFkey.
- 
GConstant for theGkey.
- 
HConstant for theHkey.
- 
IConstant for theIkey.
- 
JConstant for theJkey.
- 
KConstant for theKkey.
- 
LConstant for theLkey.
- 
MConstant for theMkey.
- 
NConstant for theNkey.
- 
OConstant for theOkey.
- 
PConstant for thePkey.
- 
QConstant for theQkey.
- 
RConstant for theRkey.
- 
SConstant for theSkey.
- 
TConstant for theTkey.
- 
UConstant for theUkey.
- 
VConstant for theVkey.
- 
WConstant for theWkey.
- 
XConstant for theXkey.
- 
YConstant for theYkey.
- 
ZConstant for theZkey.
- 
OPEN_BRACKETConstant for the open bracket key, "["
- 
BACK_SLASHConstant for the back slash key, "\"
- 
CLOSE_BRACKETConstant for the close bracket key, "]"
- 
NUMPAD0Constant for theNumpad 0key.
- 
NUMPAD1Constant for theNumpad 1key.
- 
NUMPAD2Constant for theNumpad 2key.
- 
NUMPAD3Constant for theNumpad 3key.
- 
NUMPAD4Constant for theNumpad 4key.
- 
NUMPAD5Constant for theNumpad 5key.
- 
NUMPAD6Constant for theNumpad 6key.
- 
NUMPAD7Constant for theNumpad 7key.
- 
NUMPAD8Constant for theNumpad 8key.
- 
NUMPAD9Constant for theNumpad 9key.
- 
MULTIPLYConstant for theMultiplykey.
- 
ADDConstant for theAddkey.
- 
SEPARATORConstant for the Numpad Separator key.
- 
SUBTRACTConstant for theSubtractkey.
- 
DECIMALConstant for theDecimalkey.
- 
DIVIDEConstant for theDividekey.
- 
DELETEConstant for theDeletekey.
- 
NUM_LOCKConstant for theNum Lockkey.
- 
SCROLL_LOCKConstant for theScroll Lockkey.
- 
F1Constant for the F1 function key.
- 
F2Constant for the F2 function key.
- 
F3Constant for the F3 function key.
- 
F4Constant for the F4 function key.
- 
F5Constant for the F5 function key.
- 
F6Constant for the F6 function key.
- 
F7Constant for the F7 function key.
- 
F8Constant for the F8 function key.
- 
F9Constant for the F9 function key.
- 
F10Constant for the F10 function key.
- 
F11Constant for the F11 function key.
- 
F12Constant for the F12 function key.
- 
F13Constant for the F13 function key.
- 
F14Constant for the F14 function key.
- 
F15Constant for the F15 function key.
- 
F16Constant for the F16 function key.
- 
F17Constant for the F17 function key.
- 
F18Constant for the F18 function key.
- 
F19Constant for the F19 function key.
- 
F20Constant for the F20 function key.
- 
F21Constant for the F21 function key.
- 
F22Constant for the F22 function key.
- 
F23Constant for the F23 function key.
- 
F24Constant for the F24 function key.
- 
PRINTSCREENConstant for thePrint Screenkey.
- 
INSERTConstant for theInsertkey.
- 
HELPConstant for theHelpkey.
- 
METAConstant for theMetakey.
- 
BACK_QUOTEConstant for theBack Quotekey.
- 
QUOTEConstant for theQuotekey.
- 
KP_UPConstant for the numeric keypad up arrow key.
- 
KP_DOWNConstant for the numeric keypad down arrow key.
- 
KP_LEFTConstant for the numeric keypad left arrow key.
- 
KP_RIGHTConstant for the numeric keypad right arrow key.
- 
DEAD_GRAVEConstant for theDead Gravekey.
- 
DEAD_ACUTEConstant for theDead Acutekey.
- 
DEAD_CIRCUMFLEXConstant for theDead Circumflexkey.
- 
DEAD_TILDEConstant for theDead Tildekey.
- 
DEAD_MACRONConstant for theDead Macronkey.
- 
DEAD_BREVEConstant for theDead Brevekey.
- 
DEAD_ABOVEDOTConstant for theDead Abovedotkey.
- 
DEAD_DIAERESISConstant for theDead Diaeresiskey.
- 
DEAD_ABOVERINGConstant for theDead Aboveringkey.
- 
DEAD_DOUBLEACUTEConstant for theDead Doubleacutekey.
- 
DEAD_CARONConstant for theDead Caronkey.
- 
DEAD_CEDILLAConstant for theDead Cedillakey.
- 
DEAD_OGONEKConstant for theDead Ogonekkey.
- 
DEAD_IOTAConstant for theDead Iotakey.
- 
DEAD_VOICED_SOUNDConstant for theDead Voiced Soundkey.
- 
DEAD_SEMIVOICED_SOUNDConstant for theDead Semivoiced Soundkey.
- 
AMPERSANDConstant for theAmpersandkey.
- 
ASTERISKConstant for theAsteriskkey.
- 
QUOTEDBLConstant for theDouble Quotekey.
- 
LESSConstant for theLesskey.
- 
GREATERConstant for theGreaterkey.
- 
BRACELEFTConstant for theLeft Bracekey.
- 
BRACERIGHTConstant for theRight Bracekey.
- 
ATConstant for the "@" key.
- 
COLONConstant for the ":" key.
- 
CIRCUMFLEXConstant for the "^" key.
- 
DOLLARConstant for the "$" key.
- 
EURO_SIGNConstant for the Euro currency sign key.
- 
EXCLAMATION_MARKConstant for the "!" key.
- 
INVERTED_EXCLAMATION_MARKConstant for the inverted exclamation mark key.
- 
LEFT_PARENTHESISConstant for the "(" key.
- 
NUMBER_SIGNConstant for the "#" key.
- 
PLUSConstant for the "+" key.
- 
RIGHT_PARENTHESISConstant for the ")" key.
- 
UNDERSCOREConstant for the "_" key.
- 
WINDOWSConstant for the Microsoft Windows "Windows" key. It is used for both the left and right version of the key.
- 
CONTEXT_MENUConstant for the Microsoft Windows Context Menu key.
- 
FINALConstant for input method support on Asian Keyboards.
- 
CONVERTConstant for the Convert function key.
- 
NONCONVERTConstant for the Don't Convert function key.
- 
ACCEPTConstant for the Accept or Commit function key.
- 
MODECHANGEConstant for theMode Changekey.
- 
KANAConstant for theKanakey.
- 
KANJIConstant for theKanjikey.
- 
ALPHANUMERICConstant for the Alphanumeric function key.
- 
KATAKANAConstant for the Katakana function key.
- 
HIRAGANAConstant for the Hiragana function key.
- 
FULL_WIDTHConstant for the Full-Width Characters function key.
- 
HALF_WIDTHConstant for the Half-Width Characters function key.
- 
ROMAN_CHARACTERSConstant for the Roman Characters function key.
- 
ALL_CANDIDATESConstant for the All Candidates function key.
- 
PREVIOUS_CANDIDATEConstant for the Previous Candidate function key.
- 
CODE_INPUTConstant for the Code Input function key.
- 
JAPANESE_KATAKANAConstant for the Japanese-Katakana function key. This key switches to a Japanese input method and selects its Katakana input mode.
- 
JAPANESE_HIRAGANAConstant for the Japanese-Hiragana function key. This key switches to a Japanese input method and selects its Hiragana input mode.
- 
JAPANESE_ROMANConstant for the Japanese-Roman function key. This key switches to a Japanese input method and selects its Roman-Direct input mode.
- 
KANA_LOCKConstant for the locking Kana function key. This key locks the keyboard into a Kana layout.
- 
INPUT_METHOD_ON_OFFConstant for the input method on/off key.
- 
CUTConstant for theCutkey.
- 
COPYConstant for theCopykey.
- 
PASTEConstant for thePastekey.
- 
UNDOConstant for theUndokey.
- 
AGAINConstant for theAgainkey.
- 
FINDConstant for theFindkey.
- 
PROPSConstant for thePropertieskey.
- 
STOPConstant for theStopkey.
- 
COMPOSEConstant for the input method on/off key.
- 
ALT_GRAPHConstant for the AltGraph function key.
- 
BEGINConstant for the Begin key.
- 
UNDEFINEDThis 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_0Constant for theSoftkey 0key.
- 
SOFTKEY_1Constant for theSoftkey 1key.
- 
SOFTKEY_2Constant for theSoftkey 2key.
- 
SOFTKEY_3Constant for theSoftkey 3key.
- 
SOFTKEY_4Constant for theSoftkey 4key.
- 
SOFTKEY_5Constant for theSoftkey 5key.
- 
SOFTKEY_6Constant for theSoftkey 6key.
- 
SOFTKEY_7Constant for theSoftkey 7key.
- 
SOFTKEY_8Constant for theSoftkey 8key.
- 
SOFTKEY_9Constant for theSoftkey 9key.
- 
GAME_AConstant for theGame Akey.
- 
GAME_BConstant for theGame Bkey.
- 
GAME_CConstant for theGame Ckey.
- 
GAME_DConstant for theGame Dkey.
- 
STARConstant for theStarkey.
- 
POUNDConstant for thePoundkey.
- 
POWERConstant for thePowerkey.
- 
INFOConstant for theInfokey.
- 
COLORED_KEY_0Constant for theColored Key 0key.
- 
COLORED_KEY_1Constant for theColored Key 1key.
- 
COLORED_KEY_2Constant for theColored Key 2key.
- 
COLORED_KEY_3Constant for theColored Key 3key.
- 
EJECT_TOGGLEConstant for theEjectkey.
- 
PLAYConstant for thePlaykey.
- 
RECORDConstant for theRecordkey.
- 
FAST_FWDConstant for theFast Forwardkey.
- 
REWINDConstant for theRewindkey.
- 
TRACK_PREVConstant for thePrevious Trackkey.
- 
TRACK_NEXTConstant for theNext Trackkey.
- 
CHANNEL_UPConstant for theChannel Upkey.
- 
CHANNEL_DOWNConstant for theChannel Downkey.
- 
VOLUME_UPConstant for theVolume Upkey.
- 
VOLUME_DOWNConstant for theVolume Downkey.
- 
MUTEConstant for theMutekey.
- 
COMMAND
- 
SHORTCUTConstant for theShortcutkey.
 
- 
- 
Method Details- 
valuesReturns 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
 
- 
valueOfReturns 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 name
- NullPointerException- if the argument is null
 
- 
isFunctionKeypublic final boolean isFunctionKey()Function keys like F1, F2, etc...- Returns:
- true if this key code corresponds to a functional key
- Since:
- JavaFX 2.2
 
- 
isArrowKeypublic 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
 
- 
isModifierKeypublic 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
 
- 
isLetterKeypublic final boolean isLetterKey()All keys with letters- Returns:
- true if this key code corresponds to a letter key
- Since:
- JavaFX 2.2
 
- 
isDigitKeypublic 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
 
- 
isKeypadKeypublic final boolean isKeypadKey()All keys on the keypad- Returns:
- true if this key code corresponds to a keypad key
- Since:
- JavaFX 2.2
 
- 
isWhitespaceKeypublic final boolean isWhitespaceKey()Space, tab and enter- Returns:
- true if this key code corresponds to a whitespace key
- Since:
- JavaFX 2.2
 
- 
isMediaKeypublic 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
 
-