mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
feat: 快捷键增加 Meta 键支持
This commit is contained in:
@@ -6,6 +6,7 @@ const logger = getLogger('shortcut')
|
||||
|
||||
const isMacOS = env.isMacOS
|
||||
export const Ctrl = 'Ctrl'
|
||||
export const Meta = 'Meta'
|
||||
export const CtrlCmd = 'CtrlCmd'
|
||||
export const Alt = 'Alt'
|
||||
export const Shift = 'Shift'
|
||||
@@ -57,6 +58,10 @@ export const matchKeys = (e: KeyboardEvent | MouseEvent, keys: (string | number)
|
||||
modifiers.ctrlKey = true
|
||||
if (!e.ctrlKey) return false
|
||||
break
|
||||
case Meta:
|
||||
modifiers.metaKey = true
|
||||
if (!e.ctrlKey) return false
|
||||
break
|
||||
case Shift:
|
||||
modifiers.shiftKey = true
|
||||
if (!e.shiftKey) return false
|
||||
|
||||
Reference in New Issue
Block a user