From aca9d34a46004f2da207f7127f69430e4e59ab25 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Sat, 1 Jun 2024 11:31:33 +0800 Subject: [PATCH] fix: some shortcut keys with shift are invalid #629 --- src/editor/core/shortcut/Shortcut.ts | 2 +- src/editor/core/shortcut/keys/richtextKeys.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor/core/shortcut/Shortcut.ts b/src/editor/core/shortcut/Shortcut.ts index 86ae425..66aa503 100644 --- a/src/editor/core/shortcut/Shortcut.ts +++ b/src/editor/core/shortcut/Shortcut.ts @@ -67,7 +67,7 @@ export class Shortcut { evt.metaKey === !!shortCut.meta) && evt.shiftKey === !!shortCut.shift && evt.altKey === !!shortCut.alt && - evt.key === shortCut.key + evt.key.toLowerCase() === shortCut.key.toLowerCase() ) { if (!shortCut.disable) { shortCut?.callback?.(this.command) diff --git a/src/editor/core/shortcut/keys/richtextKeys.ts b/src/editor/core/shortcut/keys/richtextKeys.ts index 6e97a31..d4c3306 100644 --- a/src/editor/core/shortcut/keys/richtextKeys.ts +++ b/src/editor/core/shortcut/keys/richtextKeys.ts @@ -5,7 +5,7 @@ import { isApple } from '../../../utils/ua' export const richtextKeys: IRegisterShortcut[] = [ { - key: KeyMap.X_UPPERCASE, + key: KeyMap.X, ctrl: true, shift: true, callback: (command: Command) => {