Skip to content

Commit

Permalink
fix: space transition sometimes absorbed the shortcut (closes #588)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Oct 6, 2020
1 parent ec7b69f commit 5e6a0c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/logic/ATShortcut.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class ATShortcut {
state = state == .down ? .up : .down
if state == .up {
KeyRepeatTimer.timer?.invalidate()
} else {
// macOS bug: the app doesn't receive either local or global modifierChanged events during Space transition
// we force holdShortcut to be .down if nextWindowShortcut trigger during a transition, since we know it has to be down at that point
let suffix = shortcutId == "nextWindowShortcut" ? "" : "2"
ControlsTab.shortcuts["holdShortcut" + suffix]!.state = .down
}
if (triggerPhase == .down && shortcutState == .down) || (triggerPhase == .up && shortcutState == .up) {
return true
Expand Down

0 comments on commit 5e6a0c2

Please sign in to comment.