Filters whether the single-key shortcuts (Space, K, J, L and plugins' keys) 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. It turns off the keys plugins register with riff_register_shortcut() too.
Usage
wp.hooks.addFilter( 'riff.shortcuts', 'my-plugin', ( enabled, event ) => {
return enabled;
} );Source
! filter( 'shortcuts', true, e )plugins/riff/assets/player/keyboard.jsView on GitHub
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Plugins' keys too. |
| 4.0.1 | Introduced. |