KeyCode
The KeyCode enumeration is used to represent keys and includes many common keys that can be used to detect user input.
| attributes | description |
|---|---|
| None | Indicates that no key is associated with this input event. |
| Backspace | Represents the backspace key on the keyboard. |
| Tab | Represents the Tab key on the keyboard. |
| Clear | Represents the Clear key on the keyboard. |
| Enter | Represents the Enter key on the keyboard. |
| Pause | Represents the Pause key on the keyboard. |
| ESC | Represents the Escape key on the keyboard. |
| Space | Represents the spacebar key on the keyboard. |
| Exclaim | Represents the exclamation mark (!) key on the keyboard. |
| DoubleQuote | Represents the double quotation mark " key on the keyboard. |
| Hash | Represents the pound sign # key on the keyboard. |
| Dollar | Represents the $ key on the keyboard. |
| Percent | Represents the percent (%) key on the keyboard. |
| Ampersand | Represents the '&' key on the keyboard. |
| Quote | Represents the single quote/double quote key on the keyboard. |
| LeftParen | Represents the left parenthesis "(" key on the keyboard. |
| RightParen | Represents the right parenthesis ( ) key on the keyboard. |
| Asterisk | Represents the asterisk (*) key on the keyboard. |
| Plus | Represents the plus sign + key on the keyboard. |
| Comma | Represents the comma key on the keyboard. |
| Minus | Represents the minus (-) key on the keyboard. |
| Period | Represents the period key on the keyboard. |
| Slash | Represents the slash key on the keyboard. |
| Alpha0 | The number 0 on the numeric keypad. |
| Alpha1 | The number 1 on the numeric keypad. |
| Alpha2 | The number 2 on the numeric keypad. |
| Alpha3 | The number 3 on the numeric keypad. |
| Alpha4 | The number 4 on the numeric keypad. |
| Alpha5 | The number 5 on the numeric keypad. |
| Alpha6 | The number 6 on the numeric keypad. |
| Alpha7 | The number 7 on the numeric keypad. |
| Alpha8 | The number 8 on the numeric keypad. |
| Alpha9 | The number 9 on the numeric keypad. |
| Colon | Represents the colon ":" key on the keyboard. |
| Semicolon | Represents the semicolon (😉 key on the keyboard. |
| Less | Represents the less than < key on the keyboard. |
| Equals | Represents the equals sign = key on the keyboard. |
| Greater | Represents the greater than > key on the keyboard. |
| Question | Represents the question mark/slash key on the keyboard. |
| At | Represents the @ key on the keyboard. |
| LeftBracket | Represents the left square bracket [ key on the keyboard. |
| Backslash | Represents the backslash \ key on the keyboard. |
| RightBracket | Represents the right square bracket [ key on the keyboard. |
| Caret | Represents the caret symbol ^ on the keyboard. |
| Underscore | Represents the underscore (_) key on the keyboard. |
| BackQuote | Represents the backtick ` key on the keyboard. |
| A | The A key on the keyboard. |
| B | The B key on the keyboard. |
| C | The C key on the keyboard. |
| D | The D key on the keyboard. |
| E | The E key on the keyboard. |
| F | The F key on the keyboard. |
| G | The G key on the keyboard. |
| H | The H key on the keyboard. |
| I | The "I" key on the keyboard. |
| J | The J key on the keyboard. |
| K | The K key on the keyboard. |
| L | The L key on the keyboard. |
| M | The M key on the keyboard. |
| N | The N key on the keyboard. |
| O | The O key on the keyboard. |
| P | The P key on the keyboard. |
| Q | The Q key on the keyboard. |
| R | The R key on the keyboard. |
| S | The S key on the keyboard. |
| T | The T key on the keyboard. |
| U | The U key on the keyboard. |
| V | The V key on the keyboard. |
| W | The W key on the keyboard. |
| X | The X key on the keyboard. |
| Y | The Y key on the keyboard. |
| Z | The Z key on the keyboard. |
| LeftCurlyBracket | Represents the left curly brace key { on the keyboard. |
| Pipe | Represents the pipe character |
| RightCurlyBracket | Represents the right curly brace key on the keyboard, { key. |
| Tilde | Represents the tilde (~) key on the keyboard. |
| Delete | Represents the delete key on the keyboard. |
| Keypad0 | Represents the numeric keypad 0 key on the keyboard. |
| Keypad1 | Represents the number key 1 on the keyboard. |
| Keypad2 | Represents the number key 2 on the keyboard. |
| Keypad3 | Represents the number key 3 on the keyboard. |
| Keypad4 | Represents the number 4 key on the keyboard. |
| Keypad5 | Represents the number key 5 on the keyboard. |
| Keypad6 | Represents the number key 6 on the keyboard. |
| Keypad7 | Represents the number 7 key on the keyboard's numeric keypad. |
| Keypad8 | Represents the number 8 key on the keyboard's numeric keypad. |
| Keypad9 | Represents the number 9 key on the keyboard's numeric keypad. |
| KeypadPeriod | Represents the decimal point "." key on the numeric keypad of the keyboard. |
| KeypadDivide | Represents the numeric keypad on the keyboard, excluding the / key. |
| KeypadMultiply | Represents the multiplication (*) key on the numeric keypad of the keyboard. |
| KeypadMinus | Represents the minus (-) key on the numeric keypad of the keyboard. |
| KeypadPlus | Represents the plus (+) key on the numeric keypad of the keyboard. |
| KeypadEnter | Represents the enter key on the numeric keypad of the keyboard. |
| KeypadEquals | Represents the equals = key on the numeric keypad of the keyboard. |
| UpArrow | Represents the upward arrow key on the keyboard. |
| DownArrow | Represents the down arrow key on the keyboard. |
| RightArrow | Represents the right arrow key on the keyboard. |
| LeftArrow | Represents the left arrow key on the keyboard. |
| Insert | Represents the Insert key on the keyboard. |
| Home | Represents the Home key on the keyboard. |
| End | Represents the end key on the keyboard. |
| PageUp | Represents the Page Up key on the keyboard. |
| PageDown | Represents the Page Down key on the keyboard. |
| F1 | Represents the F1 key on the keyboard. |
| F2 | Represents the F2 key on the keyboard. |
| F3 | Represents the F3 key on the keyboard. |
| F4 | Represents the F4 key on the keyboard. |
| F5 | Represents the F5 key on the keyboard. |
| F6 | Represents the F6 key on the keyboard. |
| F7 | Represents the F7 key on the keyboard. |
| F8 | Represents the F8 key on the keyboard. |
| F9 | Represents the F9 key on the keyboard. |
| F10 | Represents the F10 key on the keyboard. |
| F11 | Represents the F11 key on the keyboard. |
| F12 | Represents the F12 key on the keyboard. |
| F13 | Represents the F13 key on the keyboard. |
| F14 | Represents the F14 key on the keyboard. |
| F15 | Represents the F15 key on the keyboard. |
| Numlock | Represents the Num Lock key on the keyboard. |
| CapsLock | Represents the Caps Lock key on the keyboard. |
| ScrollLock | Represents the Scroll Lock key on the keyboard. |
| RightShift | Represents the right Shift key on the keyboard. |
| LeftShift | Represents the left Shift key on the keyboard. |
| RightControl | Represents the right Ctrl key on the keyboard. |
| LeftControl | Represents the left Ctrl key on the keyboard. |
| RightAlt | Represents the right Alt key on the keyboard. |
| LeftAlt | Represents the left Alt key on the keyboard. |
| RightCommand | Represents the right Command key on the keyboard. |
| RightApple | Represents the right Apple key on the keyboard. |
| LeftCommand | Represents the left Command key on a Mac keyboard. |
| LeftApple | Represents the Apple key. |
| LeftWindows | Represents the left Windows key on the keyboard. |
| RightWindows | Represents the right Windows key on the keyboard. |
| AltGr | The right Alt key. |
| Help | Represents the Help key on the keyboard. |
| Represents the Print Screen key on the keyboard. | |
| SysReq | Represents the SysReq key on the keyboard. |
| Break | Represents the Pause/Break key on the keyboard. |
| Menu | Represents the menu key on the keyboard or device. |
| Mouse0 | Mouse left button. |
| Mouse1 | Mouse right button. |
| Mouse2 | Middle mouse button. |
| Mouse3 | The fourth mouse button. |
| Mouse4 | The fifth mouse button. |
| Mouse5 | The sixth mouse button. |
| Mouse6 | The seventh mouse button. |
| JoystickButton0 | Represents button 0 on the gamepad. |
| JoystickButton1 | Represents button 1 on a gamepad. |
| JoystickButton2 | Represents button 2 on a gamepad. |
| JoystickButton3 | Represents button 3 on a gamepad. |
| JoystickButton4 | Represents button 4 on a gamepad. |
| JoystickButton5 | Represents button 5 on a gamepad. |
| JoystickButton6 | Represents button 6 on a gamepad. |
| JoystickButton7 | Represents button 7 on a gamepad. |
| JoystickButton8 | Represents button 8 on a gamepad. |
| JoystickButton9 | Represents button 9 on the gamepad. |
| JoystickButton10 | Represents button 10 on a gamepad. |
| JoystickButton11 | Represents button 11 on the gamepad. |
| JoystickButton12 | Represents button 12 on a gamepad. |
| JoystickButton13 | Represents button 13 on a gamepad. |
| JoystickButton14 | Represents button 14 on a gamepad. |
| JoystickButton15 | Represents button 15 on a gamepad. |
| JoystickButton16 | Represents button 16 on a gamepad. |
| JoystickButton17 | Represents button 17 on a gamepad. |
| JoystickButton18 | Represents button 18 on a gamepad. |
| JoystickButton19 | Represents button 19 on a gamepad. |
| Joystick1Button0 | Represents the 1st button of a gamepad. |
| Joystick1Button1 | Represents the second button on a gamepad. |
| Joystick1Button2 | Represents the 3rd button on a gamepad. |
| Joystick1Button3 | Represents the 4th button on a gamepad. |
| Joystick1Button4 | Represents the 5th button on a gamepad. |
| Joystick1Button5 | Represents the 6th button on a gamepad. |
| Joystick1Button6 | Represents the 7th button on a gamepad. |
| Joystick1Button7 | Represents the 8th button on a gamepad. |
| Joystick1Button8 | Represents the 9th button on a gamepad. |
| Joystick1Button9 | Represents the 10th button on a gamepad. |
| Joystick1Button10 | Represents the 11th button on a gamepad. |
| Joystick1Button11 | Represents the 12th button on a gamepad. |
| Joystick1Button12 | Represents the 13th button on a gamepad. |
| Joystick1Button13 | Represents the 14th button on a gamepad. |
| Joystick1Button14 | Represents the 15th button on a gamepad. |
| Joystick1Button15 | Represents the 16th button of a gamepad. |
| Joystick1Button16 | Represents the 17th button on a gamepad. |
| Joystick1Button17 | Represents the 18th button on a gamepad. |
| Joystick1Button18 | Represents the 19th button on a gamepad. |
| Joystick1Button19 | Represents the 20th button on a gamepad. |
| Joystick2Button0 | Button 1 of the second gamepad. |
| Joystick2Button1 | Button 2 of the second gamepad. |
| Joystick2Button2 | Button 3 of the second gamepad. |
| Joystick2Button3 | The 4th button of the second gamepad. |
| Joystick2Button4 | Button 5 of the second gamepad. |
| Joystick2Button5 | Button 6 of the second gamepad. |
| Joystick2Button6 | Button 7 of the second gamepad. |
| Joystick2Button7 | Button 8 of the second gamepad. |
| Joystick2Button8 | The 9th button of the second gamepad. |
| Joystick2Button9 | The 10th button of the second gamepad. |
| Joystick2Button10 | The 11th button of the second gamepad. |
| Joystick2Button11 | The 12th button of the second gamepad. |
| Joystick2Button12 | Button 13 of the second gamepad. |
| Joystick2Button13 | Button 14 of the second gamepad. |
| Joystick2Button14 | Button 15 of the second gamepad. |
| Joystick2Button15 | The 16th button of the second gamepad. |
| Joystick2Button16 | Button 17 of the second gamepad. |
| Joystick2Button17 | Button 18 of the second gamepad. |
| Joystick2Button18 | Button 19 of the second gamepad. |
| Joystick2Button19 | Button 20 of the second gamepad. |
| Joystick3Button0 | Button 1 of the third gamepad. |
| Joystick3Button1 | Button 2 of the third game controller. |
| Joystick3Button2 | The 3rd button on the third game controller. |
| Joystick3Button3 | The 4th button on the third game controller. |
| Joystick3Button4 | The 5th button on the third game controller. |
| Joystick3Button5 | The 6th button on the third game controller. |
| Joystick3Button6 | Button 7 of the third gamepad. |
| Joystick3Button7 | The 8th button of the third game controller. |
| Joystick3Button8 | Button 9 of the third gamepad. |
| Joystick3Button9 | Button 10 of the third gamepad. |
| Joystick3Button10 | Button 11 of the third game controller. |
| Joystick3Button11 | The 12th button of the third gamepad. |
| Joystick3Button12 | The 13th button of the third gamepad. |
| Joystick3Button13 | Button 14 of the third game controller. |
| Joystick3Button14 | Button 15 of the third game controller. |
| Joystick3Button15 | The 16th button of the third gamepad. |
| Joystick3Button16 | Button 17 of the third game controller. |
| Joystick3Button17 | The 18th button on the third game controller. |
| Joystick3Button18 | Button 19 of the third game controller. |
| Joystick3Button19 | Button 20 of the third game controller. |
| Joystick4Button0 | Button 1 of the fourth gamepad. |
| Joystick4Button1 | The 2nd button of the 4th gamepad. |
| Joystick4Button2 | Button 3 of the fourth game controller. |
| Joystick4Button3 | The 4th button on the 4th gamepad. |
| Joystick4Button4 | The 5th button on the 4th gamepad. |
| Joystick4Button5 | The 6th button on the fourth gamepad. |
| Joystick4Button6 | Button 7 of the fourth gamepad. |
| Joystick4Button7 | The 8th button of the fourth gamepad. |
| Joystick4Button8 | The 9th button on the fourth gamepad. |
| Joystick4Button9 | Button 10 of the fourth gamepad. |
| Joystick4Button10 | Button 11 of the fourth gamepad. |
| Joystick4Button11 | The 12th button on the fourth gamepad. |
| Joystick4Button12 | The 13th button on the fourth gamepad. |
| Joystick4Button13 | The 14th button of the fourth gamepad. |
| Joystick4Button14 | The 15th button of the fourth gamepad. |
| Joystick4Button15 | The 16th button of the fourth gamepad. |
| Joystick4Button16 | Button 17 of the fourth gamepad. |
| Joystick4Button17 | The 18th button of the fourth gamepad. |
| Joystick4Button18 | Button 19 of the fourth gamepad. |
| Joystick4Button19 | The 20th button on the fourth gamepad. |
| Joystick5Button0 | Button 1 of the fifth game controller. |
| Joystick5Button1 | Button 2 of the fifth game controller. |
| Joystick5Button2 | Button 3 of the fifth game controller. |
| Joystick5Button3 | The 4th button on the 5th game controller. |
| Joystick5Button4 | The 5th button on the 5th game controller. |
| Joystick5Button5 | Button 6 of the fifth game controller. |
| Joystick5Button6 | Button 7 of the fifth game controller. |
| Joystick5Button7 | The 8th button of the 5th gamepad. |
| Joystick5Button8 | Button 9 of the fifth game controller. |
| Joystick5Button9 | Button 10 of the fifth gamepad. |
| Joystick5Button10 | Button 11 of the fifth game controller. |
| Joystick5Button11 | The 12th button of the fifth gamepad. |
| Joystick5Button12 | Button 13 of the fifth gamepad. |
| Joystick5Button13 | The 14th button of the fifth gamepad. |
| Joystick5Button14 | Button 15 of the fifth game controller. |
| Joystick5Button15 | The 16th button of the fifth gamepad. |
| Joystick5Button16 | Button 17 of the fifth game controller. |
| Joystick5Button17 | The 18th button of the fifth game controller. |
| Joystick5Button18 | Button 19 of the fifth game controller. |
| Joystick5Button19 | Button 20 of the fifth game controller. |
| Joystick6Button0 | Button 1 of the sixth game controller. |
| Joystick6Button1 | The 2nd button of the 6th gamepad. |
| Joystick6Button2 | The 3rd button on the 6th game controller. |
| Joystick6Button3 | The 4th button on the 6th game controller. |
| Joystick6Button4 | The 5th button on the 6th game controller. |
| Joystick6Button5 | The 6th button of the 6th gamepad. |
| Joystick6Button6 | Button 7 of the sixth gamepad. |
| Joystick6Button7 | The 8th button of the 6th gamepad. |
| Joystick6Button8 | The 9th button on the 6th gamepad. |
| Joystick6Button9 | Button 10 of the sixth game controller. |
| Joystick6Button10 | The 11th button on the 6th game controller. |
| Joystick6Button11 | The 12th button on the 6th game controller. |
| Joystick6Button12 | The 13th button on the sixth gamepad. |
| Joystick6Button13 | The 14th button on the sixth game controller. |
| Joystick6Button14 | The 15th button on the sixth game controller. |
| Joystick6Button15 | The 16th button of the sixth gamepad. |
| Joystick6Button16 | Button 17 of the sixth game controller. |
| Joystick6Button17 | The 18th button of the sixth gamepad. |
| Joystick6Button18 | Button 19 of the sixth game controller. |
| Joystick6Button19 | The 20th button of the sixth game controller. |
| Joystick7Button0 | Button 1 of the seventh game controller. |
| Joystick7Button1 | The 2nd button on the 7th game controller. |
| Joystick7Button2 | The 3rd button on the 7th game controller. |
| Joystick7Button3 | The 4th button on the 7th game controller. |
| Joystick7Button4 | The 5th button on the 7th game controller. |
| Joystick7Button5 | The 6th button on the 7th game controller. |
| Joystick7Button6 | The 7th button on the 7th game controller. |
| Joystick7Button7 | The 8th button of the 7th gamepad. |
| Joystick7Button8 | The 9th button on the 7th game controller. |
| Joystick7Button9 | The 10th button on the 7th game controller. |
| Joystick7Button10 | Button 11 of the seventh game controller. |
| Joystick7Button11 | The 12th button on the seventh game controller. |
| Joystick7Button12 | The 13th button on the seventh game controller. |
| Joystick7Button13 | The 14th button on the seventh game controller. |
| Joystick7Button14 | The 15th button on the seventh game controller. |
| Joystick7Button15 | The 16th button of the seventh game controller. |
| Joystick7Button16 | Button 17 of the seventh game controller. |
| Joystick7Button17 | The 18th button on the seventh game controller. |
| Joystick7Button18 | The 19th button on the seventh game controller. |
| Joystick7Button19 | The 20th button of the seventh game controller. |
| Joystick8Button0 | Button 1 of the eighth gamepad. |
| Joystick8Button1 | The 2nd button of the 8th gamepad. |
| Joystick8Button2 | The 3rd button on the 8th game controller. |
| Joystick8Button3 | The 4th button on the 8th game controller. |
| Joystick8Button4 | The 5th button on the 8th game controller. |
| Joystick8Button5 | The 6th button on the 8th game controller. |
| Joystick8Button6 | Button 7 of the eighth game controller. |
| Joystick8Button7 | The 8th button of the 8th gamepad. |
| Joystick8Button8 | The 9th button on the 8th game controller. |
| Joystick8Button9 | The 10th button of the 8th game controller. |
| Joystick8Button10 | The 11th button of the eighth gamepad. |
| Joystick8Button11 | The 12th button on the eighth game controller. |
| Joystick8Button12 | The 13th button of the eighth game controller. |
| Joystick8Button13 | The 14th button of the eighth gamepad. |
| Joystick8Button14 | The 15th button on the eighth game controller. |
| Joystick8Button15 | The 16th button of the eighth gamepad. |
| Joystick8Button16 | The 17th button on the eighth game controller. |
| Joystick8Button17 | The 18th button on the eighth game controller. |
| Joystick8Button18 | The 19th button on the eighth game controller. |
| Joystick8Button19 | The 20th button of the eighth game controller. |
