Developers

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

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 )

Changelog

VersionDescription
4.0.1Introduced.