Roblox UtilitiesDevlHub Roblox Documentation

Enum

KeyCode

Byte keycodes that represent the key or button involved in user input.

The KeyCode enum contains a list of byte keycodes that represent the key or button involved in user input. This enum also includes buttons and axes present on gamepads, and 96 World[] values for non-standard buttons.

Note that keyboard values refer to the physical position of buttons on a standard QWERTY keyboard. Provided the user's system is configured correctly, the location of keys (such as WASD) will remain the same on other keyboard types such as Dvorak keyboards where it would map to ,AOE.

See also InputObject, used for keyboard and gamepad input.

Items 283#

NameValueSummary
None0
Backspace8The Backspace key.
Tab9The Tab key.
Clear12Only present on certain keyboards.
Return13Frequently known as Enter.
Pause19Only present on certain keyboards.
Escape27The Escape key.
Space32The Space key.
QuotedDouble34The " key.
Hash35The # key.
Dollar36The $ key.
Percent37The % key.
Ampersand38The & key.
Quote39The ' key.
LeftParenthesis40The ( key.
RightParenthesis41The ) key.
Asterisk42The * key.
Plus43The + key.
Comma44The , key.
Minus45The - key.
Period46The . key.
Slash47The / key.
Zero48The 0 key.
One49The 1 key.
Two50The 2 key.
Three51The 3 key.
Four52The 4 key.
Five53The 5 key.
Six54The 6 key.
Seven55The 7 key.
Eight56The 8 key.
Nine57The 9 key.
Colon58The : key.
Semicolon59The ; key.
LessThan60The < key.
Equals61The = key.
GreaterThan62The > key.
Question63The ? key.
At64The @ key.
LeftBracket91The [ key.
BackSlash92The \ key.
RightBracket93The ] key.
Caret94The ^ key.
Underscore95The _ key.
Backquote96The ` key.
A97The A key.
B98The B key.
C99The C key.
D100The D key.
E101The E key.
F102The F key.
G103The G key.
H104The H key.
I105The I key.
J106The J key.
K107The K key.
L108The L key.
M109The M key.
N110The N key.
O111The O key.
P112The P key.
Q113The Q key.
R114The R key.
S115The S key.
T116The T key.
U117The U key.
V118The V key.
W119The W key.
X120The X key.
Y121The Y key.
Z122The Z key.
LeftCurly123The { key.
Pipe124The | key.
RightCurly125The } key.
Tilde126The ~ key.
Delete127The Del key.
World0160DeprecatedDeprecated
World1161DeprecatedDeprecated
World2162DeprecatedDeprecated
World3163DeprecatedDeprecated
World4164DeprecatedDeprecated
World5165DeprecatedDeprecated
World6166DeprecatedDeprecated
World7167DeprecatedDeprecated
World8168DeprecatedDeprecated
World9169DeprecatedDeprecated
World10170DeprecatedDeprecated
World11171DeprecatedDeprecated
World12172DeprecatedDeprecated
World13173DeprecatedDeprecated
World14174DeprecatedDeprecated
World15175DeprecatedDeprecated
World16176DeprecatedDeprecated
World17177DeprecatedDeprecated
World18178DeprecatedDeprecated
World19179DeprecatedDeprecated
World20180DeprecatedDeprecated
World21181DeprecatedDeprecated
World22182DeprecatedDeprecated
World23183DeprecatedDeprecated
World24184DeprecatedDeprecated
World25185DeprecatedDeprecated
World26186DeprecatedDeprecated
World27187DeprecatedDeprecated
World28188DeprecatedDeprecated
World29189DeprecatedDeprecated
World30190DeprecatedDeprecated
World31191DeprecatedDeprecated
World32192DeprecatedDeprecated
World33193DeprecatedDeprecated
World34194DeprecatedDeprecated
World35195DeprecatedDeprecated
World36196DeprecatedDeprecated
World37197DeprecatedDeprecated
World38198DeprecatedDeprecated
World39199DeprecatedDeprecated
World40200DeprecatedDeprecated
World41201DeprecatedDeprecated
World42202DeprecatedDeprecated
World43203DeprecatedDeprecated
World44204DeprecatedDeprecated
World45205DeprecatedDeprecated
World46206DeprecatedDeprecated
World47207DeprecatedDeprecated
World48208DeprecatedDeprecated
World49209DeprecatedDeprecated
World50210DeprecatedDeprecated
World51211DeprecatedDeprecated
World52212DeprecatedDeprecated
World53213DeprecatedDeprecated
World54214DeprecatedDeprecated
World55215DeprecatedDeprecated
World56216DeprecatedDeprecated
World57217DeprecatedDeprecated
World58218DeprecatedDeprecated
World59219DeprecatedDeprecated
World60220DeprecatedDeprecated
World61221DeprecatedDeprecated
World62222DeprecatedDeprecated
World63223DeprecatedDeprecated
World64224DeprecatedDeprecated
World65225DeprecatedDeprecated
World66226DeprecatedDeprecated
World67227DeprecatedDeprecated
World68228DeprecatedDeprecated
World69229DeprecatedDeprecated
World70230DeprecatedDeprecated
World71231DeprecatedDeprecated
World72232DeprecatedDeprecated
World73233DeprecatedDeprecated
World74234DeprecatedDeprecated
World75235DeprecatedDeprecated
World76236DeprecatedDeprecated
World77237DeprecatedDeprecated
World78238DeprecatedDeprecated
World79239DeprecatedDeprecated
World80240DeprecatedDeprecated
World81241DeprecatedDeprecated
World82242DeprecatedDeprecated
World83243DeprecatedDeprecated
World84244DeprecatedDeprecated
World85245DeprecatedDeprecated
World86246DeprecatedDeprecated
World87247DeprecatedDeprecated
World88248DeprecatedDeprecated
World89249DeprecatedDeprecated
World90250DeprecatedDeprecated
World91251DeprecatedDeprecated
World92252DeprecatedDeprecated
World93253DeprecatedDeprecated
World94254DeprecatedDeprecated
World95255DeprecatedDeprecated
KeypadZero256The 0 key on the keypad cluster.
KeypadOne257The 1 key on the keypad cluster.
KeypadTwo258The 2 key on the keypad cluster.
KeypadThree259The 3 key on the keypad cluster.
KeypadFour260The 4 key on the keypad cluster.
KeypadFive261The 5 key on the keypad cluster.
KeypadSix262The 6 key on the keypad cluster.
KeypadSeven263The 7 key on the keypad cluster.
KeypadEight264The 8 key on the keypad cluster.
KeypadNine265The 9 key on the keypad cluster.
KeypadPeriod266The . key on the keypad cluster.
KeypadDivide267The / key on the keypad cluster.
KeypadMultiply268The * key on the keypad cluster.
KeypadMinus269The - key on the keypad cluster.
KeypadPlus270The + key on the keypad cluster.
KeypadEnter271The Enter key on the keypad cluster.
KeypadEquals272The = key on the keypad cluster.
Up273The ↑ arrow key.
Down274The ↓ arrow key.
Left276The ← arrow key.
Insert277The Insert key.
Home278The Home key.
End279The End key.
PageUp280The PgUp key.
PageDown281The PgDown key.
F1282The F1 key.
F2283The F2 key.
F3284The F3 key.
F4285The F4 key.
F5286The F5 key.
F6287The F6 key.
F7288The F7 key.
F8289The F8 key.
F9290The F9 key.
F10291The F10 key.
F11292The F11 key.
F12293The F12 key.
F13294The F13 key. Only present on certain keyboards.
F14295The F14 key. Only present on certain keyboards.
F15296The F15 key. Only present on certain keyboards.
NumLock300The Num Lock key on the keypad cluster.
CapsLock301The Caps Lock key.
ScrollLock302The Scr Lock key.
RightShift303The right side Shift key.
LeftShift304The left side Shift key.
RightControl305The right side Ctrl key.
LeftControl306The left side Ctrl key.
RightAlt307The right side Alt key.
LeftAlt308The left side Alt key.
RightMeta309The right side Meta key.
LeftMeta310The left side Meta key.
LeftSuper311The left side Super key. Better known as the Windows key or Cmd key.
RightSuper312The right side Super key. Better known as the Windows key or Cmd key.
Mode313Only present on certain keyboards.
Compose314Only present on certain keyboards.
Help315Only present on certain keyboards.
Print316Only present on certain keyboards.
SysReq317Only present on certain keyboards.
Break318Only present on certain keyboards.
Power320Only present on certain keyboards.
Euro321The € key. Only present on certain keyboards.
Undo322Only present on certain keyboards.
ButtonX1000Gamepad X button.
ButtonY1001Gamepad Y button.
ButtonA1002Gamepad A button.
ButtonB1003Gamepad B button.
ButtonR11004Gamepad R1 button.
ButtonL11005Gamepad L1 button.
ButtonR21006Gamepad R2 button.
ButtonL21007Gamepad L2 button.
ButtonR31008Gamepad R3 button.
ButtonL31009Gamepad L3 button.
ButtonStart1010Gamepad Start button.
ButtonSelect1011Gamepad Select button.
DPadLeft1012Left arrow on a gamepad D-pad.
DPadRight1013Right arrow on a gamepad D-pad.
DPadUp1014Up arrow on a gamepad D-pad.
DPadDown1015Down arrow on a gamepad D-pad.
Thumbstick11016Gamepad primary thumbstick.
Thumbstick21017Gamepad secondary thumbstick.
Thumbstick1Up1018Up vector on the gamepad primary thumbstick. Primarily used in the Input Action System.
Thumbstick1Down1019Down vector on the gamepad primary thumbstick. Primarily used in the Input Action System.
Thumbstick1Left1020Left vector on the gamepad primary thumbstick. Primarily used in the Input Action System.
Thumbstick1Right1021Right vector on the gamepad primary thumbstick. Primarily used in the Input Action System.
Thumbstick2Up1022Up vector on the gamepad secondary thumbstick. Primarily used in the Input Action System.
Thumbstick2Down1023Down vector on the gamepad secondary thumbstick. Primarily used in the Input Action System.
Thumbstick2Left1024Left vector on the gamepad secondary thumbstick. Primarily used in the Input Action System.
Thumbstick2Right1025Right vector on the gamepad secondary thumbstick. Primarily used in the Input Action System.
MouseLeftButton1026The left mouse button, also commonly referred to as "button 1" on a generic mouse. Primarily used in the Input Action System.
MouseRightButton1027The right mouse button, also commonly referred to as "button 2" on a generic mouse. Primarily used in the Input Action System.
MouseMiddleButton1028The middle mouse button, also commonly referred to as "button 3" on a generic mouse. Primarily used in the Input Action System.
MouseBackButton1029DeprecatedDeprecated
MouseNoButton1030DeprecatedDeprecated
MouseX1031DeprecatedDeprecated
MouseY1032DeprecatedDeprecated
MousePosition1033The position of a mouse in the viewport. Primarily used in the Input Action System.
TouchPosition1034The position of a touch in the viewport. Primarily used in the Input Action System.
MouseWheel1035The scroll delta (change) of a mouse wheel. Primarily used in the Input Action System.
TrackpadPan1040The pan delta (change) from a trackpad two-finger pan gesture. Primarily used in the Input Action System.
TrackpadPinch1045The scale delta (change) from a trackpad two-finger pinch gesture. Primarily used in the Input Action System.
MouseDelta1048The movement delta (change) of the mouse cursor. Primarily used in the Input Action System.
TouchDelta1049The movement delta (change) of a touch input. Primarily used in the Input Action System.
TouchPinch1050The scale delta (change) of a two-finger touch pinch gesture. Primarily used in the Input Action System.
ButtonCenter1051TV remote Center button.
ButtonBack1052TV remote Back button.
ButtonUp1053MicroGamepad (including TV remotes) Up directional button.
ButtonDown1054MicroGamepad (including TV remotes) Down directional button.
ButtonLeft1055MicroGamepad (including TV remotes) Left directional button.
ButtonRight1056MicroGamepad (including TV remotes) Right directional button.