Keep keyboard-pad mouse deltas in range (RT-KEYBOARD-PAD-MOUSE-DELTA) #2082

Open
github-bot wants to merge 1 commit from github-bot/gh-2082 into main AGit
Owner

@⁠alexandersato0830 on GitHub · 2026-11-25 19:46 UTC · original
alexandersato0830:codex/gameinput-mouse-delta → main · +29 −3 · 2 files · 1 commits · open

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 long range 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

  • Windows 11, MSVC 19.51, pinned SDL 3.4.20. On main 5da72d1, the new fake-cursor cases failed for both a positive and a negative three-million-count jump.
  • The patched gameinput and gameinput_script CTests passed with 377 checks, zero failures. Coverage includes the large deltas and a four-count move across the raw counter boundary.
  • Verified git diff --check and the source-only check.

GPUs tested: n/a. The tests use virtual pads and a synthetic cursor source.

AI-assisted: yes.

  • Based on current main.
  • One topic.
  • Uses source and synthetic fixtures.
**@⁠alexandersato0830** on GitHub · 2026-11-25 19:46 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2082) `alexandersato0830:codex/gameinput-mouse-delta` → `main` · +29 −3 · 2 files · 1 commits · open Claimed in the coordination issue as: [RT-KEYBOARD-PAD-MOUSE-DELTA](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why A very large mouse delta can exceed the 32-bit Windows `long` range 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 - Windows 11, MSVC 19.51, pinned SDL 3.4.20. On main `5da72d1`, the new fake-cursor cases failed for both a positive and a negative three-million-count jump. - The patched `gameinput` and `gameinput_script` CTests passed with **377 checks, zero failures**. Coverage includes the large deltas and a four-count move across the raw counter boundary. - Verified `git diff --check` and the source-only check. GPUs tested: n/a. The tests use virtual pads and a synthetic cursor source. AI-assisted: yes. - [x] Based on current `main`. - [x] One topic. - [x] Uses source and synthetic fixtures.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:17:13 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2082/head:github-bot/gh-2082'
git switch 'github-bot/gh-2082'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2082'
git switch 'github-bot/gh-2082'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2082'
git switch 'github-bot/gh-2082'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2082'
git switch 'main'
git merge --squash 'github-bot/gh-2082'
git switch 'main'
git merge --ff-only 'github-bot/gh-2082'
git switch 'main'
git merge 'github-bot/gh-2082'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.