mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-22 20:07:42 +02:00
fix: recognize function keys F1–F24 when assigning hotkeys (#2157)
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 <noreply@anthropic.com>
This commit is contained in:
@@ -61,6 +61,10 @@ export const keyboardCodeToHotkeyKey = (code: string): null | string => {
|
|||||||
return code.slice(5);
|
return code.slice(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (/^F([1-9]|1\d|2[0-4])$/.test(code)) {
|
||||||
|
return code.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
if (code.startsWith('Numpad')) {
|
if (code.startsWith('Numpad')) {
|
||||||
const suffix = code.slice(6);
|
const suffix = code.slice(6);
|
||||||
const numpadMapped = NUMPAD_CODE_TO_HOTKEY_KEY[suffix];
|
const numpadMapped = NUMPAD_CODE_TO_HOTKEY_KEY[suffix];
|
||||||
|
|||||||
Reference in New Issue
Block a user