File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -640,8 +640,11 @@ export function createBlocklyWorkspace() {
640640 // Initialize keyboard navigation.
641641
642642 const shortcutRegistry = Blockly . ShortcutRegistry . registry ;
643- shortcutRegistry . removeAllKeyMappings ?. ( "menu" ) ;
644- shortcutRegistry . unregister ?. ( "menu" ) ;
643+ const keyboardShortcuts = shortcutRegistry . getRegistry ?. ( ) ;
644+ if ( keyboardShortcuts ?. menu ) {
645+ shortcutRegistry . removeAllKeyMappings ?. ( "menu" ) ;
646+ shortcutRegistry . unregister ?. ( "menu" ) ;
647+ }
645648 new KeyboardNavigation ( workspace ) ;
646649
647650 const toolbox = workspace . getToolbox ( ) ;
Original file line number Diff line number Diff line change @@ -134,7 +134,10 @@ function registerBlocklyPlayShortcut() {
134134 null ,
135135 ) ;
136136
137- shortcutRegistry . unregister ( shortcutName ) ;
137+ const keyboardShortcuts = shortcutRegistry . getRegistry ?. ( ) ;
138+ if ( keyboardShortcuts ?. [ shortcutName ] ) {
139+ shortcutRegistry . unregister ( shortcutName ) ;
140+ }
138141 shortcutRegistry . register ( {
139142 name : shortcutName ,
140143 keyCodes : [ keyCode ] ,
You can’t perform that action at this time.
0 commit comments