mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 19:30:17 +08:00
feat: 允许功能键(F1-F19)可以被设置为快捷键而不需要修饰键
This commit is contained in:
parent
e4aa2633d1
commit
6541b0b35c
@ -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 => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user