-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: default value in short cut * refactor: delete unused file * Revert "refactor: delete unused file" This reverts commit 3a2d734. * Revert "fix: default value in short cut" This reverts commit fdfe495. * Add default shortcut * split `setDefaultForAppShortcut` into 2 method * fix: default value in short cut * refactor: delete unused file * Revert "refactor: delete unused file" This reverts commit 3a2d734. * Revert "fix: default value in short cut" This reverts commit fdfe495. * Add default shortcut * split `setDefaultForAppShortcut` into 2 method * Revert "chore: update issue templates" This reverts commit 033e391. * fix: correct default global shortcut keys --------- Co-authored-by: tisfeng <[email protected]>
- Loading branch information
1 parent
033e391
commit 319fc48
Showing
6 changed files
with
86 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// Shortcut+Default.swift | ||
// Easydict | ||
// | ||
// Created by Sharker on 2024/2/5. | ||
// Copyright © 2024 izual. All rights reserved. | ||
// | ||
|
||
import Defaults | ||
import Magnet | ||
|
||
extension Shortcut { | ||
// set defalut for app shortcut | ||
func setDefaultForShortcut() { | ||
setDefaultForGlobalShortcut() | ||
setDefaultForAppShortcut() | ||
} | ||
|
||
private func setDefaultForGlobalShortcut() { | ||
Defaults[.inputShortcut] = KeyCombo(key: .a, cocoaModifiers: .option) | ||
Defaults[.snipShortcut] = KeyCombo(key: .s, cocoaModifiers: .option) | ||
Defaults[.selectionShortcut] = KeyCombo(key: .d, cocoaModifiers: .option) | ||
Defaults[.showMiniWindowShortcut] = KeyCombo(key: .f, cocoaModifiers: .option) | ||
Defaults[.screenshotOCRShortcut] = KeyCombo(key: .s, cocoaModifiers: [.option, .shift]) | ||
} | ||
|
||
private func setDefaultForAppShortcut() { | ||
setDefaultForGlobalShortcut() | ||
|
||
Defaults[.clearInputShortcut] = KeyCombo(key: .k, cocoaModifiers: .command) | ||
Defaults[.clearAllShortcut] = KeyCombo(key: .k, cocoaModifiers: [.command, .shift]) | ||
Defaults[.copyShortcut] = KeyCombo(key: .c, cocoaModifiers: [.command, .shift]) | ||
Defaults[.copyFirstResultShortcut] = KeyCombo(key: .j, cocoaModifiers: [.command, .shift]) | ||
Defaults[.focusShortcut] = KeyCombo(key: .i, cocoaModifiers: .command) | ||
Defaults[.playShortcut] = KeyCombo(key: .s, cocoaModifiers: .command) | ||
Defaults[.retryShortcut] = KeyCombo(key: .r, cocoaModifiers: .command) | ||
Defaults[.toggleShortcut] = KeyCombo(key: .t, cocoaModifiers: .command) | ||
Defaults[.pinShortcut] = KeyCombo(key: .p, cocoaModifiers: .command) | ||
Defaults[.hideShortcut] = KeyCombo(key: .y, cocoaModifiers: .command) | ||
Defaults[.increaseFontSize] = KeyCombo(key: .keypadPlus, cocoaModifiers: .command) | ||
Defaults[.decreaseFontSize] = KeyCombo(key: .keypadMinus, cocoaModifiers: .command) | ||
Defaults[.googleShortcut] = KeyCombo(key: .return, cocoaModifiers: .command) | ||
Defaults[.eudicShortcut] = KeyCombo(key: .return, cocoaModifiers: [.command, .shift]) | ||
Defaults[.appleDictionaryShortcut] = KeyCombo(key: .d, cocoaModifiers: [.command, .shift]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters