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

Open
opened 2026-11-26 21:19:59 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2082
Author: @alexandersato0830
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: codex/gameinput-mouse-delta


📝 Commits (1)

  • 8b3db05 Keep virtual gamepad mouse deltas in range

📊 Changes

2 files changed (+29 additions, -3 deletions)

View changed files

📝 runtime/shims/gameinput.cpp (+7 -3)
📝 runtime/test/gameinput_test.cpp (+22 -0)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2082 **Author:** [@alexandersato0830](https://github.com/alexandersato0830) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/gameinput-mouse-delta` --- ### 📝 Commits (1) - [`8b3db05`](https://github.com/ubiquitarianism/leonida/commit/8b3db052e4068ef7097af39a07dfff70ca1cac42) Keep virtual gamepad mouse deltas in range ### 📊 Changes **2 files changed** (+29 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/gameinput.cpp` (+7 -3) 📝 `runtime/test/gameinput_test.cpp` (+22 -0) </details> ### 📄 Description Claimed in the coordination issue as: [RT-KEYBOARD-PAD-MOUSE-DELTA](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172630557) ### 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2087
No description provided.