From ab51d8e5654419d354fa8b5dc861a905a0a25f94 Mon Sep 17 00:00:00 2001 From: mattuy Date: Thu, 7 Oct 2021 15:04:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=BF=9E=E9=9F=B3?= =?UTF-8?q?=E7=BA=BF=E5=BF=AB=E6=8D=B7=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/menu/editor.js | 27 +++++++++++++++++++++++++++ src/view/HelpModal/index.js | 7 +++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/menu/editor.js b/src/menu/editor.js index 13bb9d6..3ab100a 100644 --- a/src/menu/editor.js +++ b/src/menu/editor.js @@ -15,6 +15,7 @@ import { createNotation, isNote, notations as N, + placeTie, } from "../util/notation"; import { cloneParagraph, @@ -179,6 +180,32 @@ const handleKeyPress = wrappedAction((ev) => { } break; } + case inputKey === "a" && !ctrl && !shift: { + if (!state.tieSourceKey) { + state.tieSourceKey = notation.key; + } else if (state.tieSourceKey === notation.key) { + state.tieSourceKey = null; + } else { + placeTie(notation); + } + break; + } + case inputKey === "a" && !ctrl && shift: { + if (notation.tieTo) { + const { notation: tieDesc } = findParagraphAndNotation( + notation.tieTo + ); + if (tieDesc) { + tieDesc.tieTo = null; + } + notation.tieTo = null; + break; + } + } + case inputKey === "!" && !ctrl: { + notation.breakUnderline = !notation.breakUnderline; + break; + } case inputKey === "~" && !ctrl: { if (notation.topDecorators.includes("~")) { notation.topDecorators.splice(notation.topDecorators.indexOf("~"), 1); diff --git a/src/view/HelpModal/index.js b/src/view/HelpModal/index.js index 5490cd2..9430d9a 100644 --- a/src/view/HelpModal/index.js +++ b/src/view/HelpModal/index.js @@ -44,14 +44,17 @@ function HelpModal({ visible, onVisibleChange }) { 直接按键盘上相应的键即可输入到当前符号。支持的音符符号有:

0~7 - ( ) + ─ ( )

输入辅助元素