Input: support DualShock 4 over HID and preserve keyboard controls #1786

Open
github-bot wants to merge 4 commits from github-bot/gh-1786 into main AGit
Owner

@⁠delacor on GitHub · 2026-11-24 22:32 UTC · original
delacor:input/dualshock4-hid → main · +1208 −61 · 5 files · 4 commits · open

Summary

  • Port HID controller support from fxceless/victory-fork#68, preserving the original authorship. DualShock 4 and DualSense pads and generic HID gamepads occupy free slots after XInput.
  • Port fxceless/victory-fork#74 so the keyboard remains usable with a controller connected. There are no new runtime dependencies.

Related upstream work includes #150, #1517, and #312. The hardware confirmed in this report is a wired DualShock 4.

Validation

  • The original fork build detected the physical DualShock 4 through Wine 11.0 Staging on Linux, and the reporter confirmed it worked in-game.
  • On the upstream port, all 18 automated GameInput tests passed under Wine. Windows-target Clippy passed with default and all features for victory-hle, and the four asset-policy tests passed.

Stale-frame result from the same Linux run

The reporter also confirmed that setting VICTORY_TEXTURE_GUARD=0 on the fxceless fork stopped the stale-frame overlay in the first cutscene after loading. The fork's texture guard can miss writes through an alias and defer rehashing. Upstream already hashes the texture contents during refresh, so this PR has no renderer diff. The fork's discussion and follow-up are in fxceless/victory-fork#63 and fxceless/victory-fork#159.

**@⁠delacor** on GitHub · 2026-11-24 22:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1786) `delacor:input/dualshock4-hid` → `main` · +1208 −61 · 5 files · 4 commits · open ## Summary - Port HID controller support from fxceless/victory-fork#68, preserving the original authorship. DualShock 4 and DualSense pads and generic HID gamepads occupy free slots after XInput. - Port fxceless/victory-fork#74 so the keyboard remains usable with a controller connected. There are no new runtime dependencies. Related upstream work includes #150, #1517, and #312. The hardware confirmed in this report is a wired DualShock 4. ## Validation - The original fork build detected the physical DualShock 4 through Wine 11.0 Staging on Linux, and the reporter confirmed it worked in-game. - On the upstream port, all 18 automated GameInput tests passed under Wine. Windows-target Clippy passed with default and all features for `victory-hle`, and the four asset-policy tests passed. ## Stale-frame result from the same Linux run The reporter also confirmed that setting `VICTORY_TEXTURE_GUARD=0` on the fxceless fork stopped the stale-frame overlay in the first cutscene after loading. The fork's texture guard can miss writes through an alias and defer rehashing. Upstream already hashes the texture contents during refresh, so this PR has no renderer diff. The fork's discussion and follow-up are in fxceless/victory-fork#63 and fxceless/victory-fork#159.
Only XInput pads reached the title, so a DualSense or DualShock 4, or
any other pad without an XInput driver, did nothing unless something
like Steam Input turned it into an XInput pad. Pads XInput does not list
are now read over HID and fill the slots XInput leaves empty:

- DualShock 4 and DualSense (and Edge), USB and Bluetooth, by their own
  report layouts, with rumble through their output reports;
- any other HID gamepad or joystick by its usages: X/Y left stick, Z/Rz or
  Rx/Ry right stick, the hat as the D-pad, buttons in the usual
  DirectInput order, VICTORY_PAD_BUTTONS for other orders.

XInput's own HID devices are skipped. An XInput pad keeps its slot; a HID
pad in a slot XInput takes moves to a free one. Checked with a DualSense on
USB, read both ways: every button, the triggers and both sticks over their
whole range, and the rumble.

(cherry picked from commit a9553ae722e1e7ec6a7e905f66695985b5cda6f0)
(cherry picked from commit fafecfb95eef77ac1a6bd6aa2eb84c072d37b8bd)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:32 +00:00
Author
Owner

@⁠DesertGamer on GitHub · 2026-11-24 22:34 UTC · original

VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

**@⁠DesertGamer** on GitHub · 2026-11-24 22:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/1786#issuecomment-7146397777) ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:36 UTC · original · edited 2026-11-25 22:23 UTC

Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main: main has moved since the last triage, and the branch now conflicts in crates/victory-hle/src/modules/gameinput.rs. It will be reviewed again once it is rebased onto current main.

Previous verdict for this head: merge candidate (with a scope decision for the maintainer).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/1786#issuecomment-7149739396) · edited 2026-11-25 22:23 UTC <!-- victory-triage v1 head=8388232659a77fb51d98e3daa312c86328538e09 verdict=needs-rebase at=2026-11-25T22:27:00Z --> Automated triage for the maintainers. **Needs rebase.** This PR no longer merges cleanly into `main`: `main` has moved since the last triage, and the branch now conflicts in `crates/victory-hle/src/modules/gameinput.rs`. It will be reviewed again once it is rebased onto current `main`. Previous verdict for this head: merge candidate (with a scope decision for the maintainer). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠catminou4 on GitHub · 2026-11-24 23:03 UTC · original · reviewed

Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.

DualShock 4 over HID with keyboard controls preserved: 47K input-layer diff — largest HLE PR this wave; HID report parsing needs a real DS4 to validate, keyboard fallback path is the regression risk.

**@⁠catminou4** on GitHub · 2026-11-24 23:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/1786#pullrequestreview-6048803258) · **reviewed** Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff. DualShock 4 over HID with keyboard controls preserved: 47K input-layer diff — largest HLE PR this wave; HID report parsing needs a real DS4 to validate, keyboard fallback path is the regression risk.
Author
Owner

@⁠delacor on GitHub · 2026-11-26 13:55 UTC · original

lol I can rebase this on a hourly base :D
Will do it again in a few hours

**@⁠delacor** on GitHub · 2026-11-26 13:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1786#issuecomment-7194032043) lol I can rebase this on a hourly base :D Will do it again in a few hours
github-bot force-pushed github-bot/gh-1786 from 8388232659 to f8b52ebab6 2026-11-26 16:04:32 +00:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1786/head:github-bot/gh-1786'
git switch 'github-bot/gh-1786'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1786'
git switch 'github-bot/gh-1786'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1786'
git switch 'github-bot/gh-1786'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1786'
git switch 'main'
git merge --squash 'github-bot/gh-1786'
git switch 'main'
git merge --ff-only 'github-bot/gh-1786'
git switch 'main'
git merge 'github-bot/gh-1786'
git push origin 'main'
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/Marvisak--VIctory!1786
No description provided.