The Keyboard Shortcuts Data
Edit
Namespace: core/keyboard-shortcuts
.
Selectors
getAllShortcutKeyCombinations
Undocumented declaration.
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.
getCategoryShortcuts
Returns the shortcut names list for a given category name.
Parameters
- state
Object
: Global state. - name
string
: Category name.
Returns
string[]
: Shortcut names.
getShortcutAliases
Returns the aliases for a given shortcut name.
Parameters
- state
Object
: Global state. - name
string
: Shortcut name.
Returns
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
keyof FORMATTING_METHODS
: Type of representation (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.