fix(input): input handler correctness fixes#54
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refines InputHandler’s long/short-press behavior around Journal opening, pause timing, QJO detection, and OS-suspension edge cases to prevent spurious dispatches and incorrect Journal tab restoration during transitional UI states.
Changes:
- Discard short-press dispatches if the game is paused at dispatch time, and separate OS-suspend timing guard (
kSuspensionGuardDuration) from hold-duration limits. - Add
_journalOpenDispatchedto suppress the tab-restore fail-safe during the Journal open animation window. - Guard QJO detection so it only probes when the Quests page SWF is instantiated (avoids caching false-negatives).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/InputHandler.h |
Adds kSuspensionGuardDuration and _journalOpenDispatched state to support new input correctness guards. |
src/InputHandler.cpp |
Implements pause-aware short-press discard, Journal open/restore suppression logic, and safer QJO detection gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
60852a2 to
a1e5457
Compare
…uard _savedTabIdx with _journalOpenDispatched flag; defer QJO false-negative; use dedicated suspension guard constant
a1e5457 to
349f9ac
Compare
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.
Summary
DispatchShortPressif the game is paused at the moment of dispatch, preventing spurious menu opens in edge cases where a pause occurs between button DOWN and UP_journalOpenDispatchedflag to suppress the fail-safe tab restore during the Journal open-animation window, preventing_savedTabIdxfrom being clobbered before the Journal reads the forcedsJournalTabIdxvalueDetectQJOIfNeededbehind a check that the Quests page SWF is instantiated — previously, probing on a non-Quests tab would cache a false-negative and permanently suppress QJO navigation for the sessionkMaxHoldDurationwith a dedicatedkSuspensionGuardDuration(30 s) in the suspension guard, so the hold threshold and the OS-suspend discard threshold are no longer conflatedPart of the June 2026 audit fix series (#51, #52, #53).
Test plan
./scripts/build.sh)