<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGEventSource/flagsState(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGEventSourceFlagsState"
  },
  "title" : "flagsState(_:)"
}
-->

# flagsState(_:)

Returns the current flags of a Quartz event source.

```
class func flagsState(_ stateID: CGEventSourceStateID) -> CGEventFlags
```

## Parameters

`stateID`

The source state to access. Pass one of the constants listed in [`CGEventSourceStateID`](/documentation/CoreGraphics/CGEventSourceStateID).

## Return Value

The current flags of the specified event source. For more information, see  [`CGEventFlags`](/documentation/CoreGraphics/CGEventFlags).

## Discussion

---

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)