Type Alias

CGEventMask

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

Declaration

typedef uint64_t CGEventMask;

Discussion

When you call either CGEventTapCreate or CGEventTapCreateForPSN 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;