<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGCharCode",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@T@CGCharCode"
  },
  "title" : "CGCharCode"
}
-->

# CGCharCode

Represents a character generated by pressing one or more keys on a keyboard.

```
typealias CGCharCode = UInt16
```

## Discussion

This data type represents a 16-bit character code. Values of this type may or may not correspond to UTF-16 character codes. See the function [`CGPostKeyboardEvent(_:_:_:)`](/documentation/CoreGraphics/CGPostKeyboardEvent(_:_:_:)).

---

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)