Skip to content

Commit 66c2a9a

Browse files
committed
🚸 优化mac在command+v粘贴内容进来时,左下角显示meta v持续按下的情况
1 parent 14dd590 commit 66c2a9a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/core/service/dataManageService/copyEngine/copyEngine.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Serialized } from "../../../../types/node";
2+
import { isMac } from "../../../../utils/platform";
23
import { Rectangle } from "../../../dataStruct/shape/Rectangle";
34
import { Vector } from "../../../dataStruct/Vector";
45
import { Renderer } from "../../../render/canvas2d/renderer";
@@ -8,6 +9,7 @@ import { StageManager } from "../../../stage/stageManager/StageManager";
89
import { Entity } from "../../../stage/stageObject/abstract/StageEntity";
910
import { ImageNode } from "../../../stage/stageObject/entity/ImageNode";
1011
import { TextNode } from "../../../stage/stageObject/entity/TextNode";
12+
import { Controller } from "../../controlService/controller/Controller";
1113
import { MouseLocation } from "../../controlService/MouseLocation";
1214
import { copyEnginePasteImage } from "./pasteImage";
1315
import { copyEnginePastePlainText } from "./pastePlainText";
@@ -149,6 +151,14 @@ export namespace CopyEngine {
149151
} else {
150152
StageSerializedAdder.addSerializedData(copyBoardData, copyBoardMouseVector);
151153
}
154+
if (isMac) {
155+
// mac下无法直接粘贴,还要点一个按钮,但这导致
156+
// 按下按钮后,程序中依然显示 meta v 仍然在按下状态
157+
// 因此需要主动删除
158+
setTimeout(() => {
159+
Controller.pressingKeySet.clear();
160+
}, 500);
161+
}
152162
}
153163

154164
export function pasteWithOriginLocation() {

0 commit comments

Comments
 (0)