blockCutToStorageShortcut() {
    /** @type {!Blockly.ShortcutRegistry.KeyboardShortcut} */
    const cutShortcut = {
      name: 'cut',
      preconditionFn: function (workspace) {
        return (
          !workspace.options.readOnly &&
          !Blockly.Gesture.inProgress() &&
          Blockly.getSelected() &&
          Blockly.getSelected().isDeletable() &&
          Blockly.getSelected().isMovable() &&
          !Blockly.getSelected().workspace.isFlyout
        );
      },
      callback: function (workspace, e) {
        // Prevent the default copy behavior,
        // which may beep or otherwise indicate
        // an error due to the lack of a selection.
        e.preventDefault();
        const block = /** @type {Blockly.BlockSvg} */ (Blockly.getSelected());
        if (!block || !Blockly.isCopyable(block)) return false;
        localStorage.setItem(
          'blocklyStash',
          JSON.stringify(block.toCopyData()),
        );
        Blockly.Events.setGroup(true);
        block.dispose(true);
        Blockly.Events.setGroup(false);
        return true;
      },
    };
    Blockly.ShortcutRegistry.registry.register(cutShortcut);

    const ctrlX = Blockly.ShortcutRegistry.registry.createSerializedKey(
      Blockly.utils.KeyCodes.X,
      [Blockly.utils.KeyCodes.CTRL],
    );
    Blockly.ShortcutRegistry.registry.addKeyMapping(ctrlX, cutShortcut.name);

    const altX = Blockly.ShortcutRegistry.registry.createSerializedKey(
      Blockly.utils.KeyCodes.X,
      [Blockly.utils.KeyCodes.ALT],
    );
    Blockly.ShortcutRegistry.registry.addKeyMapping(altX, cutShortcut.name);

    const metaX = Blockly.ShortcutRegistry.registry.createSerializedKey(
      Blockly.utils.KeyCodes.X,
      [Blockly.utils.KeyCodes.META],
    );
    Blockly.ShortcutRegistry.registry.addKeyMapping(metaX, cutShortcut.name);
  }
Adds a keyboard shortcut that will store copy information for a block
in local storage and delete the block.