~habibalamin/Commandeer

Fix Alfred swallowing space and triggering escape

This would probably happen with a lot of applications, but it was always
Alfred for me. It's been bugging me since the start, and the fix ends up
taking me 2 minutes to find the solution to, once I massively simplified
the callback and realised it wasn't the cause for this particular issue.

This is a correction to the initial arguments to `CGEvent.tapCreate`, to
specify that I want the event tap placed at the point where events enter
the login session, not an application, by which time a global hotkey may
have already handled an event or eaten it, nor the window server itself,
which solves the issue but requires the process to run as root.

https://developer.apple.com/documentation/coregraphics/cgeventtaplocation
1 files changed, 1 insertions(+), 1 deletions(-)

M Commandeer/AppDelegate.swift
M Commandeer/AppDelegate.swift => Commandeer/AppDelegate.swift +1 -1
@@ 38,7 38,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
      currentKeyDown.initialize(to: nil)

      let tap = CGEvent
        .tapCreate(tap: .cgAnnotatedSessionEventTap,
        .tapCreate(tap: .cgSessionEventTap,
                   place: .tailAppendEventTap,
                   options: .defaultTap,
                   eventsOfInterest: CGEventMask(