From 3b72ae3dcc913d895eecd60ef975ca10b3fe2e09 Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Tue, 25 Aug 2020 10:36:50 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/working-area/working-area.component.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index bd9bdc9..ee803d4 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -59,20 +59,15 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // 根据ID 找到数据 ngOnInit(): void { this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { - // console.log('按下了' + event.keyCode); if (event.keyCode === 17) { this.selection.isMultiselection = true; - // this.setNameVisible(true, 0); - this.copy(); } }); this.eventManager.addGlobalEventListener('window', 'keyup', (event: any) => { - // console.log('弹起了' + event.keyCode); if (event.keyCode === 17) { this.selection.isMultiselection = false; } if (event.keyCode === 46) { - this.selection.objects.forEach(item => { // 删除 选中的数据 if (item.assetData.IsFromBuilding) { @@ -93,6 +88,15 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV } }); + // 测试代码 + this.eventManager.addGlobalEventListener('window', 'keypress', (event: any) => { + if (event.keyCode === 97) { + this.copy(); + } + if (event.keyCode === 115) { + this.paste('1', '2', '3'); + } + }); } ngAfterViewInit(): void {