Repository navigation
Input: apply VICTORY_KEYS to a connected host pad too - #197
Conversation
|
Tested
No game data used. |
|
Tested Setup: Windows 11 Pro 10.0.26300, AMD RX 9070 XT (RDNA4, Adrenalin 26.11.2), Rust 1.98.1 ( Before / after. Both runs use the same
That run then ends at 152 s with a WARP device removal ( Tests on
Not tested: a physical pad held while scripted keys fire (I did not touch the pad during the runs); more than one connected pad; NVIDIA / Intel. |
|
Tested Setup: Windows 11 Pro 10.0.26300, AMD RX 7700 XT (RDNA3, driver 32.0.32015.7029), Ryzen 7 7700X, 32 GB, title 1.0.2.1. #197 merged onto
Written by Claude Code (Claude Opus 5.5), which ran the commands; the title ran on my machine. |
|
Data point from a Windows/5090 run of the retail title, because this is exactly the variable in question. Build: What the title does: it presents at 30.0 fps / 33.3 ms from the start (13 draws/frame), and the first-run screens advance on their own: the accessibility screen, then the player selector, then the legal/copyright page (text read back from the presented frame with OCR, so the screen is identified, not guessed). It stops on What does not move it: Since the screens advanced without input, I cannot use the progression as evidence that the keys arrive: the honest reading is that nothing the keys do reaches this title's UI, which matches the title of this issue ( No game data in this comment — screen labels, counts and the environment only. Happy to run a patched build on this box if someone wants the other half of the experiment. |
|
Refinement after more attempts on the same box (5090, 1.0.2.1, build
That splits the report: the keyboard path (arrows) is delivered, and the stand-in pads A either is not delivered or is delivered to a device the UI does not read. If a real pad is plugged in on this box, I can say which half is broken in one run. AI-assisted (opencode). |
|
Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB):
Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above. diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs
index c7f7c45..2535b68 100644
--- a/crates/victory-gpu/src/dxgi.rs
+++ b/crates/victory-gpu/src/dxgi.rs
@@ -219,6 +219,19 @@ struct Mode {
}
const _: () = assert!(size_of::<Mode>() == 32);
+/// The console's fixed output mode, overridable for hosts smaller than the
+/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead.
+fn mode_size() -> (u32, u32) {
+ const DEFAULT: (u32, u32) = (3840, 2160);
+ let Some(text) = std::env::var_os("VICTORY_MODE") else {
+ return DEFAULT;
+ };
+ let text = text.to_string_lossy();
+ text.split_once('x')
+ .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?)))
+ .unwrap_or(DEFAULT)
+}
+
/// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks
/// for a 120 Hz one to allow 120 Hz frame intervals).
/// shortcut: fixed mode, not the host display's; report the host's rates if
@@ -242,9 +255,10 @@ extern "system" fn modes(
return MORE_DATA;
}
*count = 1;
+ let (width, height) = mode_size();
let mode = Mode {
- width: 3840,
- height: 2160,
+ width,
+ height,
refresh: [60, 1],
format: 0,
scanlines: 1, // progressive
diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs
index a411bd0..da8d66c 100644
--- a/crates/victory-hle/src/modules/gameinput.rs
+++ b/crates/victory-hle/src/modules/gameinput.rs
@@ -1134,6 +1134,11 @@ mod host {
impl Source for Host {
fn pad(&mut self, slot: usize) -> Option<PadState> {
+ // The keyboard stand-in pad only exists while no host pad is
+ // connected; this hides a host pad the title mis-handles.
+ if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() {
+ return None;
+ }
if self.empty_until[slot].is_some_and(|until| Instant::now() < until) {
return None;
} |
|
Automated triage for the maintainers. Merge candidate. On main, CI: no check runs on the head commit. Generated by Claude Code |
`VICTORY_KEYS` is a schedule fixed at start. With `VICTORY_KEYS_FILE=<path>`, lines appended to the file while the game runs are pressed too: `<key>[+<key>...][:<ms>]`, the same key names, held 200 ms unless given, one line after another; the file is looked at every 50 ms and lines already there at start are skipped. They merge onto a connected controller as `VICTORY_KEYS` does (Marvisak#197), so someone can play with a pad while a script sends keys.
`VICTORY_KEYS` is a schedule fixed at start. With `VICTORY_KEYS_FILE=<path>`, lines appended to the file while the game runs are pressed too: `<key>[+<key>...][:<ms>]`, the same key names, held 200 ms unless given, one line after another; the file is looked at every 50 ms and lines already there at start are skipped. They merge onto a connected controller as `VICTORY_KEYS` does (Marvisak#197), so someone can play with a pad while a script sends keys.
Problem
In crates/victory-hle/src/modules/gameinput.rs, VICTORY_KEYS (enabled in diagnostics builds) is injected only via Host::keys(). State::poll() then maps keyboard keys onto the stand-in gamepad (FALLBACK) only when !any_pad.
When an XInput controller (physical or virtual) is connected on the host, FALLBACK is disconnected (DEVICE_DISCONNECTED), so VICTORY_KEYS=30:Enter,35:X feeds the keyboard device only and never presses gamepad buttons in the title.
Change
Verification