Repository navigation
feat: system-wide shortcuts with desktop_system_key - #54
Merged
Merged
Conversation
iamnbutler
force-pushed
the
feat/system-key
branch
from
October 17, 2026 02:52
a0c37fc to
34447cc
Compare
desktop_key refused every snapshot without a unique observed focused control, so Escape, arrows, Return, Space and shortcuts in Finder lists, outlines, tables, canvases and web areas could not be sent (#13). Without a focused-control receipt the key now uses the exact-window hotkey with no expected element. Before each event the host still requires the app's focused element to lie inside the exact window and that window to be the app's key window with no attached sheet, with the same process generation and bounds. The result's receiver says which binding was used: observed_control or window_focus. desktop_insert still needs an observed text control. Closes #13 Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
iamnbutler
force-pushed
the
feat/system-key
branch
from
October 17, 2026 03:02
34447cc to
97e13f0
Compare
Merged
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.
Stacked on #51 (rebased onto it after #52 merged). The first commit here is #51's and drops out once #51 merges.
Some shortcuts belong to macOS, not to any window: Spotlight, Command-Tab, Mission Control, the screenshot tools, and input-source switching.
desktop_keycan't send them, because it is bound to one exact window. This adds a separate, explicit tool for them.Change
desktop_system_key { key, modifiers? }. It takes no snapshot and no target. Keys and modifiers work as indesktop_key: named keys, or one layout character. Characters that need Shift or Option are still refused by the layout patch on the host..hotkeyop, which is now in the runtime'sallowedOperations.synthFirststrategy, the op posts ordinary keyboard events to.cghidEventTap. They reach whatever is frontmost, as if typed.unknownafter dispatch, with a message to observe with desktop_screen, desktop_apps or desktop_windows and not to repeat the shortcut (many toggle). Nothing reads back an effect.refusedhappens only before dispatch.CGSSessionScreenIsLocked), likedesktop_menu..hotkey, which covers a stale /Applications runtime.serviceKey,keyboardModifiers,semanticShortcutsandActionErrorinactions.swiftloseprivateso the newsystemkey.swiftcan reuse them. Thekeyandmodifiersschemas are shared intools.ts.Known limits (accepted by the lead)
.hotkeyonly from our own signed client, so a client the host trusts can still send these chords globally.actionFirst, Peekaboo first tries the frontmost app's menu item for the chord. For example, Command-Space could press an app menu item instead of opening Spotlight.native_outcomeshows the mechanism used, and the result isunknowneither way.Verified here (dev app,
DESKTOP_TOOLS_STATE=/tmp/f7/state; /Applications untouched)?→ refused with "The macOS GUI session is locked. No key was sent." These requests passed the handshake's.hotkeyallowlist check first.npm run checkpasses, and the native build is green.Live checks (pending: screen locked)
command+space→unknown; desktop_screen shows Spotlight.escapecloses it.command+tab→ the frontmost app changes (desktop_apps).control+up→ Mission Control opens;escapecloses it.command+shift+5→ the screenshot toolbar opens;escapedismisses it. (command+shift+4+escapetoo.)control+space→ the input source changes, if more than one is enabled. Send it again to switch back./+shifton a US layout sends?.?alone is refused by the host, with the hint to use/with shift.native_outcomereportsglobalEvents/foregrounddelivery.🤖 Generated with Claude Code