Repository navigation
Input: controller input keeps the display and the PC awake, as keyboard and mouse do (#893) - #921
Open
xiepeixuan wants to merge 1 commit into
Open
xiepeixuan wants to merge 1 commit into
xiepeixuan wants to merge 1 commit into
Conversation
MystifiedSky
added a commit
to MystifiedSky/VIctory-NVIDIA-Improved
that referenced
this pull request
Nov 28, 2026
xiepeixuan
marked this pull request as ready for review
November 28, 2026 09:10
Dukestar69
approved these changes
Nov 28, 2026
Dukestar69
left a comment
There was a problem hiding this comment.
Tested locally merged onto main (63b902f).
- Merge & Policy: Clean merge;
cargo xtask policypassed (294 files ok). - Tests:
cargo test -p victory-hle --lib gameinputpassed (30 passed; 0 failed; 1 ignored, including all 4 new idle-reset tests:scripted_buttons_are_delivered_without_resetting_idle,a_background_pad_does_not_reset_idle_or_delay_the_first_foreground_reset,pad_idle_reset_uses_normalized_xinput_thresholds, andall_physical_pad_slots_share_one_idle_reset_per_second) with 0 compiler warnings.
Well-scoped QoL fix keeping the display awake on active foreground controller input without triggering from background or scripted inputs. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #893 (the display sleeping); the Game Bar part is not addressed.
What it changes
Windows can reach its display or system idle timeout while the player is using only a controller. Here GameInput polls XInput and reads PlayStation HID reports directly, then passes snapshots to the title; that path does not tell Windows to reset the idle timers as keyboard and mouse activity do. This fits the report that moving the mouse restores the screen while the title is still presenting.
In the Windows
Host::padrefresh of the merged XInput/PlayStation snapshot, check all physical slots before addingVICTORY_KEYSbuttons. A button, a trigger above the XInput threshold (30), or a stick outside its radial dead zone (7849 left, 8689 right) counts as activity. The thresholds are converted to the existing normalizedPadStateunits; they are only used for the idle decision and never filter the values passed to the title.Reuse the keyboard's foreground check and send a single
SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED)at most once per second across the four slots. WithoutES_CONTINUOUS, Windows resets the idle timers rather than holding a request. The title's own deferrals already go throughdisplay.rs, which is unchanged. This does not add a switch, change the power plan, or keep the PC awake once nobody is using the controller.Uses audit
Host::padfromHub::pollHub::startstill does its initial poll and starts the same poll thread.Source::padfrom single-padset_rumblehost(),Host::default, andHUBHost::pads,hid_slots,Host::xinput,convert, andplaystation::{mode, slots, pads}convert, the HID parser, pad merging, the keyboard stand-in, reading history, and thegamepad_stateABI keep the samePadStatevalues.focused,scripted, andFALLBACK_BUTTONSpad_active,PadActivity::first_pad,last_reset, andreset_idle_timersHow it was tested
GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): No in-game run; Windows unit tests only.
Before: 26 passed, 0 failed on
63b902fe.After: 30 passed, 0 failed on
16c09473.cargo testpassed for the crates it touches: Yes —cargo test -p victory-hle --lib gameinput.Windows workspace check:
cargo check --workspace --lockedpassed on16c09473e1d588e71fd38f2360a57c5961a0289b. Fork Windows jobWindows GameInput tests:
cargo test -p victory-hle --lib gameinputpassed: 30 passed, 0 failed, versus 26 passed, 0 failed on upstream63b902fein the same workflow. The four new tests cover the shared one-second limit, inactive input and normalized threshold boundaries, foreground gating, and scripted buttons.Full Windows CI: the fork run stops at the same two Clippy errors as upstream main (see CI: the rest of main's clippy findings, so that with #1517 and #1459 both builds are clean #665), with no new diagnostics. The later all-features Clippy and workspace-test steps are skipped as on main.
clippy::let_and_returnatcrates/victory-shader/src/emit/mod.rs:2768:9clippy::manual_is_multiple_ofatcrates/victory-gpu/src/shadow.rs:1708:32The fork workflow was triggered separately, but both topic jobs checked out and asserted the exact PR SHA above. No workflow changes or workspace-wide formatting are included in this PR.
Checked for overlap
crates/victory-hle/src/modules/gameinput.rs. Related: Input: scripted keys from the world's first frame (VICTORY_KEYS_FROM=world) #1098 (scripted input timing) and HLE/gameinput: a pad an all-zero receiver answers for is not a device #839 (controller detection); neither resets Windows idle timers for physical controller activity.AI-assisted (Codex). Not run in the game here.