Mouse look: hold the stick for as long as the flick was owed (fixes sharp moves doing nothing) #1195

Closed
Alxspb wants to merge 4 commits from upstream-pr/1195 into main
Alxspb commented 2026-11-28 15:18:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Alxspb on 2026-11-28T15:18:42Z.


Stacked on #989 (the mouse-camera feature) and #1149 (the F1 sensitivity row); contains both, review the last commit.

Symptom (from players of the keyboard-and-mouse stand-in, #989)

A sharp mouse move turned the camera not at all, while a slow drag worked - but exactly like a gamepad stick. The faster the move, the less it registered.

Why

The pad is a state device, not a delta one: XINPUT_GAMEPAD "describes the current state of the controller" (GDKX, reference/input/xinputongameinput/structs/xinput_gamepad.md), and GameInput axes carry a dead zone around the center position (GDKX, reference/input/gameinput/deprecated/structs/gameinputcontrolleraxisinfo.md, deadZone). The mapper pushed the stick with each poll's motion and let it fall back with a 45 ms half-life. The title samples the pad at its own frame times - and it draws a few frames a second at busy moments. A flick lasting well under a frame time was on the stick and settled back to the centre between two of the title's reads: the title never saw it. A slow drag was still held at every read, which is why exactly that case worked and felt like a stick.

Fix

Hold the deflection, unchanged, for a time that grows with the distance the mouse moved: 0.3 ms of hold per pixel at sensitivity 1, capped at 180 ms, then a fast 20 ms fall-off. A held deflection is read by as many of the title's frames as the distance is owed, and each of them turns at the stick's rate - so the angle adds up to the mouse distance whatever the title's frame rate. Quick moves and slow moves behave alike, which is what "the mouse works like a mouse in an action game" means on top of a pad-only title.

A reversal puts the stick the other way at once and turns the remaining hold with it. The same-way pile-up (fast continuous drags still reach the full stick), the sensitivity scale, the one-pixel-at-low-sensitivity case and the settle-to-centre are all kept; the existing tests pass unchanged and one new test pins the hold model.

Tuning

HOLD_MS_PER_PX (0.3) and MAX_HOLD_MS (180) are the two knobs; they scale with VICTORY_MOUSE_SENS / the F1 sensitivity row (#1149). Related: #1002 (the original sensitivity variable).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5541623927 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1195). Originally posted by [Alxspb](https://github.com/Alxspb) on 2026-11-28T15:18:42Z. --- Stacked on #989 (the mouse-camera feature) and #1149 (the F1 sensitivity row); contains both, review the last commit. ## Symptom (from players of the keyboard-and-mouse stand-in, #989) A sharp mouse move turned the camera **not at all**, while a slow drag worked - but exactly like a gamepad stick. The faster the move, the less it registered. ## Why The pad is a state device, not a delta one: `XINPUT_GAMEPAD` "describes the current state of the controller" (GDKX, `reference/input/xinputongameinput/structs/xinput_gamepad.md`), and GameInput axes carry a dead zone around the center position (GDKX, `reference/input/gameinput/deprecated/structs/gameinputcontrolleraxisinfo.md`, `deadZone`). The mapper pushed the stick with each poll's motion and let it fall back with a 45 ms half-life. The title samples the pad at its own frame times - and it draws a few frames a second at busy moments. A flick lasting well under a frame time was on the stick and settled back to the centre **between two of the title's reads**: the title never saw it. A slow drag was still held at every read, which is why exactly that case worked and felt like a stick. ## Fix Hold the deflection, unchanged, for a time that grows with the distance the mouse moved: 0.3 ms of hold per pixel at sensitivity 1, capped at 180 ms, then a fast 20 ms fall-off. A held deflection is read by as many of the title's frames as the distance is owed, and each of them turns at the stick's rate - so the angle adds up to the mouse distance **whatever the title's frame rate**. Quick moves and slow moves behave alike, which is what "the mouse works like a mouse in an action game" means on top of a pad-only title. A reversal puts the stick the other way at once and turns the remaining hold with it. The same-way pile-up (fast continuous drags still reach the full stick), the sensitivity scale, the one-pixel-at-low-sensitivity case and the settle-to-centre are all kept; the existing tests pass unchanged and one new test pins the hold model. ## Tuning `HOLD_MS_PER_PX` (0.3) and `MAX_HOLD_MS` (180) are the two knobs; they scale with `VICTORY_MOUSE_SENS` / the F1 sensitivity row (#1149). Related: #1002 (the original sensitivity variable).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!1195
No description provided.