Windows support + platform refactoring #1

Merged
Makatorama merged 20 commits from cross/windows into main 2026-07-09 14:46:24 +07:00
Owner

Windows: listener via rdev::listen, layout via Win32 API, Unicode text injection.
Linux: refactored evdev listener + D-Bus into platform/linux.rs.

CI: windows check + release workflows, scripts/release.sh/.ps1 extracted.

Windows: listener via rdev::listen, layout via Win32 API, Unicode text injection. Linux: refactored evdev listener + D-Bus into platform/linux.rs. CI: windows check + release workflows, scripts/release.sh/.ps1 extracted.
cross: windows support + platform module refactor
Some checks failed
windows / check (push) Failing after 4s
windows / release (push) Has been skipped
749795f512
- Cargo.toml: target-specific deps (evdev/enigo-wayland on Linux,
  plain enigo on Windows)
- src/listener.rs + src/platform.rs → src/platform/linux.rs
  (all Linux code unified under platform module)
- src/platform/mod.rs: conditional compilation entry point
- src/platform/windows.rs: listener (rdev::listen), layout detection
  (GetKeyboardLayout), layout switching (GetKeyboardLayoutList +
  ActivateKeyboardLayout), CAPTURE_ENABLED atomic to prevent
  feedback loop during correction
- src/correct.rs: platform-specific key injection via #[cfg]
  (raw evdev codes on Linux, enigo::text() on Windows)
- src/main.rs: listener::start → platform::start
- .forgejo/workflows/windows.yml: check + release jobs for
  cross/windows branch
ci: fix windows workflow
Some checks failed
windows / check (push) Failing after 4s
windows / release (push) Has been skipped
5ff39e1454
ci: fix windows workflow
Some checks failed
windows / check (push) Failing after 29s
windows / release (push) Has been skipped
f1746aa100
fix windows build: unsafe extern + unused variable
Some checks failed
windows / check (push) Failing after 26s
windows / release (push) Has been skipped
bb34f3226b
- windows.rs: mark extern block unsafe (Rust 2024 requirement)
- correct.rs: suppress unused target_map warning on Windows
fix windows warnings: dead_code on unused items
Some checks failed
windows / check (push) Failing after 26s
windows / release (push) Has been skipped
ad818afacb
- mapping.rs: char_to_key, key_for_char used only on Linux →
  cfg_attr(target_os = windows, allow(dead_code))
- windows.rs: rdev_to_evdev stub → allow(dead_code)
ci(windows): install mingw for dlltool
Some checks failed
windows / check (push) Failing after 2s
windows / release (push) Has been skipped
7e45d38085
- actions/checkout@v6 (align with check.yml)
- choco install mingw -y before cargo
ci(windows): fix checkout@v4 (node20, runner requires node<=22)
Some checks failed
windows / check (push) Failing after 1m1s
windows / release (push) Has been skipped
cd693edc96
ci(windows): remove choco install mingw (requires admin)
Some checks failed
windows / check (push) Successful in 39s
windows / release (push) Failing after 31s
check / check (push) Successful in 3m34s
check / release (push) Failing after 42s
fb90edc344
ci(windows): upload as keyswitch-x86_64-windows.exe
Some checks failed
windows / release (push) Has been skipped
windows / check (push) Successful in 39s
check / release (push) Has been cancelled
check / check (push) Has been cancelled
a801455960
ci(windows): use Invoke-WebRequest instead of curl alias
All checks were successful
windows / release (push) Successful in 49s
windows / check (push) Successful in 44s
check / check (push) Successful in 2m3s
check / release (push) Successful in 2m5s
2c34e7f28b
fix(windows): add sleep after set_capture + debug log in switch_layout
Some checks failed
windows / check (push) Successful in 43s
windows / release (push) Successful in 43s
check / check (push) Successful in 3m26s
check / release (push) Has been cancelled
45dae291b9
fix(release): don't delete existing release, share between linux/windows
Some checks failed
windows / release (push) Has been cancelled
check / release (push) Has been cancelled
check / check (push) Has been cancelled
windows / check (push) Has been cancelled
6e05c76b53
Both workflows now check if release for tag exists; if not, create it.
Each uploads its own asset (keyswitch / keyswitch-x86_64-windows.exe)
without deleting the other platform's assets.
fix(release): handle race condition on release creation
Some checks failed
windows / release (push) Has been cancelled
check / release (push) Has been cancelled
check / check (push) Has been cancelled
windows / check (push) Has been cancelled
f885e880bd
fix(windows): post WM_INPUTLANGCHANGEREQUEST to foreground window
All checks were successful
windows / release (push) Successful in 39s
windows / check (push) Successful in 40s
check / check (push) Successful in 3m25s
check / release (push) Successful in 3m18s
8a99b58d07
ActivateKeyboardLayout only changes layout for the calling thread,
not for the foreground window. Now also sends WM_INPUTLANGCHANGEREQUEST
to the foreground window via PostMessageW.
fix(windows): query foreground window's thread layout
All checks were successful
windows / release (push) Successful in 42s
windows / check (push) Successful in 39s
check / check (push) Successful in 3m33s
check / release (push) Successful in 2m5s
201129d443
get_current_layout() now calls GetWindowThreadProcessId to find
the foreground window's thread, then GetKeyboardLayout(tid) to
get the actual layout the user is typing in, not our daemon thread.
debug: add logs for enigo.text, switch result, and detection
All checks were successful
check / check (push) Successful in 2m3s
windows / release (push) Successful in 42s
windows / check (push) Successful in 44s
check / release (push) Successful in 2m7s
d56872f3de
Both workflows now check if an asset with the same name exists
in the release and delete it before uploading, so re-running
a tag updates the asset instead of failing.
ci: refactoring
Some checks failed
check / check (push) Successful in 2m5s
windows / release (push) Failing after 30s
windows / check (push) Successful in 57s
check / release (push) Successful in 2m2s
check / release (pull_request) Has been cancelled
check / check (pull_request) Has been cancelled
228cb87230
fix(release): correct asset delete URL (use release ID in path)
All checks were successful
check / check (pull_request) Successful in 2m0s
windows / release (push) Successful in 47s
windows / check (push) Successful in 47s
check / check (push) Successful in 1m56s
check / release (pull_request) Has been skipped
check / release (push) Successful in 2m12s
ee534f012d
ci: pipline rename
All checks were successful
windows / check (push) Successful in 49s
windows / release (push) Has been skipped
73a8bd3c23
Sign in to join this conversation.
No description provided.