<!--
{
  "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

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

The keyboard code for the a or A character.

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

The keyboard code for the b or B character.

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

The keyboard code for the c or C character.

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

The keyboard code for the d or D character.

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

The keyboard code for the e or E character.

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

The keyboard code for the f or F character.

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

The keyboard code for the g or G character.

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

The keyboard code for the h or H character.

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

The keyboard code for the i or I character.

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

The keyboard code for the j or J character.

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

The keyboard code for the k or K character.

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

The keyboard code for the l or L character.

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

The keyboard code for the m or M character.

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

The keyboard code for the n or N character.

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

The keyboard code for the o or O character.

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

The keyboard code for the p or P character.

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

The keyboard code for the q or Q character.

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

The keyboard code for the r or R character.

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

The keyboard code for the s or S character.

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

The keyboard code for the t or T character.

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

The keyboard code for the u or U character.

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

The keyboard code for the v or V character.

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

The keyboard code for the w or W character.

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

The keyboard code for the x or X character.

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

The keyboard code for the y or Y character.

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

The keyboard code for the z or Z character.

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

The keyboard code for the 1 or ! character.

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

The keyboard code for the 2 or @ character.

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

The keyboard code for the 3 or # character.

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

The keyboard code for the 4 or $ character.

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

The keyboard code for the 5 or % character.

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

The keyboard code for the 6 or ^ character.

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

The keyboard code for the 7 or & character.

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

The keyboard code for the 8 or * character.

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

The keyboard code for the 9 or ( character.

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

The keyboard code for the 0 or ) character.

### Punctuation and Command Keys

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

The keyboard code for the Tab key.

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

The keyboard code for the Space Bar key.

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

The keyboard code for the - or _ key.

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

The keyboard code for the = or + key.

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

The keyboard code for the [ or { key.

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

The keyboard code for the ] or } key.

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

The keyboard code for the \ or | key.

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

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

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

The keyboard code for the ; or : key.

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

The keyboard code for the ’ or “ key.

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

The keyboard code for the Grave Accent or Tilde key.

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

The keyboard code for the Comma or < key.

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

The keyboard code for the Period or > key.

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

The keyboard code for the / or ? key.

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

The keyboard code for the Caps Lock key.

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

The keyboard code for the Delete or Backspace key.

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

The keyboard code for the Escape key.

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

The keyboard code for the Return or Enter key.

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

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

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

The keyboard code for the Application key.

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

The keyboard code for the Power key.

### Function Keys

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

The keyboard code for the F1 key.

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

The keyboard code for the F2 key.

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

The keyboard code for the F3 key.

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

The keyboard code for the F4 key.

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

The keyboard code for the F5 key.

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

The keyboard code for the F6 key.

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

The keyboard code for the F7 key.

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

The keyboard code for the F8 key.

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

The keyboard code for the F9 key.

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

The keyboard code for the F10 key.

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

The keyboard code for the F11 key.

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

The keyboard code for the F12 key.

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

The keyboard code for the F13 key.

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

The keyboard code for the F14 key.

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

The keyboard code for the F15 key.

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

The keyboard code for the F16 key.

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

The keyboard code for the F17 key.

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

The keyboard code for the F18 key.

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

The keyboard code for the F19 key.

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

The keyboard code for the F20 key.

### Directional and Similar Keys

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

The keyboard code for the Print Screen key.

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

The keyboard code for the Scroll Lock key.

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

The keyboard code for the Pause key.

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

The keyboard code for the Insert key.

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

The keyboard code for the Home key.

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

The keyboard code for the Page Up key.

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

The keyboard code for the Delete-Forward key.

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

The keyboard code for the End key.

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

The keyboard code for the Page Down key.

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

The keyboard code for the Right Arrow key.

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

The keyboard code for the Left Arrow key.

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

The keyboard code for the Down Arrow key.

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

The keyboard code for the Up Arrow key.

### Keypad Keys

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

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

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

The keyboard code for the keypad / key.

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

The keyboard code for the keypad * key.

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

The keyboard code for the keypad - key.

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

The keyboard code for the keypad + key.

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

The keyboard code for the keypad Enter key.

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

The keyboard code for the keypad 1 or End key.

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

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

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

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

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

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

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

The keyboard code for the keypad 5 key.

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

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

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

The keyboard code for the keypad 7 or Home key.

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

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

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

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

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

The keyboard code for the keypad 0 or Insert key.

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

The keyboard code for the keypad Period or Delete key.

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

The keyboard code for the keypad = key.

### International Keys

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

The keyboard code for the first international key.

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

The keyboard code for the second international key.

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

The keyboard code for the third international key.

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

The keyboard code for the fourth international key.

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

The keyboard code for the fifth international key.

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

The keyboard code for the sixth international key.

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

The keyboard code for the seventh international key.

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

The keyboard code for the eighth international key.

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

The keyboard code for the ninth international key.

### Language Keys

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

The keyboard code for the first language key.

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

The keyboard code for the second language key.

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

The keyboard code for the third language key.

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

The keyboard code for the fourth language key.

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

The keyboard code for the fifth language key.

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

The keyboard code for the sixth language key.

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

The keyboard code for the seventh language key.

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

The keyboard code for the eighth language key.

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

The keyboard code for the ninth language key.

### Left- and Right-Side Keys

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[`GCKeyCodeRightGUI`](/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.

## Relationships

### Conforms To

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Equatable`](/documentation/Swift/Equatable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)