Posted 11 July 2023, 5:44 pm EST
Hi there,
I have requirements where they don’t want to do CTRl + C for and then CTRL + V for paste. Is there any way we can disable this?
Regards
Gagandeep
Forums Home / Spread / SpreadJS
Posted by: gagandeep.singh on 11 July 2023, 5:44 pm EST
Posted 11 July 2023, 5:44 pm EST
Hi there,
I have requirements where they don’t want to do CTRl + C for and then CTRL + V for paste. Is there any way we can disable this?
Regards
Gagandeep
Posted 12 July 2023, 4:49 am EST
Hi Gagandeep,
You could remove the shortcuts keys of Copy and Paste commands when the Ctrl + C/ Ctrl + V from the command’s manager. To remove a command’s binding, pass the undefined as first parameter in the setShortcutKey method.
Kindly use the following code snippet:
// Remove the Copy command shortcut
spread.commandManager().setShortcutKey(undefined, GC.Spread.Commands.Key.c, true, false, false, false);
// Remove the Paste command shortcut
spread.commandManager().setShortcutKey(undefined, GC.Spread.Commands.Key.v, true, false, false, false);
References:
Key Enumeration:
https://www.grapecity.com/spreadjs/api/enums/GC.Spread.Commands.Key#enumeration-key
setShortcutKey method: https://www.grapecity.com/spreadjs/api/v15/classes/GC.Spread.Commands.CommandManager#setshortcutkey
Please let us know if you face any issues.
Regards,
Ankit