mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-05-01 22:08:39 +03:00
macos: global keybind event tap only handles events when app is inactive
Fixes #2403
This commit is contained in:
@ -128,6 +128,11 @@ fileprivate func cgEventFlagsChangedHandler(
|
|||||||
// We only care about keydown events
|
// We only care about keydown events
|
||||||
guard type == .keyDown else { return result }
|
guard type == .keyDown else { return result }
|
||||||
|
|
||||||
|
// If our app is currently active then we don't process the key event.
|
||||||
|
// This is because we already have a local event handler in AppDelegate
|
||||||
|
// that processes all local events.
|
||||||
|
guard !NSApp.isActive else { return result }
|
||||||
|
|
||||||
// We need an app delegate to get the Ghostty app instance
|
// We need an app delegate to get the Ghostty app instance
|
||||||
guard let appDelegate = NSApplication.shared.delegate as? AppDelegate else { return result }
|
guard let appDelegate = NSApplication.shared.delegate as? AppDelegate else { return result }
|
||||||
guard let ghostty = appDelegate.ghostty.app else { return result }
|
guard let ghostty = appDelegate.ghostty.app else { return result }
|
||||||
|
Reference in New Issue
Block a user