KeyboardShortcutLocalization
Options for how a keyboard shortcut participates in automatic localization.
Declaration
type KeyboardShortcutLocalization = 'automatic' | 'custom' | 'withoutMirroring';struct LocalizationPass a literal, or build one with SwiftUI.KeyboardShortcutLocalization from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'automatic'SwiftUI.KeyboardShortcutLocalization.automaticRemap shortcuts to their international counterparts, mirrored for right-to-left usage if appropriate.
'custom'SwiftUI.KeyboardShortcutLocalization.customDon't use automatic shortcut remapping.
'withoutMirroring'SwiftUI.KeyboardShortcutLocalization.withoutMirroringDon't mirror shortcuts.
Overview
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.
From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
See also
More in Input and interaction.
- ButtonRepeatBehaviorThe options for controlling the repeatability of button actions.
- KeyboardShortcutKeyboard shortcuts describe combinations of keys on a keyboard that the user can press in order to activate a button or toggle.
- PencilPreferredActionAn action that the user prefers to perform after double-tapping their Apple Pencil.
- SensoryFeedbackRepresents a type of haptic and/or audio feedback that can be played.
- SensoryFeedbackFlexibilityThe flexibility to be represented by a type of feedback.
- SensoryFeedbackPressFeedbackFeedback that can be played in response to a press (touch down) on a control.
- SensoryFeedbackReleaseFeedbackFeedback that can be played in response to a release (touch up) of a control.
- SensoryFeedbackWeightThe weight to be represented by a type of feedback.