Restore keyboard/mouse after controller use and preserve sampled short taps #146

Manually merged
github merged 2 commits from github-bot/gh-146 into gh-pr/146/base 2026-12-05 21:05:22 +00:00 AGit
Owner

@⁠yyc160 on GitHub · 2026-12-05 19:43 UTC · original
yyc160:fix/recover-mapped-input → main · +202 −49 · 4 files · 2 commits · merged 2026-12-05 21:02 UTC

Two ways mapped actions can disappear without a bad controls.ini:

  • auto used the process-lifetime "a pad has ever been used" diagnostic as an ownership decision. One input on a physical controller could permanently stop mapped KB/M and prevent mouse recapture. Use a short, per-slot activity timeout and forget disconnected devices. Explicit mnk keeps mapping; legacy pad behaviour is unchanged.
  • A title reading only the current pad state at 30 FPS can miss a sampled 16 ms button or trigger tap. Keep the digital edge for the intended pad until a successful current reading includes it, or for at most 100 ms. Axes and physical controller presses are not latched. Other devices' reads do not acknowledge this pad. Stop synthesising mapped input while prewarm or the F10 panel owns it.

No new default bindings, title hooks, vehicle mappings or camera algorithm. The existing controls.ini parser, right-stick smoothing, direct camera, world map and key-cap choices remain in place. A handoff clears pending direct camera motion as well as the stick filter.

Checks: cargo test --release --locked -p larp-hle --lib gameinput and cargo check --release --locked -p larp --features diagnostics. Input replays cover the 16 ms tap, capture changes, per-button expiry, held controller input, unplugging and two controllers. No physical controller hot-plug or in-title playthrough is claimed.

AI-assisted by GPT-6.2 Astra.

**@⁠yyc160** on GitHub · 2026-12-05 19:43 UTC · [original](https://github.com/gamingwithhomie/larp/pull/146) `yyc160:fix/recover-mapped-input` → `main` · +202 −49 · 4 files · 2 commits · merged 2026-12-05 21:02 UTC Two ways mapped actions can disappear without a bad `controls.ini`: - `auto` used the process-lifetime "a pad has ever been used" diagnostic as an ownership decision. One input on a physical controller could permanently stop mapped KB/M and prevent mouse recapture. Use a short, per-slot activity timeout and forget disconnected devices. Explicit `mnk` keeps mapping; legacy `pad` behaviour is unchanged. - A title reading only the current pad state at 30 FPS can miss a sampled 16 ms button or trigger tap. Keep the digital edge for the intended pad until a successful current reading includes it, or for at most 100 ms. Axes and physical controller presses are not latched. Other devices' reads do not acknowledge this pad. Stop synthesising mapped input while prewarm or the F10 panel owns it. No new default bindings, title hooks, vehicle mappings or camera algorithm. The existing `controls.ini` parser, right-stick smoothing, direct camera, world map and key-cap choices remain in place. A handoff clears pending direct camera motion as well as the stick filter. Checks: `cargo test --release --locked -p larp-hle --lib gameinput` and `cargo check --release --locked -p larp --features diagnostics`. Input replays cover the 16 ms tap, capture changes, per-button expiry, held controller input, unplugging and two controllers. No physical controller hot-plug or in-title playthrough is claimed. AI-assisted by GPT-6.2 Astra.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 19:49:21 +00:00
github-bot referenced this pull request from a commit 2026-12-05 21:05:09 +00:00
github-bot changed target branch from main to gh-pr/146/base 2026-12-05 21:05:15 +00:00
github manually merged commit 7dc262e4b1 into gh-pr/146/base 2026-12-05 21:05:19 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.