diff --git a/packages/block-editor/src/components/block-tools/index.js b/packages/block-editor/src/components/block-tools/index.js index 700b345be20274..99d0da46b0252e 100644 --- a/packages/block-editor/src/components/block-tools/index.js +++ b/packages/block-editor/src/components/block-tools/index.js @@ -85,6 +85,8 @@ export default function BlockTools( { moveBlocksUp, moveBlocksDown, expandBlock, + setZoomLevel, + resetZoomLevel, } = unlock( useDispatch( blockEditorStore ) ); function onKeyDown( event ) { @@ -175,6 +177,12 @@ export default function BlockTools( { replaceBlocks( clientIds, newBlocks ); speak( __( 'Selected blocks are grouped.' ) ); } + } else if ( isMatch( 'core/block-editor/zoom', event ) ) { + if ( isZoomOutMode ) { + resetZoomLevel(); + } else { + setZoomLevel( 'auto-scaled' ); + } } } const blockToolbarRef = usePopoverScroll( __unstableContentRef ); diff --git a/packages/block-editor/src/components/keyboard-shortcuts/index.js b/packages/block-editor/src/components/keyboard-shortcuts/index.js index 9b838446469229..df64cdabdf0263 100644 --- a/packages/block-editor/src/components/keyboard-shortcuts/index.js +++ b/packages/block-editor/src/components/keyboard-shortcuts/index.js @@ -155,6 +155,15 @@ function KeyboardShortcutsRegister() { character: 'g', }, } ); + registerShortcut( { + name: 'core/block-editor/zoom', + category: 'global', + description: __( 'Enter or exit zoom out.' ), + keyCombination: { + modifier: 'primaryShift', + character: 'z', + }, + } ); }, [ registerShortcut ] ); return null;