import { mxgraph } from "../common/initGraphVar";
const { mxDefaultKeyHandler } = mxgraph;
export const bindKeyEvent = function (editor: any) {
    //讲快捷键和图形动作进行绑定
    const keyHandler = new mxDefaultKeyHandler(editor);
    keyHandler.bindAction(8, 'collapse');
    keyHandler.bindAction(13, "expand")
    keyHandler.bindAction(33, "exitGroup")
    keyHandler.bindAction(34, "enterGroup")
    keyHandler.bindAction(35, "refresh")
    keyHandler.bindAction(36, "home")
    keyHandler.bindAction(37, "selectPrevious")
    keyHandler.bindAction(38, "selectParent")
    keyHandler.bindAction(40, "selectChild")
    keyHandler.bindAction(39, "selectNext")
    // 删除改由 getFunction 中统一调用 handleDel，不绑定默认 delete 动作
    keyHandler.bindAction(65, "selectAll", true)
    keyHandler.bindAction(90, "undo", true)
    keyHandler.bindAction(89, "redo", true)
    keyHandler.bindAction(88, "cut", true)
    keyHandler.bindAction(67, "copy", true)
    keyHandler.bindAction(86, "paste", true)
    keyHandler.bindAction(71, "group", true)
    keyHandler.bindAction(85, "ungroup", true)
    keyHandler.bindAction(113, "edit")
    keyHandler.bindAction(123, "showProperties")
    keyHandler.bindAction(107, "zoomIn")
    keyHandler.bindAction(109, "zoomOut")
}