APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javafx.scene.input

public final Enum KeyCode

extends Enum<KeyCode>
Class Inheritance
Imports
java.util.HashMap, .Map

Set of key codes for KeyEvent objects.

For a given keyboard layout each key is assigned a code which does not vary and is not affected by the state of the modifier keys. For keys that generate printable characters the code will usually be based on the character generated when no modifier key is held down. The exceptions are KeyCode#A through KeyCode#Z which are assigned to keys even on layouts which don't generate those letters (such as Greek). This ensures that common letter-based shortcuts are accessible on all layouts.

Keys that generate characters with accents or other diacritic marks are usually assigned a code of KeyCode#UNDEFINED.

Since
JavaFX 2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final KeyCode
A

Constant for the A key.

public static final KeyCode
ACCEPT

Constant for the Accept or Commit function key.

public static final KeyCode
ADD

Constant for the Add key.

public static final KeyCode
AGAIN

Constant for the Again key.

public static final KeyCode
ALL_CANDIDATES

Constant for the All Candidates function key.

public static final KeyCode
ALPHANUMERIC

Constant for the Alphanumeric function key.

public static final KeyCode
ALT

Constant for the Alt key.

public static final KeyCode
ALT_GRAPH

Constant for the AltGraph function key.

public static final KeyCode
AMPERSAND

Constant for the Ampersand key.

public static final KeyCode
ASTERISK

Constant for the Asterisk key.

public static final KeyCode
AT

Constant for the "@" key.

public static final KeyCode
B

Constant for the B key.

public static final KeyCode
BACK_QUOTE

Constant for the Back Quote key.

public static final KeyCode
BACK_SLASH

Constant for the back slash key, "\"

public static final KeyCode
BACK_SPACE

Constant for the Backspace key.

public static final KeyCode
BEGIN

Constant for the Begin key.

public static final KeyCode
BRACELEFT

Constant for the Left Brace key.

public static final KeyCode
BRACERIGHT

Constant for the Right Brace key.

public static final KeyCode
C

Constant for the C key.

public static final KeyCode
CANCEL

Constant for the Cancel key.

public static final KeyCode
CAPS

Constant for the Caps Lock key.

pack-priv final String
public static final KeyCode
CHANNEL_DOWN

Constant for the Channel Down key.

public static final KeyCode
CHANNEL_UP

Constant for the Channel Up key.

public static final KeyCode
CIRCUMFLEX

Constant for the "^" key.

public static final KeyCode
CLEAR

Constant for the Clear key.

public static final KeyCode
CLOSE_BRACKET

Constant for the close bracket key, "]"

pack-priv final int
public static final KeyCode
CODE_INPUT

Constant for the Code Input function key.

public static final KeyCode
COLON

Constant for the ":" key.

public static final KeyCode
COLORED_KEY_0

Constant for the Colored Key 0 key.

public static final KeyCode
COLORED_KEY_1

Constant for the Colored Key 1 key.

public static final KeyCode
COLORED_KEY_2

Constant for the Colored Key 2 key.

public static final KeyCode
COLORED_KEY_3

Constant for the Colored Key 3 key.

public static final KeyCode
COMMA

Constant for the comma key, ","

public static final KeyCode
COMMAND

Constant for the Apple Command key.

public static final KeyCode
COMPOSE

Constant for the input method on/off key.

public static final KeyCode
CONTEXT_MENU

Constant for the Microsoft Windows Context Menu key.

public static final KeyCode
CONTROL

Constant for the Ctrl key.

public static final KeyCode
CONVERT

Constant for the Convert function key.

public static final KeyCode
COPY

Constant for the Copy key.

public static final KeyCode
CUT

Constant for the Cut key.

public static final KeyCode
D

Constant for the D key.

public static final KeyCode
DEAD_ABOVEDOT

Constant for the Dead Abovedot key.

public static final KeyCode
DEAD_ABOVERING

Constant for the Dead Abovering key.

public static final KeyCode
DEAD_ACUTE

Constant for the Dead Acute key.

public static final KeyCode
DEAD_BREVE

Constant for the Dead Breve key.

public static final KeyCode
DEAD_CARON

Constant for the Dead Caron key.

public static final KeyCode
DEAD_CEDILLA

Constant for the Dead Cedilla key.

public static final KeyCode
DEAD_CIRCUMFLEX

Constant for the Dead Circumflex key.

public static final KeyCode
DEAD_DIAERESIS

Constant for the Dead Diaeresis key.

public static final KeyCode
DEAD_DOUBLEACUTE

Constant for the Dead Doubleacute key.

public static final KeyCode
DEAD_GRAVE

Constant for the Dead Grave key.

public static final KeyCode
DEAD_IOTA

Constant for the Dead Iota key.

public static final KeyCode
DEAD_MACRON

Constant for the Dead Macron key.

public static final KeyCode
DEAD_OGONEK

Constant for the Dead Ogonek key.

public static final KeyCode
DEAD_SEMIVOICED_SOUND

Constant for the Dead Semivoiced Sound key.

public static final KeyCode
DEAD_TILDE

Constant for the Dead Tilde key.

public static final KeyCode
DEAD_VOICED_SOUND

Constant for the Dead Voiced Sound key.

public static final KeyCode
DECIMAL

Constant for the Decimal key.

public static final KeyCode
DELETE

Constant for the Delete key.

public static final KeyCode
DIGIT0

Constant for the 0 key.

public static final KeyCode
DIGIT1

Constant for the 1 key.

public static final KeyCode
DIGIT2

Constant for the 2 key.

public static final KeyCode
DIGIT3

Constant for the 3 key.

public static final KeyCode
DIGIT4

Constant for the 4 key.

public static final KeyCode
DIGIT5

Constant for the 5 key.

public static final KeyCode
DIGIT6

Constant for the 6 key.

public static final KeyCode
DIGIT7

Constant for the 7 key.

public static final KeyCode
DIGIT8

Constant for the 8 key.

public static final KeyCode
DIGIT9

Constant for the 9 key.

public static final KeyCode
DIVIDE

Constant for the Divide key.

public static final KeyCode
DOLLAR

Constant for the "$" key.

public static final KeyCode
DOWN

Constant for the non-numpad down arrow key.

public static final KeyCode
E

Constant for the E key.

public static final KeyCode
EJECT_TOGGLE

Constant for the Eject key.

public static final KeyCode
END

Constant for the End key.

public static final KeyCode
ENTER

Constant for the Enter key.

public static final KeyCode
EQUALS

Constant for the equals key, "="

public static final KeyCode
ESCAPE

Constant for the Esc key.

public static final KeyCode
EURO_SIGN

Constant for the Euro currency sign key.

public static final KeyCode
EXCLAMATION_MARK

Constant for the "!" key.

public static final KeyCode
F

Constant for the F key.

public static final KeyCode
F1

Constant for the F1 function key.

public static final KeyCode
F10

Constant for the F10 function key.

public static final KeyCode
F11

Constant for the F11 function key.

public static final KeyCode
F12

Constant for the F12 function key.

public static final KeyCode
F13

Constant for the F13 function key.

public static final KeyCode
F14

Constant for the F14 function key.

public static final KeyCode
F15

Constant for the F15 function key.

public static final KeyCode
F16

Constant for the F16 function key.

public static final KeyCode
F17

Constant for the F17 function key.

public static final KeyCode
F18

Constant for the F18 function key.

public static final KeyCode
F19

Constant for the F19 function key.

public static final KeyCode
F2

Constant for the F2 function key.

public static final KeyCode
F20

Constant for the F20 function key.

public static final KeyCode
F21

Constant for the F21 function key.

public static final KeyCode
F22

Constant for the F22 function key.

public static final KeyCode
F23

Constant for the F23 function key.

public static final KeyCode
F24

Constant for the F24 function key.

public static final KeyCode
F3

Constant for the F3 function key.

public static final KeyCode
F4

Constant for the F4 function key.

public static final KeyCode
F5

Constant for the F5 function key.

public static final KeyCode
F6

Constant for the F6 function key.

public static final KeyCode
F7

Constant for the F7 function key.

public static final KeyCode
F8

Constant for the F8 function key.

public static final KeyCode
F9

Constant for the F9 function key.

public static final KeyCode
FAST_FWD

Constant for the Fast Forward key.

public static final KeyCode
FINAL

Constant for input method support on Asian Keyboards.

public static final KeyCode
FIND

Constant for the Find key.

public static final KeyCode
FULL_WIDTH

Constant for the Full-Width Characters function key.

public static final KeyCode
G

Constant for the G key.

public static final KeyCode
GAME_A

Constant for the Game A key.

public static final KeyCode
GAME_B

Constant for the Game B key.

public static final KeyCode
GAME_C

Constant for the Game C key.

public static final KeyCode
GAME_D

Constant for the Game D key.

public static final KeyCode
GREATER

Constant for the Greater key.

public static final KeyCode
H

Constant for the H key.

public static final KeyCode
HALF_WIDTH

Constant for the Half-Width Characters function key.

public static final KeyCode
HELP

Constant for the Help key.

public static final KeyCode
HIRAGANA

Constant for the Hiragana function key.

public static final KeyCode
HOME

Constant for the Home key.

public static final KeyCode
I

Constant for the I key.

public static final KeyCode
INFO

Constant for the Info key.

public static final KeyCode
INPUT_METHOD_ON_OFF

Constant for the input method on/off key.

public static final KeyCode
INSERT

Constant for the Insert key.

public static final KeyCode
INVERTED_EXCLAMATION_MARK

Constant for the inverted exclamation mark key.

public static final KeyCode
J

Constant for the J key.

public static final KeyCode
JAPANESE_HIRAGANA

Constant for the Japanese-Hiragana function key.

public static final KeyCode
JAPANESE_KATAKANA

Constant for the Japanese-Katakana function key.

public static final KeyCode
JAPANESE_ROMAN

Constant for the Japanese-Roman function key.

public static final KeyCode
K

Constant for the K key.

public static final KeyCode
KANA

Constant for the Kana key.

public static final KeyCode
KANA_LOCK

Constant for the locking Kana function key.

public static final KeyCode
KANJI

Constant for the Kanji key.

public static final KeyCode
KATAKANA

Constant for the Katakana function key.

public static final KeyCode
KP_DOWN

Constant for the numeric keypad down arrow key.

public static final KeyCode
KP_LEFT

Constant for the numeric keypad left arrow key.

public static final KeyCode
KP_RIGHT

Constant for the numeric keypad right arrow key.

public static final KeyCode
KP_UP

Constant for the numeric keypad up arrow key.

public static final KeyCode
L

Constant for the L key.

public static final KeyCode
LEFT

Constant for the non-numpad left arrow key.

public static final KeyCode
LEFT_PARENTHESIS

Constant for the "(" key.

public static final KeyCode
LESS

Constant for the Less key.

public static final KeyCode
M

Constant for the M key.

private int
public static final KeyCode
META

Constant for the Meta key.

public static final KeyCode
MINUS

Constant for the minus key, "-"

public static final KeyCode
MODECHANGE

Constant for the Mode Change key.

public static final KeyCode
MULTIPLY

Constant for the Multiply key.

public static final KeyCode
MUTE

Constant for the Mute key.

public static final KeyCode
N

Constant for the N key.

pack-priv final String
private static final Map<String, KeyCode>
public static final KeyCode
NONCONVERT

Constant for the Don't Convert function key.

public static final KeyCode
NUM_LOCK

Constant for the Num Lock key.

public static final KeyCode
NUMBER_SIGN

Constant for the "#" key.

public static final KeyCode
NUMPAD0

Constant for the Numpad 0 key.

public static final KeyCode
NUMPAD1

Constant for the Numpad 1 key.

public static final KeyCode
NUMPAD2

Constant for the Numpad 2 key.

public static final KeyCode
NUMPAD3

Constant for the Numpad 3 key.

public static final KeyCode
NUMPAD4

Constant for the Numpad 4 key.

public static final KeyCode
NUMPAD5

Constant for the Numpad 5 key.

public static final KeyCode
NUMPAD6

Constant for the Numpad 6 key.

public static final KeyCode
NUMPAD7

Constant for the Numpad 7 key.

public static final KeyCode
NUMPAD8

Constant for the Numpad 8 key.

public static final KeyCode
NUMPAD9

Constant for the Numpad 9 key.

public static final KeyCode
O

Constant for the O key.

public static final KeyCode
OPEN_BRACKET

Constant for the open bracket key, "["

public static final KeyCode
P

Constant for the P key.

public static final KeyCode
PAGE_DOWN

Constant for the Page Down key.

public static final KeyCode
PAGE_UP

Constant for the Page Up key.

public static final KeyCode
PASTE

Constant for the Paste key.

public static final KeyCode
PAUSE

Constant for the Pause key.

public static final KeyCode
PERIOD

Constant for the period key, "."

public static final KeyCode
PLAY

Constant for the Play key.

public static final KeyCode
PLUS

Constant for the "+" key.

public static final KeyCode
POUND

Constant for the Pound key.

public static final KeyCode
POWER

Constant for the Power key.

public static final KeyCode
PREVIOUS_CANDIDATE

Constant for the Previous Candidate function key.

public static final KeyCode
PRINTSCREEN

Constant for the Print Screen key.

public static final KeyCode
PROPS

Constant for the Properties key.

public static final KeyCode
Q

Constant for the Q key.

public static final KeyCode
QUOTE

Constant for the Quote key.

public static final KeyCode
QUOTEDBL

Constant for the Double Quote key.

public static final KeyCode
R

Constant for the R key.

public static final KeyCode
RECORD

Constant for the Record key.

public static final KeyCode
REWIND

Constant for the Rewind key.

public static final KeyCode
RIGHT

Constant for the non-numpad right arrow key.

public static final KeyCode
RIGHT_PARENTHESIS

Constant for the ")" key.

public static final KeyCode
ROMAN_CHARACTERS

Constant for the Roman Characters function key.

public static final KeyCode
S

Constant for the S key.

public static final KeyCode
SCROLL_LOCK

Constant for the Scroll Lock key.

public static final KeyCode
SEMICOLON

Constant for the semicolon key, ";"

public static final KeyCode
SEPARATOR

Constant for the Numpad Separator key.

public static final KeyCode
SHIFT

Constant for the Shift key.

public static final KeyCode
SHORTCUT

Constant for the Shortcut key.

public static final KeyCode
SLASH

Constant for the forward slash key, "/"

public static final KeyCode
SOFTKEY_0

Constant for the Softkey 0 key.

public static final KeyCode
SOFTKEY_1

Constant for the Softkey 1 key.

public static final KeyCode
SOFTKEY_2

Constant for the Softkey 2 key.

public static final KeyCode
SOFTKEY_3

Constant for the Softkey 3 key.

public static final KeyCode
SOFTKEY_4

Constant for the Softkey 4 key.

public static final KeyCode
SOFTKEY_5

Constant for the Softkey 5 key.

public static final KeyCode
SOFTKEY_6

Constant for the Softkey 6 key.

public static final KeyCode
SOFTKEY_7

Constant for the Softkey 7 key.

public static final KeyCode
SOFTKEY_8

Constant for the Softkey 8 key.

public static final KeyCode
SOFTKEY_9

Constant for the Softkey 9 key.

public static final KeyCode
SPACE

Constant for the Space key.

public static final KeyCode
STAR

Constant for the Star key.

public static final KeyCode
STOP

Constant for the Stop key.

public static final KeyCode
SUBTRACT

Constant for the Subtract key.

public static final KeyCode
T

Constant for the T key.

public static final KeyCode
TAB

Constant for the Tab key.

public static final KeyCode
TRACK_NEXT

Constant for the Next Track key.

public static final KeyCode
TRACK_PREV

Constant for the Previous Track key.

public static final KeyCode
U

Constant for the U key.

public static final KeyCode
UNDEFINED

This value is used to indicate that the keyCode is unknown.

public static final KeyCode
UNDERSCORE

Constant for the "_" key.

public static final KeyCode
UNDO

Constant for the Undo key.

public static final KeyCode
UP

Constant for the non-numpad up arrow key.

public static final KeyCode
V

Constant for the V key.

public static final KeyCode
VOLUME_DOWN

Constant for the Volume Down key.

public static final KeyCode
VOLUME_UP

Constant for the Volume Up key.

public static final KeyCode
W

Constant for the W key.

public static final KeyCode
WINDOWS

Constant for the Microsoft Windows "Windows" key.

public static final KeyCode
X

Constant for the X key.

public static final KeyCode
Y

Constant for the Y key.

public static final KeyCode
Z

Constant for the Z key.

Constructor Summary

AccessConstructor and Description
private
KeyCode(int code, String name, int mask)

private
KeyCode(int code, String name)

Method Summary

Modifier and TypeMethod and Description
public final String

Returns:

the character element of this key code
getChar
()

Returns the character element of this key code, which is simply a mapping of the underlying platform code returned by getCode().

public final int

Returns:

the underlying platform code used to represent the character in the key code
getCode
()

Returns the underlying platform code used to represent the character in the key code.

public static KeyCode

Returns:

KeyCode for the key with the given name, null if the string is unknown
getKeyCode
(String
Textual representation of the key
name
)

Parses textual representation of a key.

public final String

Returns:

Name of this key code
getName
()

Gets name of this key code.

public final boolean

Returns:

true if this key code corresponds to an arrow key
isArrowKey
()

Left, right, up, down keys (including the keypad arrows)

public final boolean

Returns:

true if this key code corresponds to a digit key
isDigitKey
()

All Digit keys (including the keypad digits)

public final boolean

Returns:

true if this key code corresponds to a functional key
isFunctionKey
()

Function keys like F1, F2, etc...

public final boolean

Returns:

true if this key code corresponds to a keypad key
isKeypadKey
()

All keys on the keypad

public final boolean

Returns:

true if this key code corresponds to a letter key
isLetterKey
()

All keys with letters

public final boolean

Returns:

true if this key code corresponds to a media key
isMediaKey
()

All multimedia keys (channel up/down, volume control, etc...)

public final boolean

Returns:

true if this key code corresponds to a modifier key
isModifierKey
()

Keys that could act as a modifier

public final boolean

Returns:

true if this key code corresponds to a navigation key
isNavigationKey
()

Navigation keys are arrow keys and Page Down, Page Up, Home, End (including keypad keys)

public final boolean

Returns:

true if this key code corresponds to a whitespace key
isWhitespaceKey
()

Space, tab and enter

public static KeyCode
public static KeyCode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf