You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to call user camera action during cinematic scenes. For example set a Bookmark with CTRL+F1, and then press F1 during a cutscene: the camera jumps there.
The fixed logic prevents all button presses except ESC when the input is disabled.
xezon
added
Bug
Something is not working right, typically is user facing
Minor
Severity: Minor < Major < Critical < Blocker
Gen
Relates to Generals
ZH
Relates to Zero Hour
Input
labels
Apr 18, 2026
This PR adds a targeted keyboard-input guard to WindowTranslator::translateGameMessage in both Generals and Zero Hour builds. When TheInGameUI->getInputEnabled() returns FALSE (i.e. during scripted camera/cinematic scenes), all MSG_RAW_KEY_DOWN and MSG_RAW_KEY_UP events except KEY_ESC are now consumed (returnCode = WIN_INPUT_USED), preventing actions like camera-bookmark jumps from firing during cutscenes. The fix mirrors the already-existing mouse-input guard in the same function and is applied identically in both codebases.
Confidence Score: 5/5
Safe to merge — minimal, focused fix with no regressions on mouse handling or the existing ESC-to-exit-movie path.
The new logic is a clean extension of the pre-existing mouse guard pattern; both affected files are changed identically, the ESC carve-out is intentional and correct, and the only note is a minor P2 observation about key-down vs key-up asymmetry that has no current impact.
Adds a guard in the MSG_RAW_KEY_DOWN/UP case to consume all non-ESC keys when TheInGameUI input is disabled, matching the existing mouse-input guard pattern; logic is correct and consistent.
Identical guard added for Zero Hour; code is in sync with the Generals counterpart and follows the same logic.
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[MSG_RAW_KEY_DOWN / MSG_RAW_KEY_UP] --> B[winProcessKey via TheWindowManager]
B --> C{returnCode == WIN_INPUT_USED?}
C -- Yes --> H[Key consumed]
C -- No --> D{key == KEY_ESC AND movie playing AND allowExitOutOfMovies?}
D -- Yes --> E[stopMovie\nreturnCode = WIN_INPUT_USED]
E --> H
D -- No --> F{returnCode != WIN_INPUT_USED\nAND key != KEY_ESC\nAND input disabled?}
F -- Yes --> G["returnCode = WIN_INPUT_USED\n(NEW GUARD — blocks bookmarks etc.)"]
G --> H
F -- No --> I[Key passes through to game handlers]
LoadingPrompt To Fix All With AI
This is a comment left during a code review.
Path: Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp
Line: 313-318
Comment:
**ESC key-down event still propagates during disabled input**
When input is disabled, the new block correctly lets `KEY_ESC` through, but it makes no distinction between `KEY_STATE_DOWN` and `KEY_STATE_UP`. That means both the key-down and key-up ESC events reach further handlers. The existing movie-escape guard above already scopes its own action to `KEY_STATE_UP`, so this is mostly harmless today. Just worth noting in case any future handler acts on ESC key-down during a cinematic and produces an unintended side-effect. No immediate bug, but the pairing with the movie-escape logic above is slightly asymmetric.
How can I resolve this? If you propose a fix, please make it concise.
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
BugSomething is not working right, typically is user facingGenRelates to GeneralsInputMinorSeverity: Minor < Major < Critical < BlockerZHRelates to Zero Hour
3 participants
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.
It is possible to call user camera action during cinematic scenes. For example set a Bookmark with CTRL+F1, and then press F1 during a cutscene: the camera jumps there.
The fixed logic prevents all button presses except ESC when the input is disabled.