Keep keyboard-pad mouse deltas in range (RT-KEYBOARD-PAD-MOUSE-DELTA) #2082
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2082"
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?
Imported from ubiquitarianism/leonida. Originally posted by alexandersato0830 on 2026-11-25T19:46:13Z.
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.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:05:43Z.
Merged into
main(merge commitc91254631), 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.