Browse Source

feat:增加删除相关操作

YaolongHan 4 years ago
parent
commit
e045634251
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/components/mapClass/EditScence.ts

+ 6 - 3
src/components/mapClass/EditScence.ts

@@ -906,6 +906,7 @@ export class EditScence extends SGraphScene {
         }
         }
         if (this.grabItem) {
         if (this.grabItem) {
             this.grabItem.onKeyDown(event);
             this.grabItem.onKeyDown(event);
+            // 创建时按esc键取消
             if (event.code == "Escape") {
             if (event.code == "Escape") {
                 const item = this.grabItem;
                 const item = this.grabItem;
                 this.grabItem = null
                 this.grabItem = null
@@ -916,9 +917,11 @@ export class EditScence extends SGraphScene {
                 this.setCmd = 'choice'
                 this.setCmd = 'choice'
             }
             }
         }
         }
-        // if (event.key == "Enter") {
-        //     this.cmd = 0
-        // }
+        //delete键删除item
+        if(event.code == "Delete"){
+          this.deleiteItem()
+        }
+
         return false
         return false
     }
     }