Skip to content

Latest commit

 

History

History
93 lines (49 loc) · 2.01 KB

data-core-keyboard-shortcuts.md

File metadata and controls

93 lines (49 loc) · 2.01 KB

The Keyboard Shortcuts Data

Namespace: core/keyboard-shortcuts.

Selectors

# getShortcutAliases

Returns the aliases for a given shortcut name.

Parameters

  • state Object: Global state.
  • name string: Shortcut name.

Returns

  • Array<WPShortcutKeyCombination>: Key combinations.

# getShortcutDescription

Returns the shortcut description given its name.

Parameters

  • state Object: Global state.
  • name string: Shortcut name.

Returns

  • ?string: Shortcut description.

# getShortcutKeyCombination

Returns the main key combination for a given shortcut name.

Parameters

  • state Object: Global state.
  • name string: Shortcut name.

Returns

  • ?WPShortcutKeyCombination: Key combination.

# getShortcutRepresentation

Returns a string representing the main key combination for a given shortcut name.

Parameters

  • state Object: Global state.
  • name string: Shortcut name.
  • representation string: Type of reprensentation. (display, raw, ariaLabel )

Returns

  • string: Shortcut representation.

Actions

# registerShortcut

Returns an action object used to register a new keyboard shortcut.

Parameters

  • config WPShortcutConfig: Shortcut config.

Returns

  • Object: action.

# unregisterShortcut

Returns an action object used to unregister a keyboard shortcut.

Parameters

  • name string: Shortcut name.

Returns

  • Object: action.