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 - Updated 5 May 2026, 7:55 am EST

    Hi,

    Thank you for reaching out on the forum.

    According to your account-specific details, we’re unable to continue providing support in this public setting for your questions. This appears to be a case-specific situation related to your account and licensing status.

    To assist you further, we kindly recommend contacting our support or billing team directly at customerengagement@mescius.com, where they can review your account details and help resolve the issue appropriately.

    Thank you for your understanding.

    Regards,

    Priyam

Need extra support?

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

Learn More

Forum Channels