<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSEvent/modifierFlags-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSEvent(py)modifierFlags"
  },
  "title" : "modifierFlags"
}
-->

# modifierFlags

An integer bit field that indicates the pressed modifier keys.

```
var modifierFlags: NSEvent.ModifierFlags { get }
```

## Discussion

You can examine individual flag settings using the C bitwise AND operator with the predefined key masks described in `Getting Unicode Values`. The lower 16 bits of the modifier flags are reserved for device-dependent bits.

---

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)