How to use the @wordpress/keycodes.displayShortcut.primaryAlt 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 / editor / src / components / block-settings-menu / index.js View on Github external
event.preventDefault();
	return event;
};

const shortcuts = {
	duplicate: {
		raw: rawShortcut.primaryShift( 'd' ),
		display: displayShortcut.primaryShift( 'd' ),
	},
	removeBlock: {
		raw: rawShortcut.primaryShift( 'x' ),
		display: displayShortcut.primaryShift( 'x' ),
	},
	insertBefore: {
		raw: rawShortcut.primaryAlt( 't' ),
		display: displayShortcut.primaryAlt( 't' ),
	},
	insertAfter: {
		raw: rawShortcut.primaryAlt( 'y' ),
		display: displayShortcut.primaryAlt( 'y' ),
	},
};

export class BlockSettingsMenu extends Component {
	constructor() {
		super( ...arguments );
		this.state = {
			isFocused: false,
		};
		this.onFocus = this.onFocus.bind( this );
		this.onBlur = this.onBlur.bind( this );
	}
github dsifford / academic-bloggers-toolkit / src / js / gutenberg / dialogs / add-reference / index.tsx View on Github external
export default function AddReferenceDialog() {
    const { addReference } = useDispatch('abt/data');
    const [isOpen, setIsOpen] = useState(false);
    const toggleDialog = () => setIsOpen(!isOpen);
    return (
        <>
            
            
            <dialog title="{__('Add"> {
                    addReference(data);
                    setIsOpen(false);
                }}
            /&gt;
        
    );
}
</dialog>
github WordPress / gutenberg / packages / editor / src / components / block-settings-menu / index.js View on Github external
const shortcuts = {
	duplicate: {
		raw: rawShortcut.primaryShift( 'd' ),
		display: displayShortcut.primaryShift( 'd' ),
	},
	removeBlock: {
		raw: rawShortcut.primaryShift( 'x' ),
		display: displayShortcut.primaryShift( 'x' ),
	},
	insertBefore: {
		raw: rawShortcut.primaryAlt( 't' ),
		display: displayShortcut.primaryAlt( 't' ),
	},
	insertAfter: {
		raw: rawShortcut.primaryAlt( 'y' ),
		display: displayShortcut.primaryAlt( 'y' ),
	},
};

export class BlockSettingsMenu extends Component {
	constructor() {
		super( ...arguments );
		this.state = {
			isFocused: false,
		};
		this.onFocus = this.onFocus.bind( this );
		this.onBlur = this.onBlur.bind( this );
	}

	onFocus() {
		this.setState( {
			isFocused: true,