wp.hooks.applyFilters( 'riff.shortcuts', enabled, event )

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 )

Changelog

VersionDescription
5.9.0Plugins' keys too.
4.0.1Introduced.