---
title: CGEventFlags
framework: coregraphics
role: symbol
role_heading: Structure
path: coregraphics/cgeventflags
---

# CGEventFlags

Constants that indicate the modifier key state at the time an event is created, as well as other event-related states.

## Declaration

```swift
struct CGEventFlags
```

## Overview

Overview These constants specify masks for the bits in an event flags bit mask. Event flags indicate the modifier key state at the time an event is created, as well as other event-related states. Event flags are used in accessor functions such as flags, CGEventSetFlags, and flagsState(_:).

## Topics

### Constants

- [maskAlphaShift](coregraphics/cgeventflags/maskalphashift.md)
- [maskShift](coregraphics/cgeventflags/maskshift.md)
- [maskControl](coregraphics/cgeventflags/maskcontrol.md)
- [maskAlternate](coregraphics/cgeventflags/maskalternate.md)
- [maskCommand](coregraphics/cgeventflags/maskcommand.md)
- [maskHelp](coregraphics/cgeventflags/maskhelp.md)
- [maskSecondaryFn](coregraphics/cgeventflags/masksecondaryfn.md)
- [maskNumericPad](coregraphics/cgeventflags/masknumericpad.md)
- [maskNonCoalesced](coregraphics/cgeventflags/masknoncoalesced.md)

### Initializers

- [init(rawValue:)](coregraphics/cgeventflags/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [ExpressibleByArrayLiteral](swift/expressiblebyarrayliteral.md)
- [OptionSet](swift/optionset.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SetAlgebra](swift/setalgebra.md)

## See Also

### Enumerations

- [CGCaptureOptions](coregraphics/cgcaptureoptions.md)
- [CGColorConversionInfoTransformType](coregraphics/cgcolorconversioninfotransformtype.md)
- [CGColorRenderingIntent](coregraphics/cgcolorrenderingintent.md)
- [CGConfigureOption](coregraphics/cgconfigureoption.md)
- [CGDisplayChangeSummaryFlags](coregraphics/cgdisplaychangesummaryflags.md)
- [CGDisplayStreamFrameStatus](coregraphics/cgdisplaystreamframestatus.md)
- [CGDisplayStreamUpdateRectType](coregraphics/cgdisplaystreamupdaterecttype.md)
- [CGError](coregraphics/cgerror.md)
- [CGEventField](coregraphics/cgeventfield.md)
- [CGEventFilterMask](coregraphics/cgeventfiltermask.md)
- [CGEventMouseSubtype](coregraphics/cgeventmousesubtype.md)
- [CGEventSourceStateID](coregraphics/cgeventsourcestateid.md)
- [CGEventSuppressionState](coregraphics/cgeventsuppressionstate.md)
- [CGEventTapLocation](coregraphics/cgeventtaplocation.md)
- [CGEventTapOptions](coregraphics/cgeventtapoptions.md)
