Keep keyboard-pad mouse deltas in range (RT-KEYBOARD-PAD-MOUSE-DELTA) #2082
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2082
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/gameinput-mouse-delta"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: RT-KEYBOARD-PAD-MOUSE-DELTA
What and why
A very large mouse delta can exceed the 32-bit Windows
longrange before the right-stick value is clamped. That can send the stick in the opposite direction. Round into a 64-bit result before clamping. Subtract the wrapping input counters in unsigned arithmetic so a small move across the 32-bit boundary keeps its magnitude and direction.Tested
5da72d1, the new fake-cursor cases failed for both a positive and a negative three-million-count jump.gameinputandgameinput_scriptCTests passed with 377 checks, zero failures. Coverage includes the large deltas and a four-count move across the raw counter boundary.git diff --checkand the source-only check.GPUs tested: n/a. The tests use virtual pads and a synthetic cursor source.
AI-assisted: yes.
main.Merged into
main(merge commit c91254631), approved by DadaCap (maintainer). Thanks!Checked before merging: Its test fails on main (2 of 367 checks: a cursor jump past LONG_MAX/LONG_MIN overflowed
lround) and passes with this PR (RTX 5080, Windows 11). The merge was pinned to the head commit that was tested (8b3db052e).AI-assisted (Claude Code), posted for DadaCap.