mirror of
https://github.com/lwouis/alt-tab-macos.git
synced 2026-05-24 11:20:36 +00:00
feat: allow next-window shortcut without modifiers (closes #5433)
This commit is contained in:
@@ -49,6 +49,13 @@ class ATShortcut {
|
||||
}
|
||||
// other shortcuts: contains exactly or exactly + holdShortcut modifiers
|
||||
let holdModifiersCleaned = ControlsTab.shortcuts[Preferences.indexToName("holdShortcut", App.shortcutIndex)]?.shortcut.carbonModifierFlags.cleaned() ?? 0
|
||||
// nextWindowShortcut when panel is open: also match base key without holdShortcut modifiers
|
||||
if App.appIsBeingUsed && id.hasPrefix("nextWindowShortcut") {
|
||||
let baseModifiersCleaned = shortcutModifiersCleaned & ~holdModifiersCleaned
|
||||
if modifiersCleaned == baseModifiersCleaned {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return modifiersCleaned == shortcutModifiersCleaned || modifiersCleaned == (shortcutModifiersCleaned | holdModifiersCleaned)
|
||||
}
|
||||
|
||||
|
||||
@@ -116,13 +116,7 @@ class ControlsTab {
|
||||
static var shortcuts = [String: ATShortcut]()
|
||||
static var shortcutControls = [String: (CustomRecorderControl, String)]()
|
||||
static var shortcutsActions = [
|
||||
"holdShortcut": { App.focusTarget() },
|
||||
"holdShortcut2": { App.focusTarget() },
|
||||
"holdShortcut3": { App.focusTarget() },
|
||||
"focusWindowShortcut": { App.focusTarget() },
|
||||
"nextWindowShortcut": { App.showUiOrCycleSelection(0, false) },
|
||||
"nextWindowShortcut2": { App.showUiOrCycleSelection(1, false) },
|
||||
"nextWindowShortcut3": { App.showUiOrCycleSelection(2, false) },
|
||||
"previousWindowShortcut": { App.previousWindowShortcutWithRepeatingKey() },
|
||||
"→": { App.cycleSelection(.right) },
|
||||
"←": { App.cycleSelection(.left) },
|
||||
|
||||
Reference in New Issue
Block a user