KeyEquivalent
Key equivalents consist of a letter, punctuation, or function key that can be combined with an optional set of modifier keys to specify a keyboard shortcut.
Declaration
type KeyEquivalent =
| 'clear'
| 'delete'
| 'deleteForward'
| 'downArrow'
| 'end'
| 'escape'
| 'home'
| 'leftArrow'
| 'pageDown'
| 'pageUp'
| 'return'
| 'rightArrow'
| 'space'
| 'tab'
| 'upArrow';struct KeyEquivalentPass a literal, or build one with SwiftUI.KeyEquivalent from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'clear'SwiftUI.KeyEquivalent.clearClear (U+F739)
'delete'SwiftUI.KeyEquivalent.deleteDelete (U+0008)
'deleteForward'SwiftUI.KeyEquivalent.deleteForwardDelete Forward (U+F728)
'downArrow'SwiftUI.KeyEquivalent.downArrowDown Arrow (U+F701)
'end'SwiftUI.KeyEquivalent.endEnd (U+F72B)
'escape'SwiftUI.KeyEquivalent.escapeEscape (U+001B)
'home'SwiftUI.KeyEquivalent.homeHome (U+F729)
'leftArrow'SwiftUI.KeyEquivalent.leftArrowLeft Arrow (U+F702)
'pageDown'SwiftUI.KeyEquivalent.pageDownPage Down (U+F72D)
'pageUp'SwiftUI.KeyEquivalent.pageUpPage Up (U+F72C)
'return'SwiftUI.KeyEquivalent.returnReturn (U+000D)
'rightArrow'SwiftUI.KeyEquivalent.rightArrowRight Arrow (U+F703)
'space'SwiftUI.KeyEquivalent.spaceSpace (U+0020)
'tab'SwiftUI.KeyEquivalent.tabTab (U+0009)
'upArrow'SwiftUI.KeyEquivalent.upArrowUp Arrow (U+F700)
Overview
Key equivalents are used to establish keyboard shortcuts to app functionality. Any key can be used as a key equivalent as long as pressing it produces a single character value. Key equivalents are typically initialized using a single-character string literal, with constants for unprintable or hard-to-type values.
The modifier keys necessary to type a key equivalent are factored in to the resulting keyboard shortcut. That is, a key equivalent whose raw value is the capitalized string "A" corresponds with the keyboard shortcut Command-Shift-A. The exact mapping may depend on the keyboard layout—for example, a key equivalent with the character value "}" produces a shortcut equivalent to Command-Shift-] on ANSI keyboards, but would produce a different shortcut for keyboard layouts where punctuation characters are in different locations.
From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
See also
More in Other values.
- AxisThe horizontal or vertical dimension in a 2D coordinate system.
- AxisSetAn efficient set of axes.
- ButtonRoleA value that describes the purpose of a button.
- CapsuleA capsule shape aligned inside the frame of the view containing it.
- CircleA circle centered on the frame of the view containing it.
- ConcentricRectangleA shape whose corners you configure, individually or uniformly, to be squared, rounded, or concentric relative to a container shape's corners.
- ContentMarginGuideA guide for resolving the content margins for a view.
- ContentMarginPlacementThe placement of margins.
- ContentModeConstants that define how a view's content fills the available space.
- DatePickerComponents
- DatePickerComponents2The date and time components that a date picker shows.
- DeviceHingeA type encapsulating the state of a single hinge.