From c301b14cb3f0a1d35004c56226ac14bdb166a72f Mon Sep 17 00:00:00 2001 From: Ryan Kupka <34145544+ryankupk@users.noreply.github.com> Date: Wed, 17 Jun 2026 01:54:39 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20recognize=20function=20keys=20F1?= =?UTF-8?q?=E2=80=93F24=20when=20assigning=20hotkeys=20(#2157)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit keyboardCodeToHotkeyKey had branches for Key*, Digit*, and Numpad* codes but none for function keys, so KeyboardEvent.code values "F1".."F24" returned null and the hotkey capture handler silently dropped them. This made every function key unassignable (not just F13+ such as F21/F22). Co-authored-by: Claude Opus 4.8 --- src/shared/utils/keyboard-code-to-hotkey.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/utils/keyboard-code-to-hotkey.ts b/src/shared/utils/keyboard-code-to-hotkey.ts index a9d3f9f0f..e25ffe244 100644 --- a/src/shared/utils/keyboard-code-to-hotkey.ts +++ b/src/shared/utils/keyboard-code-to-hotkey.ts @@ -61,6 +61,10 @@ export const keyboardCodeToHotkeyKey = (code: string): null | string => { return code.slice(5); } + if (/^F([1-9]|1\d|2[0-4])$/.test(code)) { + return code.toLowerCase(); + } + if (code.startsWith('Numpad')) { const suffix = code.slice(6); const numpadMapped = NUMPAD_CODE_TO_HOTKEY_KEY[suffix];