<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/GCKeyCode",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:@T@GCKeyCode"
  },
  "title" : "GCKeyCode"
}
-->

# GCKeyCode

The key codes for keys on a keyboard.

```
struct GCKeyCode
```

## Topics

### Letter and Number Keys

[`keyA`](/documentation/GameController/GCKeyCode/keyA)

The keyboard code for the a or A character.

[`keyB`](/documentation/GameController/GCKeyCode/keyB)

The keyboard code for the b or B character.

[`keyC`](/documentation/GameController/GCKeyCode/keyC)

The keyboard code for the c or C character.

[`keyD`](/documentation/GameController/GCKeyCode/keyD)

The keyboard code for the d or D character.

[`keyE`](/documentation/GameController/GCKeyCode/keyE)

The keyboard code for the e or E character.

[`keyF`](/documentation/GameController/GCKeyCode/keyF)

The keyboard code for the f or F character.

[`keyG`](/documentation/GameController/GCKeyCode/keyG)

The keyboard code for the g or G character.

[`keyH`](/documentation/GameController/GCKeyCode/keyH)

The keyboard code for the h or H character.

[`keyI`](/documentation/GameController/GCKeyCode/keyI)

The keyboard code for the i or I character.

[`keyJ`](/documentation/GameController/GCKeyCode/keyJ)

The keyboard code for the j or J character.

[`keyK`](/documentation/GameController/GCKeyCode/keyK)

The keyboard code for the k or K character.

[`keyL`](/documentation/GameController/GCKeyCode/keyL)

The keyboard code for the l or L character.

[`keyM`](/documentation/GameController/GCKeyCode/keyM)

The keyboard code for the m or M character.

[`keyN`](/documentation/GameController/GCKeyCode/keyN)

The keyboard code for the n or N character.

[`keyO`](/documentation/GameController/GCKeyCode/keyO)

The keyboard code for the o or O character.

[`keyP`](/documentation/GameController/GCKeyCode/keyP)

The keyboard code for the p or P character.

[`keyQ`](/documentation/GameController/GCKeyCode/keyQ)

The keyboard code for the q or Q character.

[`keyR`](/documentation/GameController/GCKeyCode/keyR)

The keyboard code for the r or R character.

[`keyS`](/documentation/GameController/GCKeyCode/keyS)

The keyboard code for the s or S character.

[`keyT`](/documentation/GameController/GCKeyCode/keyT)

The keyboard code for the t or T character.

[`keyU`](/documentation/GameController/GCKeyCode/keyU)

The keyboard code for the u or U character.

[`keyV`](/documentation/GameController/GCKeyCode/keyV)

The keyboard code for the v or V character.

[`keyW`](/documentation/GameController/GCKeyCode/keyW)

The keyboard code for the w or W character.

[`keyX`](/documentation/GameController/GCKeyCode/keyX)

The keyboard code for the x or X character.

[`keyY`](/documentation/GameController/GCKeyCode/keyY)

The keyboard code for the y or Y character.

[`keyZ`](/documentation/GameController/GCKeyCode/keyZ)

The keyboard code for the z or Z character.

[`one`](/documentation/GameController/GCKeyCode/one)

The keyboard code for the 1 or ! character.

[`two`](/documentation/GameController/GCKeyCode/two)

The keyboard code for the 2 or @ character.

[`three`](/documentation/GameController/GCKeyCode/three)

The keyboard code for the 3 or # character.

[`four`](/documentation/GameController/GCKeyCode/four)

The keyboard code for the 4 or $ character.

[`five`](/documentation/GameController/GCKeyCode/five)

The keyboard code for the 5 or % character.

[`six`](/documentation/GameController/GCKeyCode/six)

The keyboard code for the 6 or ^ character.

[`seven`](/documentation/GameController/GCKeyCode/seven)

The keyboard code for the 7 or & character.

[`eight`](/documentation/GameController/GCKeyCode/eight)

The keyboard code for the 8 or * character.

[`nine`](/documentation/GameController/GCKeyCode/nine)

The keyboard code for the 9 or ( character.

[`zero`](/documentation/GameController/GCKeyCode/zero)

The keyboard code for the 0 or ) character.

### Punctuation and Command Keys

[`tab`](/documentation/GameController/GCKeyCode/tab)

The keyboard code for the Tab key.

[`spacebar`](/documentation/GameController/GCKeyCode/spacebar)

The keyboard code for the Space Bar key.

[`hyphen`](/documentation/GameController/GCKeyCode/hyphen)

The keyboard code for the - or _ key.

[`equalSign`](/documentation/GameController/GCKeyCode/equalSign)

The keyboard code for the = or + key.

[`openBracket`](/documentation/GameController/GCKeyCode/openBracket)

The keyboard code for the [ or { key.

[`closeBracket`](/documentation/GameController/GCKeyCode/closeBracket)

The keyboard code for the ] or } key.

[`backslash`](/documentation/GameController/GCKeyCode/backslash)

The keyboard code for the \ or | key.

[`nonUSPound`](/documentation/GameController/GCKeyCode/nonUSPound)

The keyboard code for the non-US Pound or _ key.

[`semicolon`](/documentation/GameController/GCKeyCode/semicolon)

The keyboard code for the ; or : key.

[`quote`](/documentation/GameController/GCKeyCode/quote)

The keyboard code for the ’ or “ key.

[`graveAccentAndTilde`](/documentation/GameController/GCKeyCode/graveAccentAndTilde)

The keyboard code for the Grave Accent or Tilde key.

[`comma`](/documentation/GameController/GCKeyCode/comma)

The keyboard code for the Comma or < key.

[`period`](/documentation/GameController/GCKeyCode/period)

The keyboard code for the Period or > key.

[`slash`](/documentation/GameController/GCKeyCode/slash)

The keyboard code for the / or ? key.

[`capsLock`](/documentation/GameController/GCKeyCode/capsLock)

The keyboard code for the Caps Lock key.

[`deleteOrBackspace`](/documentation/GameController/GCKeyCode/deleteOrBackspace)

The keyboard code for the Delete or Backspace key.

[`escape`](/documentation/GameController/GCKeyCode/escape)

The keyboard code for the Escape key.

[`returnOrEnter`](/documentation/GameController/GCKeyCode/returnOrEnter)

The keyboard code for the Return or Enter key.

[`nonUSBackslash`](/documentation/GameController/GCKeyCode/nonUSBackslash)

The keyboard code for the non-US Slash or | key.

[`application`](/documentation/GameController/GCKeyCode/application)

The keyboard code for the Application key.

[`power`](/documentation/GameController/GCKeyCode/power)

The keyboard code for the Power key.

### Function Keys

[`F1`](/documentation/GameController/GCKeyCode/F1)

The keyboard code for the F1 key.

[`F2`](/documentation/GameController/GCKeyCode/F2)

The keyboard code for the F2 key.

[`F3`](/documentation/GameController/GCKeyCode/F3)

The keyboard code for the F3 key.

[`F4`](/documentation/GameController/GCKeyCode/F4)

The keyboard code for the F4 key.

[`F5`](/documentation/GameController/GCKeyCode/F5)

The keyboard code for the F5 key.

[`F6`](/documentation/GameController/GCKeyCode/F6)

The keyboard code for the F6 key.

[`F7`](/documentation/GameController/GCKeyCode/F7)

The keyboard code for the F7 key.

[`F8`](/documentation/GameController/GCKeyCode/F8)

The keyboard code for the F8 key.

[`F9`](/documentation/GameController/GCKeyCode/F9)

The keyboard code for the F9 key.

[`F10`](/documentation/GameController/GCKeyCode/F10)

The keyboard code for the F10 key.

[`F11`](/documentation/GameController/GCKeyCode/F11)

The keyboard code for the F11 key.

[`F12`](/documentation/GameController/GCKeyCode/F12)

The keyboard code for the F12 key.

[`F13`](/documentation/GameController/GCKeyCode/F13)

The keyboard code for the F13 key.

[`F14`](/documentation/GameController/GCKeyCode/F14)

The keyboard code for the F14 key.

[`F15`](/documentation/GameController/GCKeyCode/F15)

The keyboard code for the F15 key.

[`F16`](/documentation/GameController/GCKeyCode/F16)

The keyboard code for the F16 key.

[`F17`](/documentation/GameController/GCKeyCode/F17)

The keyboard code for the F17 key.

[`F18`](/documentation/GameController/GCKeyCode/F18)

The keyboard code for the F18 key.

[`F19`](/documentation/GameController/GCKeyCode/F19)

The keyboard code for the F19 key.

[`F20`](/documentation/GameController/GCKeyCode/F20)

The keyboard code for the F20 key.

### Directional and Similar Keys

[`printScreen`](/documentation/GameController/GCKeyCode/printScreen)

The keyboard code for the Print Screen key.

[`scrollLock`](/documentation/GameController/GCKeyCode/scrollLock)

The keyboard code for the Scroll Lock key.

[`pause`](/documentation/GameController/GCKeyCode/pause)

The keyboard code for the Pause key.

[`insert`](/documentation/GameController/GCKeyCode/insert)

The keyboard code for the Insert key.

[`home`](/documentation/GameController/GCKeyCode/home)

The keyboard code for the Home key.

[`pageUp`](/documentation/GameController/GCKeyCode/pageUp)

The keyboard code for the Page Up key.

[`deleteForward`](/documentation/GameController/GCKeyCode/deleteForward)

The keyboard code for the Delete-Forward key.

[`end`](/documentation/GameController/GCKeyCode/end)

The keyboard code for the End key.

[`pageDown`](/documentation/GameController/GCKeyCode/pageDown)

The keyboard code for the Page Down key.

[`rightArrow`](/documentation/GameController/GCKeyCode/rightArrow)

The keyboard code for the Right Arrow key.

[`leftArrow`](/documentation/GameController/GCKeyCode/leftArrow)

The keyboard code for the Left Arrow key.

[`downArrow`](/documentation/GameController/GCKeyCode/downArrow)

The keyboard code for the Down Arrow key.

[`upArrow`](/documentation/GameController/GCKeyCode/upArrow)

The keyboard code for the Up Arrow key.

### Keypad Keys

[`keypadNumLock`](/documentation/GameController/GCKeyCode/keypadNumLock)

The keyboard code for the keypad Num Lock or Clear key.

[`keypadSlash`](/documentation/GameController/GCKeyCode/keypadSlash)

The keyboard code for the keypad / key.

[`keypadAsterisk`](/documentation/GameController/GCKeyCode/keypadAsterisk)

The keyboard code for the keypad * key.

[`keypadHyphen`](/documentation/GameController/GCKeyCode/keypadHyphen)

The keyboard code for the keypad - key.

[`keypadPlus`](/documentation/GameController/GCKeyCode/keypadPlus)

The keyboard code for the keypad + key.

[`keypadEnter`](/documentation/GameController/GCKeyCode/keypadEnter)

The keyboard code for the keypad Enter key.

[`keypad1`](/documentation/GameController/GCKeyCode/keypad1)

The keyboard code for the keypad 1 or End key.

[`keypad2`](/documentation/GameController/GCKeyCode/keypad2)

The keyboard code for the keypad 2 or Down Arrow key.

[`keypad3`](/documentation/GameController/GCKeyCode/keypad3)

The keyboard code for the keypad 3 or Page Down key.

[`keypad4`](/documentation/GameController/GCKeyCode/keypad4)

The keyboard code for the keypad 4 or Left Arrow key.

[`keypad5`](/documentation/GameController/GCKeyCode/keypad5)

The keyboard code for the keypad 5 key.

[`keypad6`](/documentation/GameController/GCKeyCode/keypad6)

The keyboard code for the keypad 6 or Right Arrow key.

[`keypad7`](/documentation/GameController/GCKeyCode/keypad7)

The keyboard code for the keypad 7 or Home key.

[`keypad8`](/documentation/GameController/GCKeyCode/keypad8)

The keyboard code for the keypad 8 or Up Arrow key.

[`keypad9`](/documentation/GameController/GCKeyCode/keypad9)

The keyboard code for the keypad 9 or Page Up key.

[`keypad0`](/documentation/GameController/GCKeyCode/keypad0)

The keyboard code for the keypad 0 or Insert key.

[`keypadPeriod`](/documentation/GameController/GCKeyCode/keypadPeriod)

The keyboard code for the keypad Period or Delete key.

[`keypadEqualSign`](/documentation/GameController/GCKeyCode/keypadEqualSign)

The keyboard code for the keypad = key.

### International Keys

[`international1`](/documentation/GameController/GCKeyCode/international1)

The keyboard code for the first international key.

[`international2`](/documentation/GameController/GCKeyCode/international2)

The keyboard code for the second international key.

[`international3`](/documentation/GameController/GCKeyCode/international3)

The keyboard code for the third international key.

[`international4`](/documentation/GameController/GCKeyCode/international4)

The keyboard code for the fourth international key.

[`international5`](/documentation/GameController/GCKeyCode/international5)

The keyboard code for the fifth international key.

[`international6`](/documentation/GameController/GCKeyCode/international6)

The keyboard code for the sixth international key.

[`international7`](/documentation/GameController/GCKeyCode/international7)

The keyboard code for the seventh international key.

[`international8`](/documentation/GameController/GCKeyCode/international8)

The keyboard code for the eighth international key.

[`international9`](/documentation/GameController/GCKeyCode/international9)

The keyboard code for the ninth international key.

### Language Keys

[`LANG1`](/documentation/GameController/GCKeyCode/LANG1)

The keyboard code for the first language key.

[`LANG2`](/documentation/GameController/GCKeyCode/LANG2)

The keyboard code for the second language key.

[`LANG3`](/documentation/GameController/GCKeyCode/LANG3)

The keyboard code for the third language key.

[`LANG4`](/documentation/GameController/GCKeyCode/LANG4)

The keyboard code for the fourth language key.

[`LANG5`](/documentation/GameController/GCKeyCode/LANG5)

The keyboard code for the fifth language key.

[`LANG6`](/documentation/GameController/GCKeyCode/LANG6)

The keyboard code for the sixth language key.

[`LANG7`](/documentation/GameController/GCKeyCode/LANG7)

The keyboard code for the seventh language key.

[`LANG8`](/documentation/GameController/GCKeyCode/LANG8)

The keyboard code for the eighth language key.

[`LANG9`](/documentation/GameController/GCKeyCode/LANG9)

The keyboard code for the ninth language key.

### Left- and Right-Side Keys

[`leftControl`](/documentation/GameController/GCKeyCode/leftControl)

The keyboard code for the Control key on the left side of the keyboard.

[`leftShift`](/documentation/GameController/GCKeyCode/leftShift)

The keyboard code for the Shift key on the left side of the keyboard.

[`leftAlt`](/documentation/GameController/GCKeyCode/leftAlt)

The keyboard code for the Option or Alt key on the left side of the keyboard.

[`leftGUI`](/documentation/GameController/GCKeyCode/leftGUI)

The keyboard code for the Command key on the left side of the keyboard.

[`rightControl`](/documentation/GameController/GCKeyCode/rightControl)

The keyboard code for the Control key on the right side of the keyboard.

[`rightShift`](/documentation/GameController/GCKeyCode/rightShift)

The keyboard code for the Shift key on the right side of the keyboard.

[`rightAlt`](/documentation/GameController/GCKeyCode/rightAlt)

The keyboard code for the Option or Alt key on the right side of the keyboard.

[`rightGUI`](/documentation/GameController/GCKeyCode/rightGUI)

The keyboard code for the Command key on the right side of the keyboard.

### Initializers

[`init(rawValue:)`](/documentation/GameController/GCKeyCode/init(rawValue:))

Creates a key code with a string value.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)