mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-05 04:19:02 +08:00
feat: 允许功能键(F1-F19)可以被设置为快捷键而不需要修饰键
This commit is contained in:
parent
cc89f5330a
commit
712bd11274
@ -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