Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

KeyCode

Description

Key codes returned by Event.keyCode. These map directly to a physical key on the keyboard.

Variables

NoneNot assigned (never returned as the result of a keystroke).
BackspaceThe backspace key.
DeleteThe forward delete key.
TabThe tab key.
ClearThe Clear key.
ReturnReturn key.
PausePause on PC machines.
EscapeEscape key.
SpaceSpace key.
Keypad0Numeric keypad 0.
Keypad1Numeric keypad 1.
Keypad2Numeric keypad 2.
Keypad3Numeric keypad 3.
Keypad4Numeric keypad 4.
Keypad5Numeric keypad 5.
Keypad6Numeric keypad 6.
Keypad7Numeric keypad 7.
Keypad8Numeric keypad 8.
Keypad9Numeric keypad 9.
KeypadPeriodNumeric keypad '.'.
KeypadDivideNumeric keypad '/'.
KeypadMultiplyNumeric keypad '*'.
KeypadMinusNumeric keypad '-'.
KeypadPlusNumeric keypad '+'.
KeypadEnterNumeric keypad enter.
KeypadEqualsNumeric keypad '='.
UpArrowUp arrow key.
DownArrowDown arrow key.
RightArrowRight arrow key.
LeftArrowLeft arrow key.
InsertInsert key key.
HomeHome key.
EndEnd key.
PageUpPage up.
PageDownPage down.
F1F1 function key.
F2F2 function key.
F3F3 function key.
F4F4 function key.
F5F5 function key.
F6F6 function key.
F7F7 function key.
F8F8 function key.
F9F9 function key.
F10F10 function key.
F11F11 function key.
F12F12 function key.
F13F13 function key.
F14F14 function key.
F15F15 function key.
Alpha0The '0' key on the top of the alphanumeric keyboard.
Alpha1The '1' key on the top of the alphanumeric keyboard.
Alpha2The '2' key on the top of the alphanumeric keyboard.
Alpha3The '3' key on the top of the alphanumeric keyboard.
Alpha4The '4' key on the top of the alphanumeric keyboard.
Alpha5The '5' key on the top of the alphanumeric keyboard.
Alpha6The '6' key on the top of the alphanumeric keyboard.
Alpha7The '7' key on the top of the alphanumeric keyboard.
Alpha8The '8' key on the top of the alphanumeric keyboard.
Alpha9The '9' key on the top of the alphanumeric keyboard.
ExclaimExclamation mark key '!'.
DoubleQuoteDouble quote key '"'.
HashHash key '#'.
DollarDollar sign key '$'.
AmpersandAmpersand key '&'.
QuoteQuote key '.
LeftParenLeft Parenthesis key '('.
RightParenRight Parenthesis key ')'.
AsteriskAsterisk key '*'.
PlusPlus key '+'.
CommaComma ',' key.
MinusMinus '-' key.
PeriodPeriod '.' key.
SlashSlash '/' key.
ColonColon ':' key.
SemicolonSemicolon ';' key.
LessLess than '<' key.
EqualsEquals '=' key.
GreaterGreater than '>' key.
QuestionQuestion mark '?' key.
AtAt key '@'.
LeftBracketLeft square bracket key '['.
BackslashBackslash key '\'.
RightBracketRight square bracket key ']'.
CaretCaret key '^'.
UnderscoreUnderscore '_' key.
BackQuoteBack quote key '`'.
A'a' key.
B'b' key.
C'c' key.
D'd' key.
E'e' key.
F'f' key.
G'g' key.
H'h' key.
I'i' key.
J'j' key.
K'k' key.
L'l' key.
M'm' key.
N'n' key.
O'o' key.
P'p' key.
Q'q' key.
R'r' key.
S's' key.
T't' key.
U'u' key.
V'v' key.
W'w' key.
X'x' key.
Y'y' key.
Z'z' key.
NumlockNumlock key.
CapsLockCapslock key.
ScrollLockScroll lock key.
RightShiftRight shift key.
LeftShiftLeft shift key.
RightControlRight Control key.
LeftControlLeft Control key.
RightAltRight Alt key.
LeftAltLeft Alt key.
LeftCommandLeft Command key.
LeftAppleLeft Command key.
LeftWindowsLeft Windows key.
RightCommandRight Command key.
RightAppleRight Command key.
RightWindowsRight Windows key.
AltGrAlt Gr key.
HelpHelp key.
PrintPrint key.
SysReqSys Req key.
BreakBreak key.
MenuMenu key.
Mouse0First (primary) mouse button.
Mouse1Second (secondary) mouse button.
Mouse2Third mouse button.
Mouse3Fourth mouse button.
Mouse4Fifth mouse button.
Mouse5Sixth mouse button.
Mouse6Seventh mouse button.
JoystickButton0Button 0 on any joystick.
JoystickButton1Button 1 on any joystick.
JoystickButton2Button 2 on any joystick.
JoystickButton3Button 3 on any joystick.
JoystickButton4Button 4 on any joystick.
JoystickButton5Button 5 on any joystick.
JoystickButton6Button 6 on any joystick.
JoystickButton7Button 7 on any joystick.
JoystickButton8Button 8 on any joystick.
JoystickButton9Button 9 on any joystick.
JoystickButton10Button 10 on any joystick.
JoystickButton11Button 11 on any joystick.
JoystickButton12Button 12 on any joystick.
JoystickButton13Button 13 on any joystick.
JoystickButton14Button 14 on any joystick.
JoystickButton15Button 15 on any joystick.
JoystickButton16Button 16 on any joystick.
JoystickButton17Button 17 on any joystick.
JoystickButton18Button 18 on any joystick.
JoystickButton19Button 19 on any joystick.
Joystick1Button0Button 0 on first joystick.
Joystick1Button1Button 1 on first joystick.
Joystick1Button2Button 2 on first joystick.
Joystick1Button3Button 3 on first joystick.
Joystick1Button4Button 4 on first joystick.
Joystick1Button5Button 5 on first joystick.
Joystick1Button6Button 6 on first joystick.
Joystick1Button7Button 7 on first joystick.
Joystick1Button8Button 8 on first joystick.
Joystick1Button9Button 9 on first joystick.
Joystick1Button10Button 10 on first joystick.
Joystick1Button11Button 11 on first joystick.
Joystick1Button12Button 12 on first joystick.
Joystick1Button13Button 13 on first joystick.
Joystick1Button14Button 14 on first joystick.
Joystick1Button15Button 15 on first joystick.
Joystick1Button16Button 16 on first joystick.
Joystick1Button17Button 17 on first joystick.
Joystick1Button18Button 18 on first joystick.
Joystick1Button19Button 19 on first joystick.
Joystick2Button0Button 0 on second joystick.
Joystick2Button1Button 1 on second joystick.
Joystick2Button2Button 2 on second joystick.
Joystick2Button3Button 3 on second joystick.
Joystick2Button4Button 4 on second joystick.
Joystick2Button5Button 5 on second joystick.
Joystick2Button6Button 6 on second joystick.
Joystick2Button7Button 7 on second joystick.
Joystick2Button8Button 8 on second joystick.
Joystick2Button9Button 9 on second joystick.
Joystick2Button10Button 10 on second joystick.
Joystick2Button11Button 11 on second joystick.
Joystick2Button12Button 12 on second joystick.
Joystick2Button13Button 13 on second joystick.
Joystick2Button14Button 14 on second joystick.
Joystick2Button15Button 15 on second joystick.
Joystick2Button16Button 16 on second joystick.
Joystick2Button17Button 17 on second joystick.
Joystick2Button18Button 18 on second joystick.
Joystick2Button19Button 19 on second joystick.
Joystick3Button0Button 0 on third joystick.
Joystick3Button1Button 1 on third joystick.
Joystick3Button2Button 2 on third joystick.
Joystick3Button3Button 3 on third joystick.
Joystick3Button4Button 4 on third joystick.
Joystick3Button5Button 5 on third joystick.
Joystick3Button6Button 6 on third joystick.
Joystick3Button7Button 7 on third joystick.
Joystick3Button8Button 8 on third joystick.
Joystick3Button9Button 9 on third joystick.
Joystick3Button10Button 10 on third joystick.
Joystick3Button11Button 11 on third joystick.
Joystick3Button12Button 12 on third joystick.
Joystick3Button13Button 13 on third joystick.
Joystick3Button14Button 14 on third joystick.
Joystick3Button15Button 15 on third joystick.
Joystick3Button16Button 16 on third joystick.
Joystick3Button17Button 17 on third joystick.
Joystick3Button18Button 18 on third joystick.
Joystick3Button19Button 19 on third joystick.
Joystick4Button0Button 0 on forth joystick.
Joystick4Button1Button 1 on forth joystick.
Joystick4Button2Button 2 on forth joystick.
Joystick4Button3Button 3 on forth joystick.
Joystick4Button4Button 4 on forth joystick.
Joystick4Button5Button 5 on forth joystick.
Joystick4Button6Button 6 on forth joystick.
Joystick4Button7Button 7 on forth joystick.
Joystick4Button8Button 8 on forth joystick.
Joystick4Button9Button 9 on forth joystick.
Joystick4Button10Button 10 on forth joystick.
Joystick4Button11Button 11 on forth joystick.
Joystick4Button12Button 12 on forth joystick.
Joystick4Button13Button 13 on forth joystick.
Joystick4Button14Button 14 on forth joystick.
Joystick4Button15Button 15 on forth joystick.
Joystick4Button16Button 16 on forth joystick.
Joystick4Button17Button 17 on forth joystick.
Joystick4Button18Button 18 on forth joystick.
Joystick4Button19Button 19 on forth joystick.