您好,
可以自定义命令,然后绑定ctrl+s快捷键,示例代码如下:
- var command = {
- canUndo: false,
- execute: function (context, options, isUndo) {
- var Commands = GC.Spread.Sheets.Commands;
- if (isUndo) {
- Commands.undoTransaction(context, options);
- return true;
- } else {
- Commands.startTransaction(context, options);
-
- alert("ctrl+s");
-
- return true;
- }
- }
- };
- spread.commandManager().register("newCommand", command);
- spread.commandManager().setShortcutKey("newCommand", 83, true, false, false, false);
复制代码 其中 83 为键盘按键 s 对应的键码
API:
https://demo.grapecity.com.cn/sp ... ager#setshortcutkey
|