📄 metamovekeylistener.js
字号:
///**
* <p>Description: </p>
* <p>Copyright: Copyright (c) xio.name 2006</p>
* @author xio
*/function MetaMoveKeyListener(wrapper) { this.wrapper = wrapper; this.step = XiorkFlowWorkSpace.META_NODE_MOVED_STEP; this.num = 0; this.offset = 1;}MetaMoveKeyListener.prototype = new KeyListener();MetaMoveKeyListener.prototype.onKeyUp = function (e) { this.step = XiorkFlowWorkSpace.META_NODE_MOVED_STEP; this.offset = 1; this.num = 0;
// var charCode = (e.charCode) ? e.charCode : e.keyCode; switch (charCode) { case 46: this.wrapper.getModel().deleteSelected(); break; default: break; }};MetaMoveKeyListener.prototype.onKeyDown = function (e) { var state = this.wrapper.getStateMonitor().getState(); if (state != StateMonitor.SELECT) { return; }
// this.num++; if (this.num > 4) { this.offset++; this.step += this.offset; this.num = 0; }
// var metaNodeModels = this.wrapper.getModel().getSelectedMetaNodeModels(); var charCode = (e.charCode) ? e.charCode : e.keyCode; switch (charCode) { case 38://up XiorkFlowModel.moveMetaNodeModelBy(metaNodeModels, 0, -this.step); break; case 40://down XiorkFlowModel.moveMetaNodeModelBy(metaNodeModels, 0, this.step); break; case 37://left XiorkFlowModel.moveMetaNodeModelBy(metaNodeModels, -this.step, 0); break; case 39://right XiorkFlowModel.moveMetaNodeModelBy(metaNodeModels, this.step, 0); break; default: break; }};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -