<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIKeyModifierFlags",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@UIKeyModifierFlags"
  },
  "title" : "UIKeyModifierFlags"
}
-->

# UIKeyModifierFlags

Constants that indicate which modifier keys are pressed.

```
struct UIKeyModifierFlags
```

## Topics

### Modifier flags

[`UIKeyModifierAlphaShift`](/documentation/UIKit/UIKeyModifierFlags/alphaShift)

A modifier flag that indicates the user pressed the Caps Lock key.

[`UIKeyModifierShift`](/documentation/UIKit/UIKeyModifierFlags/shift)

A modifier flag that indicates the user pressed the Shift key.

[`UIKeyModifierControl`](/documentation/UIKit/UIKeyModifierFlags/control)

A modifier flag that indicates the user pressed the Control key.

[`UIKeyModifierAlternate`](/documentation/UIKit/UIKeyModifierFlags/alternate)

A modifier flag that indicates the user pressed the Option key.

[`UIKeyModifierCommand`](/documentation/UIKit/UIKeyModifierFlags/command)

A modifier flag that indicates the user pressed the Command key.

[`UIKeyModifierNumericPad`](/documentation/UIKit/UIKeyModifierFlags/numericPad)

A modifier flag that indicates the user pressed a key located on the numeric keypad.

### Initializers

[`init(rawValue:)`](/documentation/UIKit/UIKeyModifierFlags/init(rawValue:))

Creates a modifier-flags structure from data in an unarchiver.

## Relationships

### Conforms To

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`OptionSet`](/documentation/Swift/OptionSet)

[`Sendable`](/documentation/Swift/Sendable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)