feat: allow next-window shortcut without modifiers (closes #5433)

This commit is contained in:
lwouis
2026-03-19 21:10:46 +01:00
parent 4502e8bd15
commit 15ede93868
2 changed files with 7 additions and 6 deletions
+7
View File
@@ -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) },