From 6541b0b35c1e049f03c7eb4c6f7e3047292f191a Mon Sep 17 00:00:00 2001 From: xixiaxixi <380639414@qq.com> Date: Sun, 20 Apr 2025 00:13:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=81=E8=AE=B8=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E9=94=AE(F1-F19)=E5=8F=AF=E4=BB=A5=E8=A2=AB=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA=E5=BF=AB=E6=8D=B7=E9=94=AE=E8=80=8C=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E4=BF=AE=E9=A5=B0=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/pages/settings/ShortcutSettings.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/pages/settings/ShortcutSettings.tsx b/src/renderer/src/pages/settings/ShortcutSettings.tsx index e08dc14849..d392fee3eb 100644 --- a/src/renderer/src/pages/settings/ShortcutSettings.tsx +++ b/src/renderer/src/pages/settings/ShortcutSettings.tsx @@ -58,8 +58,9 @@ const ShortcutSettings: FC = () => { const isValidShortcut = (keys: string[]): boolean => { const hasModifier = keys.some((key) => ['Control', 'Ctrl', 'Command', 'Alt', 'Shift'].includes(key)) const hasNonModifier = keys.some((key) => !['Control', 'Ctrl', 'Command', 'Alt', 'Shift'].includes(key)) + const hasFnKey = keys.some((key) => /^F\d+$/.test(key)) - return hasModifier && hasNonModifier && keys.length >= 2 + return (hasModifier && hasNonModifier && keys.length >= 2) || hasFnKey } const isDuplicateShortcut = (newShortcut: string[], currentKey: string): boolean => {