GameInput: preserve relative mouse motion during captured right-button holds #3082

Closed
github-bot wants to merge 1 commit from github-bot/gh-3082 into main AGit
Owner

@⁠ghptc on GitHub · 2026-11-29 19:54 UTC · original
ghptc:feat/rmb-raw-mouse-stick → main · +364 −24 · 4 files · 1 commits · closed without merging

Preserve relative motion during captured right-button holds

The legacy mouse-to-stick path samples integer screen coordinates and then
recenters the cursor. A movement arriving between those two calls can be lost.
Confinement can also truncate motion before a sample. This adds an opt-in source
that uses relative Win32 mouse packets during a captured right-button hold.

Use --set VICTORY_MOUSE_RMB_RAW=1 with VICTORY_NATIVE_MOUSE=0 and
VICTORY_MOUSE_CAPTURE=1 in the legacy pad route (CONTROLS AUTO with MOUSE
AND KEYBOARD off). Raw movement is measured in device counts. It can feel
faster or slower than pixel-based movement at the same configured sensitivity.

  • Receives only foreground input for the registered capture window. Registration
    respects existing process-wide mouse registrations and is validated on entry
    and at most every 250 ms during the hold. A concurrent registration by
    another component between the ownership query and registration is outside
    the tested cases. Native mouse and keyboard routing are unchanged.
  • Drains one source per hold. A hold that has already emitted cursor motion
    keeps the cursor source. A relative hold drains each accepted report once,
    including reports between raw button-down and the first poll. The
    button-down report can carry both motion and button flags. Win32 does not
    specify their order in a single report, so the relative hold starts with
    the following report and excludes any movement on the button-down report.
  • Clears pending movement on F1, focus or registration loss and returns to the
    cursor with a fresh reference. The pad-only route keeps the mouse device
    hidden and forwards captured movement to the stand-in stick during the
    opt-in right-button hold. Default routing and the stick curve are unchanged.

The port is based on f889bb07. It opens only this opt-in hold in the
pad-only route. #2734 enables captured mouse-to-pad generally in AUTO, and
#591 covers capture around window moves and F1. The port is independent of
both and uses the legacy stick response.

Verification

  • A synthetic phase sweep conserved 208,000 post-button-down counts in
    26,000 reports at
    125/500/1,000 Hz. Its cursor control lost 2,500 of 104,000 px with an injected
    100 µs gap between position read and recenter.
  • A private Wine 11.22/Xvfb transport fixture received 48 of 48 relative
    events and returned nonzero values for both axes in all 12 GameInput
    readings. It also checked neutral input while F1 was open and verified
    that the capture window stopped receiving packets after focus loss.
    This used a synthetic relative device path.
  • A second private fixture measured two packets following button-down.
    The first poll returned (5, -3) and the next returned (0, 0).
    GameInput reported right stick (0.340, 0.304) and LT 1.0.
    An existing mouse registration on another window remained intact.
  • The port on f889bb07 passed opt-in and default tests of its production
    GameInput ABI. The Win32 fixtures tested the same relative-input module
    with the integration build's GameInput routing, using fixture windows and
    no game assets. The port still needs validation in a full build. Physical
    mouse feel and gameplay input latency were not measured.

RAWMOUSE fields and relative deltas · Process-wide registration rules

**@⁠ghptc** on GitHub · 2026-11-29 19:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3082) `ghptc:feat/rmb-raw-mouse-stick` → `main` · +364 −24 · 4 files · 1 commits · closed without merging # Preserve relative motion during captured right-button holds The legacy mouse-to-stick path samples integer screen coordinates and then recenters the cursor. A movement arriving between those two calls can be lost. Confinement can also truncate motion before a sample. This adds an opt-in source that uses relative Win32 mouse packets during a captured right-button hold. Use `--set VICTORY_MOUSE_RMB_RAW=1` with `VICTORY_NATIVE_MOUSE=0` and `VICTORY_MOUSE_CAPTURE=1` in the legacy pad route (CONTROLS AUTO with MOUSE AND KEYBOARD off). Raw movement is measured in device counts. It can feel faster or slower than pixel-based movement at the same configured sensitivity. - Receives only foreground input for the registered capture window. Registration respects existing process-wide mouse registrations and is validated on entry and at most every 250 ms during the hold. A concurrent registration by another component between the ownership query and registration is outside the tested cases. Native mouse and keyboard routing are unchanged. - Drains one source per hold. A hold that has already emitted cursor motion keeps the cursor source. A relative hold drains each accepted report once, including reports between raw button-down and the first poll. The button-down report can carry both motion and button flags. Win32 does not specify their order in a single report, so the relative hold starts with the following report and excludes any movement on the button-down report. - Clears pending movement on F1, focus or registration loss and returns to the cursor with a fresh reference. The pad-only route keeps the mouse device hidden and forwards captured movement to the stand-in stick during the opt-in right-button hold. Default routing and the stick curve are unchanged. The port is based on `f889bb07`. It opens only this opt-in hold in the pad-only route. #2734 enables captured mouse-to-pad generally in AUTO, and #591 covers capture around window moves and F1. The port is independent of both and uses the legacy stick response. ## Verification - A synthetic phase sweep conserved 208,000 post-button-down counts in 26,000 reports at 125/500/1,000 Hz. Its cursor control lost 2,500 of 104,000 px with an injected 100 µs gap between position read and recenter. - A private Wine 11.22/Xvfb transport fixture received 48 of 48 relative events and returned nonzero values for both axes in all 12 GameInput readings. It also checked neutral input while F1 was open and verified that the capture window stopped receiving packets after focus loss. This used a synthetic relative device path. - A second private fixture measured two packets following button-down. The first poll returned `(5, -3)` and the next returned `(0, 0)`. GameInput reported right stick `(0.340, 0.304)` and LT `1.0`. An existing mouse registration on another window remained intact. - The port on `f889bb07` passed opt-in and default tests of its production GameInput ABI. The Win32 fixtures tested the same relative-input module with the integration build's GameInput routing, using fixture windows and no game assets. The port still needs validation in a full build. Physical mouse feel and gameplay input latency were not measured. [RAWMOUSE fields and relative deltas](https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawmouse) · [Process-wide registration rules](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerrawinputdevices)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 20:00:08 +00:00
github-bot closed this pull request 2026-12-01 18:59:10 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!3082
No description provided.