@@ -152,8 +152,10 @@ final class KeybindTrigger {
152152 private func performKeybind( keyCode: CGKeyCode , type: CGEventType , isARepeat: Bool , flags: CGEventFlags , isLoopOpen: Bool ) -> PerformKeybindResult {
153153 let flagKeys = sideDependentTriggerKey ? flags. keyCodes : flags. keyCodes. baseModifiers
154154 let allPressedKeys : Set < CGKeyCode > = pressedKeys. union ( flagKeys)
155+
155156 let actionKeys : Set < CGKeyCode > = Set ( allPressedKeys. subtracting ( triggerKey) . map ( \. baseModifier) )
156157 let containsTrigger = allPressedKeys. isSuperset ( of: triggerKey)
158+ let allPressedKeysBaseModifiers : Set < CGKeyCode > = Set ( allPressedKeys. map ( \. baseModifier) )
157159
158160 if isLoopOpen {
159161 if pressedKeys. contains ( . kVK_Escape) {
@@ -172,19 +174,10 @@ final class KeybindTrigger {
172174 }
173175
174176 if type != . keyUp { // keyDown for flagsChanged
175- if let bypassedAction = windowActionCache. bypassedActionsByKeybind [ allPressedKeys] {
176- if !isARepeat || bypassedAction. canRepeat {
177- openLoop ( startingAction: bypassedAction, overrideExistingTriggerDelayTimerAction: true )
178- }
179-
180- return checkIfLoopOpen ( ) ? . consume : . opening
181- }
182-
183177 if containsTrigger {
184178 // Try an match directly with the action keys first, then fallback to just the key code.
185179 // This prevents failures when the user is tapping the keys in rapid succession.
186- let match = windowActionCache. actionsByKeybind [ actionKeys]
187- ?? windowActionCache. actionsByKeybind [ [ keyCode] ]
180+ let match = windowActionCache. actionsByKeybind [ actionKeys] ?? windowActionCache. actionsByKeybind [ [ keyCode] ]
188181
189182 if let action = match {
190183 if !isARepeat || action. canRepeat {
@@ -204,6 +197,12 @@ final class KeybindTrigger {
204197 )
205198 return . opening
206199 }
200+ } else if let bypassedAction = windowActionCache. bypassedActionsByKeybind [ allPressedKeysBaseModifiers] {
201+ if !isARepeat || bypassedAction. canRepeat {
202+ openLoop ( startingAction: bypassedAction, overrideExistingTriggerDelayTimerAction: true )
203+ }
204+
205+ return checkIfLoopOpen ( ) ? . consume : . opening
207206 } else {
208207 if allPressedKeys. isEmpty {
209208 doubleClickTimer. handleKeyUp ( )
0 commit comments