深度画布
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
export class KeyEventManager {
|
||||
stateManager: any
|
||||
onWorkbench: any
|
||||
constructor(options) {
|
||||
this.stateManager = options.stateManager;
|
||||
this.onWorkbench = options.onWorkbench;
|
||||
this._handleKeyDown = this.handleKeyDown.bind(this)
|
||||
}
|
||||
onMounted() { }
|
||||
@@ -9,6 +11,7 @@ export class KeyEventManager {
|
||||
/** 处理键盘事件 */
|
||||
_handleKeyDown: any
|
||||
handleKeyDown(event: any) {
|
||||
event.preventDefault()
|
||||
const activeID = this.stateManager.layerManager.activeID.value
|
||||
const ctrl = event.ctrlKey ? 'ctrl-' : "";
|
||||
const shift = event.shiftKey ? 'shift-' : "";
|
||||
@@ -18,6 +21,7 @@ export class KeyEventManager {
|
||||
{ key: "ctrl-c", handler: () => this.stateManager.layerManager.copyLayerById(activeID) },
|
||||
{ key: "delete", handler: () => this.stateManager.layerManager.deleteLayerById(activeID) },
|
||||
{ key: "ctrl-z", handler: () => this.stateManager.undoState() },
|
||||
{ key: "ctrl-s", handler: () => this.onWorkbench() },
|
||||
{ key: "ctrl-shift-z", handler: () => this.stateManager.redoState() },
|
||||
]
|
||||
list.forEach((v: any) => {
|
||||
|
||||
Reference in New Issue
Block a user