One Logo Pool Ball
SwiftUI · IOS API REFERENCE

KeyEquivalent

struct · iOS 14.0+ · SDK 27.1

struct 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. 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.

Members (19)

get · iOS 14.0+

rightArrow

TypeScript
static get rightArrow(): KeyEquivalent
Swift declaration
static let rightArrow: KeyEquivalent

Right Arrow (U+F703)

get · iOS 14.0+

deleteForward

TypeScript
static get deleteForward(): KeyEquivalent
Swift declaration
static let deleteForward: KeyEquivalent

Delete Forward (U+F728)

init · iOS 14.0+

init

TypeScript
static initExtendedGraphemeClusterLiteral(extendedGraphemeClusterLiteral: string): KeyEquivalent
Swift declaration
init(extendedGraphemeClusterLiteral: Character)

Creates an instance initialized to the given value. - Parameter value: The value of the new instance.

get · iOS 14.0+

end

TypeScript
static get end(): KeyEquivalent
Swift declaration
static let end: KeyEquivalent

End (U+F72B)

get · iOS 14.0+

tab

TypeScript
static get tab(): KeyEquivalent
Swift declaration
static let tab: KeyEquivalent

Tab (U+0009)

get · iOS 14.0+

home

TypeScript
static get home(): KeyEquivalent
Swift declaration
static let home: KeyEquivalent

Home (U+F729)

get · iOS 14.0+

clear

TypeScript
static get clear(): KeyEquivalent
Swift declaration
static let clear: KeyEquivalent

Clear (U+F739)

get · iOS 14.0+

space

TypeScript
static get space(): KeyEquivalent
Swift declaration
static let space: KeyEquivalent

Space (U+0020)

get · iOS 14.0+

delete

TypeScript
static get delete(): KeyEquivalent
Swift declaration
static let delete: KeyEquivalent

Delete (U+0008)

get · iOS 14.0+

escape

TypeScript
static get escape(): KeyEquivalent
Swift declaration
static let escape: KeyEquivalent

Escape (U+001B)

get · iOS 14.0+

pageUp

TypeScript
static get pageUp(): KeyEquivalent
Swift declaration
static let pageUp: KeyEquivalent

Page Up (U+F72C)

get · iOS 14.0+

return

TypeScript
static get return(): KeyEquivalent
Swift declaration
static let `return`: KeyEquivalent

Return (U+000D)

get · iOS 14.0+

upArrow

TypeScript
static get upArrow(): KeyEquivalent
Swift declaration
static let upArrow: KeyEquivalent

Up Arrow (U+F700)

get · iOS 14.0+

pageDown

TypeScript
static get pageDown(): KeyEquivalent
Swift declaration
static let pageDown: KeyEquivalent

Page Down (U+F72D)

get · iOS 14.0+

character

TypeScript
get character(): string
Swift declaration
var character: Character

The character value that the key equivalent represents.

set · iOS 14.0+

character

TypeScript
set character(value: string)
Swift declaration
var character: Character

The character value that the key equivalent represents.

get · iOS 14.0+

downArrow

TypeScript
static get downArrow(): KeyEquivalent
Swift declaration
static let downArrow: KeyEquivalent

Down Arrow (U+F701)

get · iOS 14.0+

leftArrow

TypeScript
static get leftArrow(): KeyEquivalent
Swift declaration
static let leftArrow: KeyEquivalent

Left Arrow (U+F702)

init · iOS 14.0+

init

TypeScript
static init(character: string): KeyEquivalent
Swift declaration
init(_ character: Character)

Creates a new key equivalent from the given character value.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →