How to use the @wordpress/keycodes.displayShortcut.access function in @wordpress/keycodes

To help you get started, we’ve selected a few @wordpress/keycodes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WordPress / gutenberg / packages / edit-post / src / plugins / keyboard-shortcuts-help-menu-item / index.js View on Github external
export function KeyboardShortcutsHelpMenuItem( { openModal } ) {
	return (
		<menuitem> {
				openModal( 'edit-post/keyboard-shortcut-help' );
			} }
			shortcut={ displayShortcut.access( 'h' ) }
		&gt;
			{ __( 'Keyboard Shortcuts' ) }
		</menuitem>
	);
}
github WordPress / gutenberg / packages / block-editor / src / components / block-navigation / dropdown.js View on Github external
renderToggle={ ( { isOpen, onToggle } ) =&gt; (
				&lt;&gt;
					{ isEnabled &amp;&amp; 
					}
					<button aria-disabled="{" label="{" aria-expanded="{">
				
			) }
			renderContent={ ( { onClose } ) =&gt; (</button>
github Automattic / wp-calypso / client / gutenberg / editor / edit-post / plugins / keyboard-shortcuts-help-menu-item / index.js View on Github external
export function KeyboardShortcutsHelpMenuItem( { openModal, onSelect } ) {
	return (
		<menuitem> {
				onSelect();
				openModal( 'edit-post/keyboard-shortcut-help' );
			} }
			shortcut={ displayShortcut.access( 'h' ) }
		&gt;
			{ __( 'Keyboard Shortcuts' ) }
		</menuitem>
	);
}
github WordPress / gutenberg / packages / editor / src / components / rich-text / formatting-controls.js View on Github external
{
		icon: 'editor-italic',
		title: __( 'Italic' ),
		shortcut: displayShortcut.primary( 'i' ),
		format: 'italic',
	},
	{
		icon: 'admin-links',
		title: __( 'Link' ),
		shortcut: displayShortcut.primary( 'k' ),
		format: 'link',
	},
	{
		icon: 'editor-strikethrough',
		title: __( 'Strikethrough' ),
		shortcut: displayShortcut.access( 'd' ),
		format: 'strikethrough',
	},
];