Skip to content

feat(os): Windows keystroke injection + window enumeration#20

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

feat(os): Windows keystroke injection + window enumeration#20
statik merged 1 commit into
claude/tauri-migration-self-update-74d57gfrom
claude/step-8-win-injector

Conversation

@statik

@statik statik commented Jun 21, 2026

Copy link
Copy Markdown
Member

Step 8 of the Tauri/Rust migration

First real per-OS adapter: Windows keystroke injection + window enumeration (port of injector_windows.go + keymap_windows.go), behind cfg(windows) with a no-op fallback elsewhere.

What's here

  • injector::keymap_windows — pure VK-code / modifier / extended-key mapping (unit-tested; runs on the Windows CI runner).
  • injector::windows_impl::WinInput (via the windows crate):
    • FocusSetForegroundWindow with the AttachThreadInput + foreground-lock-timeout workaround, restoring minimized windows.
    • SendKeysSendInput when the target is foreground (carries modifiers), PostMessage WM_KEYDOWN/UP when background (focus-preserving), matching the Go delivery-path logic.
    • OpenWindowsEnumWindows + Toolhelp pid→exe-name map.
  • injector::{injector, enumerator, request_accessibility} composition entry points; non-Windows returns a no-op injector/enumerator (the macOS Accessibility impl follows in the next step).
  • Adds the windows crate as a cfg(windows)-only dependency (the Linux CI compile is unaffected).

Verification

This is OS FFI, so behavior is validated on hardware via #11 — but compilation is verified here: I cross-checked locally with cargo check/cargo clippy --target x86_64-pc-windows-gnu (the real FFI path) and aarch64-apple-darwin + Linux (the no-op path). Workspace fmt/clippy -D warnings/tests green; the CI matrix re-verifies all three.

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


Generated by Claude Code

Port injector_windows.go + keymap_windows.go into hyperdeck-os behind
cfg(windows), with a no-op fallback elsewhere:

- injector::keymap_windows: pure VK-code / modifier / extended-key mapping
  (unit-tested)
- injector::windows_impl::WinInput (windows crate): Focus (SetForegroundWindow
  with the AttachThreadInput + foreground-lock-timeout dance), SendKeys
  (SendInput when the target is foreground, PostMessage WM_KEYDOWN/UP when
  background), and OpenWindows (EnumWindows + Toolhelp pid->exe names)
- injector::{injector, enumerator, request_accessibility} composition entry
  points; non-Windows returns a no-op injector/enumerator (macOS impl follows)

Adds the windows crate as a cfg(windows)-only dependency. Verified locally
with `cargo check/clippy --target x86_64-pc-windows-gnu` (real FFI) and the
apple-darwin + linux targets (no-op path); workspace fmt/clippy/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 d3be840 into claude/tauri-migration-self-update-74d57g Jun 21, 2026
5 checks passed
@statik
statik deleted the claude/step-8-win-injector branch June 21, 2026 14:22
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