Fix keyboard shortcuts while macOS Secure Input is active#1127
Closed
wolph wants to merge 1 commit into
Closed
Conversation
wolph
force-pushed
the
fix/secure-input-hotkeys
branch
2 times, most recently
from
July 22, 2026 17:43
b5df9b7 to
81bb47e
Compare
wolph
force-pushed
the
fix/secure-input-hotkeys
branch
from
July 22, 2026 18:05
81bb47e to
89a57e6
Compare
wolph
marked this pull request as ready for review
July 22, 2026 23:28
Owner
|
Hey @wolph, thanks for the PR! Unfortunately, we won't be able to review it until it complies with our AI Policy and follows our PR template. Historically, we've been more lenient with smaller PRs, but for larger ones like this, which require extensive testing and can take hours of maintainer time to review, we ask that contributors follow both requirements. Feel free to reopen the PR once those have been addressed. Thanks! |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
Loop currently discovers keyboard shortcuts through a
CGEventTap. When an application enables macOS Secure Input, ordinary keyboard events are no longer delivered to that event tap. Loop keeps running and the radial menu can still work, but keyboard shortcuts appear completely dead because their key-down events never reachKeybindTrigger.This is why the same shortcuts can continue to work in window managers that register global system hotkeys instead of relying exclusively on an event tap.
Fix
For shortcuts that can be represented as one ordinary key plus side-independent base modifiers, Loop now also registers a Carbon hotkey through
RegisterEventHotKey.The existing
CGEventTapremains the primary path for all other input. In particular, this PR does not move the radial menu, multi-key chords, or side-dependent modifier chords to Carbon. Those inputs retain their current behavior and limitations.The fallback is deliberately narrow:
EventTapThread, preserving the existing keybind execution contextAppDelegatealso skips normal application startup when loaded as an XCTest host. This prevents unit tests from showing Accessibility prompts or mutating the running applications TCC state.Scope
The production change is limited to:
KeybindTriggerThere are no changes to
LoopManager, trigger timers, general event-monitor classes, or application lifecycle coordination.Verification
Limitations
Carbon cannot represent every chord accepted by Loop. Shortcuts with multiple ordinary keys or side-dependent modifiers therefore remain on the event-tap path and can still be unavailable while Secure Input is active. This preserves existing semantics instead of silently broadening or changing those shortcuts.