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

# CGEventFlags

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

```
struct CGEventFlags
```

## 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`](/documentation/CoreGraphics/CGEvent/flags), [`CGEventSetFlags`](/documentation/CoreGraphics/CGEventSetFlags), and [`flagsState(_:)`](/documentation/CoreGraphics/CGEventSource/flagsState(_:)).

## Topics

### Constants

[`maskAlphaShift`](/documentation/CoreGraphics/CGEventFlags/maskAlphaShift)

Indicates that the Caps Lock key is down for a keyboard, mouse, or flag-changed event.

[`maskShift`](/documentation/CoreGraphics/CGEventFlags/maskShift)

Indicates that the Shift key is down for a keyboard, mouse, or flag-changed event.

[`maskControl`](/documentation/CoreGraphics/CGEventFlags/maskControl)

Indicates that the Control key is down for a keyboard, mouse, or flag-changed event.

[`maskAlternate`](/documentation/CoreGraphics/CGEventFlags/maskAlternate)

Indicates that the Alt or Option key is down for a keyboard, mouse, or flag-changed event.

[`maskCommand`](/documentation/CoreGraphics/CGEventFlags/maskCommand)

Indicates that the Command key is down for a keyboard, mouse, or flag-changed event.

[`maskHelp`](/documentation/CoreGraphics/CGEventFlags/maskHelp)

Indicates that the Help modifier key is down for a keyboard, mouse, or flag-changed event. This key is not present on most keyboards, and is different than the Help key found in the same row as Home and Page Up.

[`maskSecondaryFn`](/documentation/CoreGraphics/CGEventFlags/maskSecondaryFn)

Indicates that the Fn (Function) key is down for a keyboard, mouse, or flag-changed event. This key is found primarily on laptop keyboards.

[`maskNumericPad`](/documentation/CoreGraphics/CGEventFlags/maskNumericPad)

Identifies key events from the numeric keypad area on extended keyboards.

[`maskNonCoalesced`](/documentation/CoreGraphics/CGEventFlags/maskNonCoalesced)

Indicates that mouse and pen movement events are not being coalesced.

### Initializers

[`init(rawValue:)`](/documentation/CoreGraphics/CGEventFlags/init(rawValue:))



---

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)