Override undo/redo using keyboard option (cmd+z)

Posted by: npathak on 6 February 2026, 6:03 am EST

  • Posted 6 February 2026, 6:03 am EST

    Hi,

    I want a custom undo function and default operation of cmd+z. I tried several way, but it’s not working.

    Code snippet for reference.

    	var myUndo = {
                canUndo: true,
                execute: function (context, options, isUndo) {
                    // spread.undoManager().undo();
                    console.log(isUndo);
                }
            };
            var commandManager = spread.commandManager();
            var commandName = "doUndo";
            commandManager.register(commandName, myUndo, null, false, false, false, false);
            commandManager.setShortcutKey(undefined, GC.Spread.Commands.Key.z, true, false, false, false);
            commandManager.setShortcutKey(commandName, GC.Spread.Commands.Key.z, true, false, false, false);

  • Posted 9 February 2026, 2:32 am EST

    Hi,

    Support assistance for MESCIUS USA products is available to customers with an active subscription and valid support entitlement.

    We’re unable to provide product support through the forum in this case. Please contact our support or billing team directly at customerengagement@mescius.com so we can address your account status privately.

    Regards,

    Priyam

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels