Skip to content

Commit

Permalink
🐛 #314 Fix small regression
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed May 24, 2024
1 parent a0f88c8 commit b495ea5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Loop/Managers/LoopManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,12 @@ class LoopManager: ObservableObject {
let wasKeyDown = (event.type == .keyDown || currentlyPressedModifiers.count > previousModifiers.count)

if wasKeyDown, triggerKey.isSubset(of: currentlyPressedModifiers) {
guard !isLoopActive else {
guard
!isLoopActive,

// This makes sure that the amount of keys being pressed is not more than the actual trigger key
currentlyPressedModifiers.count <= triggerKey.count
else {
return
}

Expand All @@ -323,9 +328,7 @@ class LoopManager: ObservableObject {
}
lastTriggerKeyClick = .now
} else {
if isLoopActive {
closeLoop()
}
closeLoop()
}
}

Expand Down Expand Up @@ -382,6 +385,8 @@ class LoopManager: ObservableObject {
}

private func closeLoop(forceClose: Bool = false) {
guard isLoopActive == true else { return }

triggerDelayTimer = nil
closeWindows()

Expand Down

0 comments on commit b495ea5

Please sign in to comment.