diff --git a/Easydict/NewApp/Feature/Shortcut/Shortcut+Default.swift b/Easydict/NewApp/Feature/Shortcut/Shortcut+Default.swift index 2d3079f8b..8dbcaba42 100644 --- a/Easydict/NewApp/Feature/Shortcut/Shortcut+Default.swift +++ b/Easydict/NewApp/Feature/Shortcut/Shortcut+Default.swift @@ -11,12 +11,21 @@ import Magnet extension Shortcut { // set defalut for app shortcut - func setDefaultForAppShortcut() { + func setDefaultForShortcut() { + setDefaultForGlobalShortcut() + setDefaultForAppShortcut() + } + + private func setDefaultForGlobalShortcut() { Defaults[.selectionShortcut] = KeyCombo(key: .d, cocoaModifiers: .option) Defaults[.snipShortcut] = KeyCombo(key: .s, cocoaModifiers: .option) Defaults[.inputShortcut] = KeyCombo(key: .a, cocoaModifiers: .option) Defaults[.screenshotOCRShortcut] = KeyCombo(key: .f, cocoaModifiers: [.option, .shift]) Defaults[.showMiniWindowShortcut] = KeyCombo(key: .s, cocoaModifiers: .option) + } + + private func setDefaultForAppShortcut() { + setDefaultForGlobalShortcut() Defaults[.clearInputShortcut] = KeyCombo(key: .k, cocoaModifiers: .command) Defaults[.clearAllShortcut] = KeyCombo(key: .k, cocoaModifiers: [.command, .shift]) diff --git a/Easydict/NewApp/Feature/Shortcut/Shortcut.swift b/Easydict/NewApp/Feature/Shortcut/Shortcut.swift index c08c2dc2a..78b54d58f 100644 --- a/Easydict/NewApp/Feature/Shortcut/Shortcut.swift +++ b/Easydict/NewApp/Feature/Shortcut/Shortcut.swift @@ -103,7 +103,7 @@ class Shortcut: NSObject { if Defaults[.firstLaunch] { Defaults[.firstLaunch] = false // set defalut for app shortcut - shortcut.setDefaultForAppShortcut() + shortcut.setDefaultForShortcut() } else { // do nothing }