<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/KeyPress/Phases",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI8KeyPressV6PhasesV"
  },
  "title" : "KeyPress.Phases"
}
-->

# KeyPress.Phases

Options for matching different phases of a key-press event.

```
struct Phases
```

## Topics

### Getting the phases

[`static let down: KeyPress.Phases`](/documentation/SwiftUI/KeyPress/Phases/down)

The user pressed down on a key.

[`static let up: KeyPress.Phases`](/documentation/SwiftUI/KeyPress/Phases/up)

The user released a key.

[`static let `repeat`: KeyPress.Phases`](/documentation/SwiftUI/KeyPress/Phases/repeat)

The user held a key down to issue a sequence of repeating events.

[`static let all: KeyPress.Phases`](/documentation/SwiftUI/KeyPress/Phases/all)

A value that matches all key press phases.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)