One Logo Pool Ball
SwiftUI · IOS API REFERENCE

KeyboardShortcut.Localization

struct · iOS 15.0+ · SDK 27.1

struct Localization

Options for how a keyboard shortcut participates in automatic localization. A shortcut's `key` that is defined on an US-English keyboard layout might not be reachable on international layouts. For example the shortcut `⌘[` works well for the US layout but is hard to reach for German users. On the German keyboard layout, pressing `⌥5` will produce `[`, which causes the shortcut to become `⌥⌘5`. If configured, which is the default behavior, automatic shortcut remapping will convert it to `⌘Ö`. In addition to that, some keyboard shortcuts carry information about directionality. Right-aligning a block of text or seeking forward in context of music playback are such examples. These kinds of shortcuts benefit from the option ``KeyboardShortcut/Localization-swift.struct/withoutMirroring`` to tell the system that they won't be flipped when running in a right-to-left context.

Members (3)

get · iOS 15.0+

withoutMirroring

TypeScript
static get withoutMirroring(): KeyboardShortcut_Localization
Swift declaration
static let withoutMirroring: KeyboardShortcut.Localization

Don't mirror shortcuts. Use this for shortcuts that always have a specific directionality, like aligning something on the right. Don't use this option for navigational shortcuts like "Go Back" because navigation is flipped in right-to-left contexts.

get · iOS 15.0+

custom

TypeScript
static get custom(): KeyboardShortcut_Localization
Swift declaration
static let custom: KeyboardShortcut.Localization

Don't use automatic shortcut remapping. When you use this mode, you have to take care of international use-cases separately.

get · iOS 15.0+

automatic

TypeScript
static get automatic(): KeyboardShortcut_Localization
Swift declaration
static let automatic: KeyboardShortcut.Localization

Remap shortcuts to their international counterparts, mirrored for right-to-left usage if appropriate. This is the default configuration.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →