KeyCode

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

NameValueSummary
Unknown0

Blank value that represents no key being pressed.

Backspace8

The Backspace key.

Tab9

The Tab key.

Clear12

Only present on certain keyboards.

Return13

Frequently known as Enter.

Pause19

Only present on certain keyboards.

Escape27

The Escape key.

Space32

The Space key.

QuotedDouble34

The " key.

Hash35

The # key.

Dollar36

The $ key.

Percent37

The % key.

Ampersand38

The & key.

Quote39

The ' key.

LeftParenthesis40

The ( key.

RightParenthesis41

The ) key.

Asterisk42

The * key.

Plus43

The + key.

Comma44

The , key.

Minus45

The - key.

Period46

The . key.

Slash47

The / key.

Zero48

The 0 key.

One49

The 1 key.

Two50

The 2 key.

Three51

The 3 key.

Four52

The 4 key.

Five53

The 5 key.

Six54

The 6 key.

Seven55

The 7 key.

Eight56

The 8 key.

Nine57

The 9 key.

Colon58

The : key.

Semicolon59

The ; key.

LessThan60

The < key.

Equals61

The = key.

GreaterThan62

The > key.

Question63

The ? key.

At64

The @ key.

LeftBracket91

The [ key.

BackSlash92

The \ key.

RightBracket93

The ] key.

Caret94

The ^ key.

Underscore95

The _ key.

Backquote96

The ` key.

A97

The A key.

B98

The B key.

C99

The C key.

D100

The D key.

E101

The E key.

F102

The F key.

G103

The G key.

H104

The H key.

I105

The I key.

J106

The J key.

K107

The K key.

L108

The L key.

M109

The M key.

N110

The N key.

O111

The O key.

P112

The P key.

Q113

The Q key.

R114

The R key.

S115

The S key.

T116

The T key.

U117

The U key.

V118

The V key.

W119

The W key.

X120

The X key.

Y121

The Y key.

Z122

The Z key.

LeftCurly123

The { key.

Pipe124

The | key.

RightCurly125

The } key.

Tilde126

The ~ key.

Delete127

The Del key.

World0160
Deprecated
World1161
Deprecated
World2162
Deprecated
World3163
Deprecated
World4164
Deprecated
World5165
Deprecated
World6166
Deprecated
World7167
Deprecated
World8168
Deprecated
World9169
Deprecated
World10170
Deprecated
World11171
Deprecated
World12172
Deprecated
World13173
Deprecated
World14174
Deprecated
World15175
Deprecated
World16176
Deprecated
World17177
Deprecated
World18178
Deprecated
World19179
Deprecated
World20180
Deprecated
World21181
Deprecated
World22182
Deprecated
World23183
Deprecated
World24184
Deprecated
World25185
Deprecated
World26186
Deprecated
World27187
Deprecated
World28188
Deprecated
World29189
Deprecated
World30190
Deprecated
World31191
Deprecated
World32192
Deprecated
World33193
Deprecated
World34194
Deprecated
World35195
Deprecated
World36196
Deprecated
World37197
Deprecated
World38198
Deprecated
World39199
Deprecated
World40200
Deprecated
World41201
Deprecated
World42202
Deprecated
World43203
Deprecated
World44204
Deprecated
World45205
Deprecated
World46206
Deprecated
World47207
Deprecated
World48208
Deprecated
World49209
Deprecated
World50210
Deprecated
World51211
Deprecated
World52212
Deprecated
World53213
Deprecated
World54214
Deprecated
World55215
Deprecated
World56216
Deprecated
World57217
Deprecated
World58218
Deprecated
World59219
Deprecated
World60220
Deprecated
World61221
Deprecated
World62222
Deprecated
World63223
Deprecated
World64224
Deprecated
World65225
Deprecated
World66226
Deprecated
World67227
Deprecated
World68228
Deprecated
World69229
Deprecated
World70230
Deprecated
World71231
Deprecated
World72232
Deprecated
World73233
Deprecated
World74234
Deprecated
World75235
Deprecated
World76236
Deprecated
World77237
Deprecated
World78238
Deprecated
World79239
Deprecated
World80240
Deprecated
World81241
Deprecated
World82242
Deprecated
World83243
Deprecated
World84244
Deprecated
World85245
Deprecated
World86246
Deprecated
World87247
Deprecated
World88248
Deprecated
World89249
Deprecated
World90250
Deprecated
World91251
Deprecated
World92252
Deprecated
World93253
Deprecated
World94254
Deprecated
World95255
Deprecated
KeypadZero256

The 0 key on the keypad cluster.

KeypadOne257

The 1 key on the keypad cluster.

KeypadTwo258

The 2 key on the keypad cluster.

KeypadThree259

The 3 key on the keypad cluster.

KeypadFour260

The 4 key on the keypad cluster.

KeypadFive261

The 5 key on the keypad cluster.

KeypadSix262

The 6 key on the keypad cluster.

KeypadSeven263

The 7 key on the keypad cluster.

KeypadEight264

The 8 key on the keypad cluster.

KeypadNine265

The 9 key on the keypad cluster.

KeypadPeriod266

The . key on the keypad cluster.

KeypadDivide267

The / key on the keypad cluster.

KeypadMultiply268

The * key on the keypad cluster.

KeypadMinus269

The - key on the keypad cluster.

KeypadPlus270

The + key on the keypad cluster.

KeypadEnter271

The Enter key on the keypad cluster.

KeypadEquals272

The = key on the keypad cluster.

Up273

The arrow key.

Down274

The arrow key.

Right275

The arrow key.

Left276

The arrow key.

Insert277

The Insert key.

Home278

The Home key.

End279

The End key.

PageUp280

The PgUp key.

PageDown281

The PgDown key.

F1282

The F1 key.

F2283

The F2 key.

F3284

The F3 key.

F4285

The F4 key.

F5286

The F5 key.

F6287

The F6 key.

F7288

The F7 key.

F8289

The F8 key.

F9290

The F9 key.

F10291

The F10 key.

F11292

The F11 key.

F12293

The F12 key.

F13294

The F13 key. Only present on certain keyboards.

F14295

The F14 key. Only present on certain keyboards.

F15296

The F15 key. Only present on certain keyboards.

NumLock300

The Num Lock key on the keypad cluster.

CapsLock301

The Caps Lock key.

ScrollLock302

The Scr Lock key.

RightShift303

The right side Shift key.

LeftShift304

The left side Shift key.

RightControl305

The right side Ctrl key.

LeftControl306

The left side Ctrl key.

RightAlt307

The right side Alt key.

LeftAlt308

The left side Alt key.

RightMeta309

The right side Meta key.

LeftMeta310

The left side Meta key.

LeftSuper311

The left side Super key. Better known as the Windows key or Cmd key.

RightSuper312

The right side Super key. Better known as the Windows key or Cmd key.

Mode313

Only present on certain keyboards.

Compose314

Only present on certain keyboards.

Help315

Only present on certain keyboards.

Print316

Only present on certain keyboards.

SysReq317

Only present on certain keyboards.

Break318

Only present on certain keyboards.

Menu319

The Menu key.

Power320

Only present on certain keyboards.

Euro321

The key. Only present on certain keyboards.

Undo322

Only present on certain keyboards.

ButtonX1000

Gamepad X button.

ButtonY1001

Gamepad Y button.

ButtonA1002

Gamepad A button.

ButtonB1003

Gamepad B button.

ButtonR11004

Gamepad R1 button.

ButtonL11005

Gamepad L1 button.

ButtonR21006

Gamepad R2 button.

ButtonL21007

Gamepad L2 button.

ButtonR31008

Gamepad R3 button.

ButtonL31009

Gamepad L3 button.

ButtonStart1010

Gamepad Start button.

ButtonSelect1011

Gamepad Select button.

DPadLeft1012

Left arrow on a gamepad D-pad.

DPadRight1013

Right arrow on a gamepad D-pad.

DPadUp1014

Up arrow on a gamepad D-pad.

DPadDown1015

Down arrow on a gamepad D-pad.

Thumbstick11016

Gamepad primary thumbstick.

Thumbstick21017

Gamepad secondary thumbstick.

MouseLeftButton1018
Deprecated
MouseRightButton1019
Deprecated
MouseMiddleButton1020
Deprecated
MouseBackButton1021
Deprecated
MouseNoButton1022
Deprecated
MouseX1023
Deprecated
MouseY1024
Deprecated

On this page