Input: controller input keeps the display and the PC awake, as keyboard and mouse do (#893) #921
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!921
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-921"
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?
@xiepeixuan on GitHub · 2026-11-28 09:07 UTC · original
xiepeixuan:codex/controller-display-idle→main· +190 −17 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCPart 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 #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: #1098 (scripted input timing) and #839 (controller detection); neither resets Windows idle timers for physical controller activity.AI-assisted (Codex). Not run in the game here.
@Dukestar69 on GitHub · 2026-11-28 09:20 UTC · original · approved these changes
Tested locally merged onto
main(63b902f).cargo xtask policypassed (294 files ok).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).