Skip to content

Commit

Permalink
🐛 中文输入法顿号
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Dec 8, 2023
1 parent 6bafc1b commit 869c913
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/src/protyle/wysiwyg/keydown.ts
Expand Up @@ -145,10 +145,18 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
return;
}
// https://github.com/siyuan-note/siyuan/issues/2261
if (isNotCtrl(event) && !event.shiftKey && !event.altKey) {
if (Constants.KEYCODELIST[event.keyCode] === "/") {
if (!["⌘", "⇧", "⌥", "⌃"].includes(Constants.KEYCODELIST[event.keyCode])) {
if (Constants.KEYCODELIST[event.keyCode] === "/" ||
// 德语
event.key === "/" ||
// windows 中文
(event.code === "Slash" && event.key === "Process" && event.keyCode === 229)) {
protyle.hint.enableSlash = true;
} else if (Constants.KEYCODELIST[event.keyCode] === "\\") {
} else if (Constants.KEYCODELIST[event.keyCode] === "\\" ||
// 德语
event.key === "\\" ||
// windows 中文
(event.code === "Backslash" && event.key === "Process" && event.keyCode === 229)) {
protyle.hint.enableSlash = false;
hideElements(["hint"], protyle);
// 此处不能返回,否则无法撤销 https://github.com/siyuan-note/siyuan/issues/2795
Expand Down

0 comments on commit 869c913

Please sign in to comment.