The Keyboard Shortcuts Data Edit

Namespace: core/keyboard-shortcuts.

Selectors

Top ↑

getAllShortcutKeyCombinations

Undocumented declaration.

Top ↑

getAllShortcutRawKeyCombinations

Returns the raw representation of all the keyboard combinations of a given shortcut name.

Parameters

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

Returns

  • string[]: Shortcuts.

Top ↑

getCategoryShortcuts

Returns the shortcut names list for a given category name.

Parameters

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

Returns

  • string[]: Shortcut names.

Top ↑

getShortcutAliases

Returns the aliases for a given shortcut name.

Parameters

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

Returns

  • WPShortcutKeyCombination[]: Key combinations.

Top ↑

getShortcutDescription

Returns the shortcut description given its name.

Parameters

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

Returns

  • string?: Shortcut description.

Top ↑

getShortcutKeyCombination

Returns the main key combination for a given shortcut name.

Parameters

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

Returns

  • WPShortcutKeyCombination?: Key combination.

Top ↑

getShortcutRepresentation

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

Parameters

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

Returns

  • string?: Shortcut representation.

Top ↑

Actions

Top ↑

registerShortcut

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

Parameters

  • config WPShortcutConfig: Shortcut config.

Returns

  • Object: action.

Top ↑

unregisterShortcut

Returns an action object used to unregister a keyboard shortcut.

Parameters

  • name string: Shortcut name.

Returns

  • Object: action.