Skip to content

input: keyboard stand-in engagement + mouse camera control (re-port #1430/#33) - #50

Merged
devin-ai-integration[bot] merged 5 commits into
mainfrom
devin/input-chain
Nov 25, 2026
Merged

devin-ai-integration[bot] merged 5 commits into
mainfrom
devin/input-chain

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Two cherry-picks onto the fxceless base — they applied clean since the fxceless input module is close to the old tree:

  • 70f3bbc (upstream #1430): virtual or idle XInput pads no longer disable keyboard controls. Real input outside the XInput deadzones engages pad mode and disconnects the fallback; fallback keys regain control once host pads go idle.
  • d34c4c9 (re-port of Input: add mouse camera control to the fallback pad #33): the mouse as the stand-in pad's camera under VICTORY_MOUSE — movement turns the right stick (cursor re-centred each poll while focused, sensitivity configurable), left button as right trigger, right button as left trigger.

This matters for actually playing/testing the game with keyboard+mouse — camera control was impossible before.

Validation: clippy -D warnings clean (incl. tests), 10 gameinput tests pass (incl. the engagement truth-table test and both mouse tests).

Written by Devin

Open in Devin Desktop: https://app.devin.ai/desktop/session/39a24dfe2c184165b42b2108a96286b6?variant=devin
Requested by: @Personed


🟢 Devin fixed all 9 findings · Follow Devin's work

Devin Review

Two cherry-picks that apply clean on the fxceless base:
- 70f3bbc (upstream #1430): virtual or idle XInput pads no longer
  disable keyboard controls; real input outside the deadzones engages
  pad mode, fallback keys regain control once host pads go idle.
- d34c4c9 (re-port #33): the mouse as the stand-in pad's camera under
  VICTORY_MOUSE — movement as right-stick deflection (cursor re-centred
  per poll while focused), left/right buttons as triggers.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Personed and others added 4 commits November 25, 2026 07:37
…reshold

- Polls outnumber the title's frames, so movement sliced over several
  polls mostly never reached a frame: the stick now reports a decaying
  accumulator, spreading the movement instead of dropping it.
- Re-centring pauses while a window other than the one capture started
  on is in front: the text-entry dialog shares the process, so the
  focus check alone passed it and the cursor could not reach its
  buttons.
- The left stick engages pad mode at XInput's left-thumb threshold
  (7849) instead of the right stick's.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Switching windows mid-turn no longer sends the buffered movement to
  the camera on return; the accumulator clears with capture.
- The capture window re-latches once the window it started on closes,
  so a startup dialog cannot hold capture forever.
- The accumulator halves per 100 ms of wall time instead of per poll:
  at high poll rates the per-poll halving erased movement long before
  the title's slow frames could read it.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Replaces the decaying sum, which saturated on steady sweeps and kept
residual motion alive: the stick now reports an EMA (half-life 50 ms of
wall time) of per-poll deltas. Steady motion converges to the full
per-poll speed, flicks smooth out, and the estimate reaches zero within
a few hundred ms of the mouse stopping — brief enough not to steal pad
mode back from a controller.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The EMA now averages velocity (delta divided by the measured poll
interval, floor 1 ms) instead of raw per-poll distances: the same hand
speed yields the same camera turn regardless of how long polls take.
Full stick at 4000 px/s, scaled by VICTORY_MOUSE sensitivity.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 9 findings. Devin automatically fixed all 9 findings.

Fixed by Devin (9)
  • Mouse capture and rendering select windows separately — Fixed the startup-dialog case: capture re-latches to the current foreground window once the window it latched on no longer exists (IsWindow fails), so a dialog in front at startup cannot permanently capture.
  • Slow frames still miss mouse motion — Fixed: decay is now time-based (halves per 100 ms) instead of per-poll, so movement survives the slow frames regardless of poll rate while still fading.
  • Right-stick threshold on left stick — Fixed: left axes now compare against XInput's left-thumb deadzone (7849), right axes keep 8689.
  • Old camera movement after refocus — Fixed: the accumulator now clears together with mouse_centred on focus loss or foreign foreground window — no stale movement after refocus.
  • Stale mouse motion steals controller mode — Fixed by redesign: EMA replaces the decaying sum — the estimate converges to zero geometrically (50 ms half-life) once the mouse stops, so residual motion is negligible within ~300 ms.
  • Slow mouse sweeps max out camera speed — Fixed by redesign: the EMA converges to the steady per-poll speed rather than accumulating without bound — stick deflection is proportional to mouse speed, faster sweeps no longer clip to the same speed.
  • Lost camera movement between frames — Fixed: the stick now reports a decaying accumulator of per-poll deltas, so movement sliced over many polls reaches the frame spread out rather than being dropped.
  • Mouse capture in text entry — Fixed: re-centring pauses whenever the foreground window differs from the window capture started on — the text-entry dialog (same process) no longer traps the cursor.
  • Camera sensitivity varies with poll timing — Fixed: the EMA now averages true velocity (delta divided by measured poll interval) in px/s, so camera response no longer depends on poll timing.

View findings in Devin Review · Follow Devin's work

Devin Review

@devin-ai-integration
devin-ai-integration Bot merged commit 70a732b into main Nov 25, 2026
5 checks passed
devin-ai-integration Bot pushed a commit that referenced this pull request Nov 25, 2026
input: keyboard stand-in engagement + mouse camera control (re-port #1430/#33)
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.

1 participant