Input: trigger rumble through Windows.Gaming.Input #2095
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2095
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@fylzzz on GitHub · 2026-11-25 04:44 UTC · original
fylzzz:input/trigger-rumble→main· +107 −19 · 3 files · 1 commits · openThe 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.
@Marvisak on GitHub · 2026-11-25 10:36 UTC · original
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
@fuzeofficlal on GitHub · 2026-11-26 00:55 UTC · original
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.
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.