From a8de298ab5ad4a422bba77c991a1ccc7f363f5f6 Mon Sep 17 00:00:00 2001 From: Original-Recipe-Chicken Date: Thu, 18 Jul 2024 11:19:54 +0800 Subject: [PATCH] fix: Fix the key of resize rect from ctrl+4 to P --- packages/lb-annotation/src/constant/keyCode.ts | 3 +-- .../src/core/toolOperation/pointCloud2DRectOperation.ts | 2 +- .../lb-annotation/src/core/toolOperation/rectOperation.ts | 8 ++++---- .../toolFooter/FooterTips/ToolHotKey/pointCloud/index.tsx | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/lb-annotation/src/constant/keyCode.ts b/packages/lb-annotation/src/constant/keyCode.ts index 43a3b04cc..251b79bcf 100644 --- a/packages/lb-annotation/src/constant/keyCode.ts +++ b/packages/lb-annotation/src/constant/keyCode.ts @@ -17,11 +17,10 @@ enum EKeyCode { Y = 89, S = 83, Q = 81, + P = 80, One = 49, Two = 50, Three = 51, - Four = 52, - NumberFour = 100, Delete = 46, F11 = 122, Space = 32, diff --git a/packages/lb-annotation/src/core/toolOperation/pointCloud2DRectOperation.ts b/packages/lb-annotation/src/core/toolOperation/pointCloud2DRectOperation.ts index c1e592503..78bf48355 100644 --- a/packages/lb-annotation/src/core/toolOperation/pointCloud2DRectOperation.ts +++ b/packages/lb-annotation/src/core/toolOperation/pointCloud2DRectOperation.ts @@ -58,7 +58,7 @@ class PointCloud2DRectOperation extends RectOperation { } public onKeyDown(e: KeyboardEvent) { - if (this.checkMode || ![EKeyCode.Delete, EKeyCode.Four, EKeyCode.NumberFour].includes(e.keyCode)) { + if (this.checkMode || ![EKeyCode.Delete, EKeyCode.P].includes(e.keyCode)) { return; } diff --git a/packages/lb-annotation/src/core/toolOperation/rectOperation.ts b/packages/lb-annotation/src/core/toolOperation/rectOperation.ts index 77b82aa92..fa0107477 100644 --- a/packages/lb-annotation/src/core/toolOperation/rectOperation.ts +++ b/packages/lb-annotation/src/core/toolOperation/rectOperation.ts @@ -1325,7 +1325,7 @@ class RectOperation extends BasicToolOperation { return; } - const { keyCode, ctrlKey } = e; + const { keyCode, ctrlKey, altKey, shiftKey, metaKey } = e; switch (keyCode) { case EKeyCode.Ctrl: if (this.drawingRect) { @@ -1392,9 +1392,9 @@ class RectOperation extends BasicToolOperation { break; } - case EKeyCode.Four: - case EKeyCode.NumberFour: { - if (ctrlKey) { + case EKeyCode.P: { + // Isolation combination key + if (!ctrlKey && !altKey && !shiftKey && !metaKey) { this.resizeRect(); } break; diff --git a/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.tsx b/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.tsx index 9f5f49288..b04f19a02 100644 --- a/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.tsx +++ b/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.tsx @@ -197,7 +197,7 @@ const DeletePoint = { const Image2DBoxScale = { name: 'Image2DBoxScale', icon: Image2DBoxScaleSvg, - shortCut: ['Ctrl', '4'], + shortCut: ['P'], noticeInfo: 'SelectedRect', };