Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: https://github.com/siyuan-note/siyuan/issues/5958

Liang Ding5ea91f3824c5
diff --git a/app/src/protyle/util/hotKey.ts b/app/src/protyle/util/hotKey.ts
index 074f098759..30225f70c5 100644
--- a/app/src/protyle/util/hotKey.ts
+++ b/app/src/protyle/util/hotKey.ts
@@ -90,7 +90,8 @@ export const matchHotKey = (hotKey: string, event: KeyboardEvent) => {
const hasShift = hotKeys.length > 2 && (hotKeys[0] === "⇧");
if (isCtrl(event) && !event.altKey && ((!hasShift && !event.shiftKey) || (hasShift && event.shiftKey))) {
const keyCode = (hasShift ? hotKeys[2] : hotKeys[1]);
- let isMatchKey = event.key.toLowerCase() === keyCode.toLowerCase();
+ let isMatchKey = (/^[0-9]$/.test(keyCode) ? (event.code === "Digit" + keyCode || event.code === "Numpad" + keyCode) : event.code === "Key" + keyCode) ||
+ event.code === keyCode || event.key.toLowerCase() === keyCode.toLowerCase();
// 更新 electron 后不需要判断 Mac,但 Mac 下中英文有区别,需使用 keyCode 辅助
if (Constants.KEYCODE[event.keyCode]) {
if (event.shiftKey) {