Filters whether the single-key shortcuts (Space, K, J, L) act on a key press.
Parameters
enabledboolean- Whether the shortcuts act. Default true.
eventKeyboardEvent- The key press.
More Information
Return false to turn them off, which WCAG 2.1.4 asks to be possible.
Usage
wp.hooks.addFilter( 'riff.shortcuts', 'my-plugin', ( enabled, event ) => {
return enabled;
} );Source
! filter( 'shortcuts', true, e )plugins/riff/assets/riff.jsView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.0.1 | Introduced. |