KeyboardShortcut

Keyboard shortcuts describe combinations of keys on a keyboard that the user can press in order to activate a button or toggle.

StructureiOS 14.0+macOS 11.0+KeyboardShortcut in SwiftUI

Declaration

React
type KeyboardShortcut =
  | 'cancelAction'
  | 'defaultAction'
  | { key: KeyEquivalent; modifiers?: EventModifiers; }
  | { key: KeyEquivalent; modifiers?: EventModifiers; localization: KeyboardShortcutLocalization; };
Swift
struct KeyboardShortcut

Pass a literal, or build one with SwiftUI.KeyboardShortcut from import { SwiftUI } from 'swiftui-react-native'.

Type properties

  • 'cancelAction'SwiftUI.KeyboardShortcut.cancelAction

    The standard keyboard shortcut for cancelling the in-progress action or dismissing a prompt, consisting of the Escape (⎋) key and no modifiers.

  • 'defaultAction'SwiftUI.KeyboardShortcut.defaultAction

    The standard keyboard shortcut for the default button, consisting of the Return (↩) key and no modifiers.

Used by

See also

More in Input and interaction.