Input: trigger rumble through Windows.Gaming.Input #2093
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2095"
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 Marvisak/VIctory. Originally posted by fylzzz on 2026-11-25T04:44:06Z.
The title sends four motor levels to the device's rumble slot (0x50); the last two, the trigger motors, were dropped because XInput has none. This drives all four through Windows.Gaming.Input (the windows crate's Gaming_Input feature) when exactly one pad is connected, and falls back to XInput otherwise, since the two APIs share no pad identity. A pad that stops being driven this way has its vibration cleared.
Windows.Gaming.Input ignores the process while none of its windows is in front, so in the background the body motors stop too (XInput used to keep them going).
Tested on Windows 11 with an Xbox One pad over USB: all four motors respond with our window in front. I checked this with a hand-run test I've left out of this PR and can add if you want it.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:49:56Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, Rust 1.98.1 MSVC):cargo test -p victory-hle --lib gameinput::— 9 passed, 0 failedcargo clippy -p victory-hle --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean trigger rumble support via
Windows.Gaming.Inputwith fallback to XInput and updatedREADME.md. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T05:02:21Z.
Review: COMMENTED
Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.
Rumble via Windows.Gaming.Input instead of XInput — newer input path; note the crate is still Windows-only so this stays static on macOS.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:36:00Z.
Automated triage for the maintainers.
gameinput.rsset_rumble(slot 0x50) now passes all four motor levels. When exactly one XInput slot and one Windows.Gaming.Input pad are connected,host::Host::rumbledrives them throughGamepad::SetVibration; otherwise it falls back to XInput for the body motors as before, and it clears a pad it stops driving. The only build change is theGaming_Inputfeature of thewindowscratevictory-hlealready uses. This replaces theshortcutcomment in main. The test covers clamping and NaN. CI passes, and the author reports testing with an Xbox One pad.Worth a maintainer's look: the disclosed trade-off that Windows.Gaming.Input stops all rumble while the window is in the background, which XInput did not.
Gamepad::Gamepads()is also queried on every rumble call.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:55:26Z.
Code review and Windows 11 verification at head
266f49ea9d08merged cleanly ontomain(63bcca43c6a0):crates/victory-hle/src/modules/gameinput.rs:328-329, 1314-1340):set_rumblefiltersNaN, negatives, and> 1.0cleanly viaif level > 0.0 { level.min(1.0) } else { 0.0 }.Host::rumble.take()sself.driven[slot]first and zeros vibration (GamepadVibration::default()) on the previousGamepadwhenever the device disconnects or switches before falling back toXInputSetState, avoiding stuck trigger rumble.Gamepad::Gamepads()returnsCO_E_NOTINITIALIZEDand falls back to XInput without trigger motors; (2) on the very first call before an initialpad()poll populatesempty_until,connected(s)reports true for all 4 slots so the first rumble falls back to XInput.cargo xtask policy:191 files ok;cargo clippy -p victory-hle --all-targets -- -D warnings: 0 warningsvictory-hle --lib -- input: 10/10 passed (full lib skipping unrelated concurrent testa_page_list_filled_after_its_request_startswhich passes solo: 151/151 passed).LGTM.
Imported from Marvisak/VIctory. Originally posted by kilolimaVI on 2026-11-26T21:57:59Z.
Comparison of the four open trigger-rumble PRs (README: "Trigger rumble"), each merged onto current main
63bcca4. Windows 11, toolchain 1.98.1; no pad here, so unit tests and CI's clippy checks only.cargo test -p victory-hle --lib -- gameinput-D warnings(default /--all-features)gameinput.rsgameinput.rs#1958 and #2095 are separate implementations of the same Windows.Gaming.Input trigger path. #1958 also carries three input changes besides rumble (device methods answering as devices, a manual-dispatch dispatcher, QueryInterface by interface id) and tests for them; #2095 is rumble only, smaller, without tests. Taking one should close the other three. Both add
"Gaming_Input"to victory-hle'swindowsfeatures, so whichever goes second will need a one-line rebase there.AI-assisted (Claude).
Imported from Marvisak/VIctory. Originally posted by kilolimaVI on 2026-11-27T10:41:51Z.
Addendum to the comparison above, on the point fuzeofficial raised on #1357 (XInput slot used as the
Gamepad.Gamepadsindex):connected[..slot]) and uses that as the Windows.Gaming.Input index, so a gap like slot 0 leaving while slot 1 stays is handled. With several pads it still relies on both APIs listing them in the same order, which neither promises (its own// shortcut:comment says the triggers of another pad may answer).With one pad both behave the same.
AI-assisted (Claude).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.