Keystrokes : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

Keystrokes
It can be difficult to explain to someone over the phone what keys to hit to get the effect they need. One dear woman spelled out the word E N T E R when I wanted her to hit the [Enter] key. Here are the conventions I used to make this clear. When I want to make it clear I am talking about a single key I will sometimes enclose it in brackets, e.g.
[BackSpace] [space bar]

When I want you to press two keys at once I use a + sign, e.g.

[ctrl]+S
That means press [Ctrl] and hold it down, tap the S key, then release the [Ctrl] key. It won’t work if you try to press both keys down exactly at once as if you were playing a piano chord.

The famous reboot sequence:

[Ctrl]+[Alt]+[Delete]
means press [Ctrl] and hold it down, press [Alt] and hold it down, tap [Delete], let go of [Alt] and [Ctrl]. You may let go of [Alt] and [Ctrl] in either order or exactly simultaneously. For writing keystroke documentation for novices it would be nice to have a font that made it clear that [BackSpace] was a single key. It would be a single glyph that looked like a key. I have not yet found one.

KeyStroke Name Gotchas

KeyStroke.getKeyStroke(String) and (String) KeyEvent.getKeyText() are inconsistent in the way they name keystrokes. Further, getModifiersText() is also incompatible with KeyStroke.getKeyStroke(String). For example, getKeytext calls a key Enter where getKeyStroke insists it be called ENTER. You can’t simply convert all to upper case, since getKeyStroke wants the word control etc. in lower case. Also watch out for space. It is simpler to use serialization, but then you the log file will not be human-readable. You need to generate your own names because of the following incompatibilities:
getKeyStroke or VK_xxxx getKeyText
ACCEPT Accept
ADD NumPad +
AGAIN Again
ALL_CANDIDATES All Candidates
ALPHANUMERIC Alphanumeric
ALT Alt
ALT_GRAPH Alt Graph
AMPERSAND Ampersand
ASTERISK Asterisk
AT (Advanced Technology) At
BACK_QUOTE Back Quote
BACK_SLASH \
BACK_SPACE Backspace
BRACELEFT Left Brace
BRACERIGHT Right Brace
CANCEL Cancel
CAPS_LOCK Caps Lock
CIRCUMFLEX Circumflex
CLEAR Clear
CLOSE_BRACKET ]
CODE_INPUT Code Input
COLON Colon
COMMA ,
COMPOSE Compose
CONTROL Ctrl
CONVERT Convert
COPY Copy
DEAD_ABOVEDOT Dead Above Dot
DEAD_ABOVERING Dead Above Ring
DEAD_ACUTE Dead Acute
DEAD_BREVE Dead Breve
DEAD_CARON Dead Caron
DEAD_CEDILLA Dead Cedilla
DEAD_CIRCUMFLEX Dead Circumflex
DEAD_DIAERESIS Dead Diaeresis
DEAD_DOUBLEACUTE Dead Double Acute
DEAD_GRAVE Dead Grave
DEAD_IOTA Dead Iota
DEAD_MACRON Dead Macron
DEAD_OGONEK Dead Ogonek
DEAD_SEMIVOICED_SOUND Dead Semivoiced Sound
DEAD_TILDE Dead Tilde
DEAD_VOICED_SOUND Dead Voiced Sound
DECIMAL NumPad .
DELETE Delete
DIVIDE NumPad /
DOLLAR Dollar
DOWN Down
END End
ENTER Enter
EQUALS =
ESCAPE Escape
EURO_SIGN Euro
EXCLAMATION_MARK Exclamation Mark
FINAL Final
FIND Find
FULL_WIDTH Full-Witdh
GREATER Greater
HALF_WIDTH Half-Witdh
HELP Help
HIRAGANA Hiragana
HOME Home
INPUT_METHOD_ON_OFF Input Method On/Off
INSERT Insert
INVERTED_EXCLAMATION_MARK Inverted Exclamation Mark
JAPANESE_HIRAGANA Japanese Hiragana
JAPANESE_KATAKANA Japanese Katakana
JAPANESE_ROMAN Japanese Roman
KANA Kana
KANA_LOCK Kana Lock
KANJI Kanji
KATAKANA Katakana
KP_DOWN Down
KP_LEFT Left
KP_RIGHT Right
KP_UP Up
LEFT Left
LEFT_PARENTHESIS Left Parenthesis
LESS Less
META Meta
MINUS Minus
MODECHANGE Mode Change
MULTIPLY NumPad *
NONCONVERT No Convert
NUM_LOCK Num Lock
NUMBER_SIGN Number Sign
NUMPAD0 NumPad-0
NUMPAD1 NumPad-1
NUMPAD2 NumPad-2
NUMPAD3 NumPad-3
NUMPAD4 NumPad-4
NUMPAD5 NumPad-5
NUMPAD6 NumPad-6
NUMPAD7 NumPad-7
NUMPAD8 NumPad-8
NUMPAD9 NumPad-9
OPEN_BRACKET [
PAGE_DOWN Page Down
PAGE_UP Page Up
PASTE Paste
PAUSE Pause
PERIOD .
PLUS Plus
PREVIOUS_CANDIDATE Previous Candidate
PRINTSCREEN Print Screen
PROPS Props
QUOTE Quote
QUOTEDBL Double Quote
RIGHT Right
RIGHT_PARENTHESIS Right Parenthesis
ROMAN_CHARACTERS Roman Characters
SCROLL_LOCK Scroll Lock
SEMICOLON ;
SEPARATER (Why can’t programmers spell that word?) NumPad,
SHIFT Shift
SLASH /
SPACE Space
STOP Stop
SUBTRACT NumPad -
TAB Tab
UNDERSCORE Underscore
UNDO Undo
UP Up

This page is posted
on the web at:

http://mindprod.com/jgloss/keystroke.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\keystroke.html
logo
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[54.205.176.107]
You are visitor number