JSPM

@wordpress/keyboard-shortcuts

3.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 54462
  • Score
    100M100P100Q162651F
  • License GPL-2.0-or-later

Handling keyboard shortcuts.

Package Exports

  • @wordpress/keyboard-shortcuts

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wordpress/keyboard-shortcuts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Keyboard Shortcuts

Keyboard shortcuts is a generic package that allows registering and modifying shortcuts.

Installation

Install the module

npm install @wordpress/keyboard-shortcuts --save

This package assumes that your code will run in an ES2015+ environment. If you're using an environment that has limited or no support for such language features and APIs, you should include the polyfill shipped in @wordpress/babel-preset-default in your code.

API

ShortcutProvider

Handles callbacks added to context by useShortcut.

Parameters

  • props Object: Props to pass to div.

Returns

  • import('@wordpress/element').WPElement: Component.

store

Store definition for the keyboard shortcuts namespace.

Related

Type

  • Object

useShortcut

Attach a keyboard shortcut handler.

Parameters

  • name string: Shortcut name.
  • callback Function: Shortcut callback.
  • options Object: Shortcut options.
  • options.isDisabled boolean: Whether to disable to shortut.



Code is Poetry.