---
title: CGEventMask
framework: coregraphics
role: symbol
role_heading: Type Alias
path: coregraphics/cgeventmask
---

# CGEventMask

Defines a mask that identifies the set of Quartz events to be observed in an event tap.

## Declaration

```swift
typealias CGEventMask = UInt64
```

## Discussion

Discussion When you call either tapCreate(tap:place:options:eventsOfInterest:callback:userInfo:) or tapCreateForPSN(processSerialNumber:place:options:eventsOfInterest:callback:userInfo:) to register an event tap, you supply a bit mask that identifies the set of events to be observed. You specify each event using one of the event type constants listed in CGEventType. To form the bit mask, use the CGEventMaskBit macro to convert each constant into an event mask and then OR the individual masks together. For example: CGEventMask mask = CGEventMaskBit(kCGEventLeftMouseDown) |                    CGEventMaskBit(kCGEventLeftMouseUp); You can also supply a mask to observe all events: CGEventMask mask = kCGEventMaskForAllEvents;

## See Also

### Data Types

- [CGButtonCount](coregraphics/cgbuttoncount.md)
- [CGCharCode](coregraphics/cgcharcode.md)
- [CGDirectDisplayID](coregraphics/cgdirectdisplayid.md)
- [CGDisplayBlendFraction](coregraphics/cgdisplayblendfraction.md)
- [CGDisplayConfigRef](coregraphics/cgdisplayconfigref.md)
- [CGDisplayCount](coregraphics/cgdisplaycount.md)
- [CGDisplayErr](coregraphics/cgdisplayerr.md)
- [CGDisplayFadeInterval](coregraphics/cgdisplayfadeinterval.md)
- [CGDisplayFadeReservationToken](coregraphics/cgdisplayfadereservationtoken.md)
- [CGDisplayMode](coregraphics/cgdisplaymode.md)
- [CGDisplayReconfigurationCallBack](coregraphics/cgdisplayreconfigurationcallback.md)
- [CGDisplayReservationInterval](coregraphics/cgdisplayreservationinterval.md)
- [CGDisplayStream](coregraphics/cgdisplaystream.md)
- [CGDisplayStreamFrameAvailableHandler](coregraphics/cgdisplaystreamframeavailablehandler.md)
- [CGDisplayStreamUpdate](coregraphics/cgdisplaystreamupdate.md)
