fix: space transition sometimes absorbed the shortcut (closes #588)

This commit is contained in:
Louis Pontoise authored and lwouis committed 2020-10-07 02:10:30 +09:00
1 parent ec7b69f4fc
commit 5e6a0c2bb6
1 file changed
+5
+5
View File
@@ -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