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

# CGEventMaskBit

Generates an event mask for a single type of event.

```
#define CGEventMaskBit(eventType)
```

## Parameters

`eventType`

An event type constant. Pass one of the constants listed in [`CGEventType`](/documentation/CoreGraphics/CGEventType).

## Return Value

An event mask that represents the specified event.

## Discussion

This macro converts an event type constant into a mask. You can use this mask to specify that an event tap should observe the event. For more information, see [`CGEventMask`](/documentation/CoreGraphics/CGEventMask).

---

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)