Skip to content

feat(os): macOS keystroke injection + window enumeration#21

Merged
statik merged 1 commit into
claude/tauri-migration-self-update-74d57gfrom
claude/step-9-macos-injector-rebased
Jun 21, 2026
Merged

feat(os): macOS keystroke injection + window enumeration#21
statik merged 1 commit into
claude/tauri-migration-self-update-74d57gfrom
claude/step-9-macos-injector-rebased

Conversation

@statik

@statik statik commented Jun 21, 2026

Copy link
Copy Markdown
Member

Step 9 of the Tauri/Rust migration

macOS keystroke injection + window enumeration (port of injector_darwin.go, keymap_darwin.go, and cinject_darwin.m), behind cfg(target_os = "macos").

What's here

  • injector::keymap_darwin — pure kVK key codes + CGEventFlags modifier masks (unit-tested).
  • injector::macos_impl::MacInjector:
    • FocusNSRunningApplication::runningApplicationWithProcessIdentifier + activateWithOptions (objc2-app-kit).
    • SendKeysCGEvent keyboard events posted via CGEventPostToPid (background, focus-free injection — the app's core macOS behavior), with CGEventFlags for modifiers.
    • OpenWindowsCGWindowListCopyWindowInfo dictionaries → pid / owner / title.
  • request_accessibility() via AXIsProcessTrustedWithOptions (prompting), wired into the injector module's macOS dispatch.
  • macOS-only deps: core-graphics (with the elcapitan feature for post_to_pid), core-foundation, objc2-app-kit (with libc).

Verification

OS FFI → behavior validated on hardware via #10. Compilation verified locally with cargo check/clippy --target aarch64-apple-darwin (real FFI) and the x86_64-pc-windows-gnu + Linux targets; all three clippy-clean. The CI matrix re-verifies on real macOS/Windows/Linux runners.

Status

With this, both macOS and Windows injection + window enumeration are ported. Remaining: Windows UI Automation control, then the Tauri shell (tray + updater) and release workflow.

Part of: #10, #11, #12.


Generated by Claude Code

Port injector_darwin.go + keymap_darwin.go + cinject_darwin.m into
hyperdeck-os behind cfg(target_os = "macos"):

- injector::keymap_darwin: pure kVK key codes + CGEventFlags modifier
  masks (unit-tested)
- injector::macos_impl::MacInjector: Focus (NSRunningApplication activate
  by pid), SendKeys (CGEvent keyboard events posted via CGEventPostToPid
  for background, focus-free injection), OpenWindows (CGWindowList info
  dictionaries -> pid/owner/title)
- request_accessibility() via AXIsProcessTrustedWithOptions (prompting),
  wired into the injector module's macOS dispatch

Uses core-graphics (elcapitan feature for post_to_pid), core-foundation,
and objc2-app-kit (libc feature). Verified locally with
`cargo check/clippy --target aarch64-apple-darwin` plus the windows-gnu
and linux targets; all three clippy-clean, workspace tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R8X1NxFiaLGJzwUD5wgRTv
@statik
statik merged commit 6c0bdbf into claude/tauri-migration-self-update-74d57g Jun 21, 2026
5 checks passed
@statik
statik deleted the claude/step-9-macos-injector-rebased branch June 21, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants