Skip to content

Commit ff4f411

Browse files
committed
✨ 增加快捷键:在鼠标位置创建节点
1 parent ac824eb commit ff4f411

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

app/src/locales/zh_CN.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,11 @@ keyBinds:
671671
description: |
672672
按下后,在当前视野中心的位置创建一个文本节点
673673
等同于鼠标双击创建节点的功能
674+
createTextNodeFromMouseLocation:
675+
title: 创建文本节点
676+
description: |
677+
按下后,在鼠标悬浮位置创建一个文本节点
678+
等同于鼠标单击创建节点的功能
674679
createTextNodeFromSelectedTop:
675680
title: 在当前选中的节点正上方创建文本节点
676681
description: |
@@ -814,4 +819,5 @@ keyBinds:
814819
title: 涂鸦笔画变粗
815820
description: 按下后,笔画变粗
816821
penStrokeWidthDecrease:
817-
description: 按下后,笔画变细
822+
description: 按下后,笔画变细
823+

app/src/main.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,17 @@ async function registerKeyBinds() {
304304
Camera.speed = Vector.getZero();
305305
addTextNodeByLocation(Camera.location, true);
306306
});
307+
(
308+
await KeyBinds.create("createTextNodeFromMouseLocation", "insert", {
309+
control: false,
310+
alt: false,
311+
shift: true,
312+
})
313+
).down(() => {
314+
Camera.clearMoveCommander();
315+
Camera.speed = Vector.getZero();
316+
addTextNodeByLocation(Renderer.transformView2World(MouseLocation.vector()), true);
317+
});
307318

308319
(
309320
await KeyBinds.create("createTextNodeFromSelectedTop", "arrowup", {

0 commit comments

Comments
 (0)