Skip to content

fix(input): input handler correctness fixes#54

Merged
codepuncher merged 1 commit into
mainfrom
fix/input-handler
Jun 17, 2026
Merged

fix(input): input handler correctness fixes#54
codepuncher merged 1 commit into
mainfrom
fix/input-handler

Conversation

@codepuncher

Copy link
Copy Markdown
Owner

Summary

  • [INPUT-2] Discard short press in DispatchShortPress if 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
  • [INPUT-3] Add _journalOpenDispatched flag to suppress the fail-safe tab restore during the Journal open-animation window, preventing _savedTabIdx from being clobbered before the Journal reads the forced sJournalTabIdx value
  • [INPUT-4] Guard QJO detection in DetectQJOIfNeeded behind 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 session
  • [INPUT-5] Replace kMaxHoldDuration with a dedicated kSuspensionGuardDuration (30 s) in the suspension guard, so the hold threshold and the OS-suspend discard threshold are no longer conflated

Part of the June 2026 audit fix series (#51, #52, #53).

Test plan

  • Build clean (./scripts/build.sh)
  • clang-tidy and clang-format pass (pre-commit hooks)
  • In-game: hold Start/Back to open Journal on configured tab — tab correct on open and restores on close
  • Short press Start/Back still works normally

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _journalOpenDispatched to 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.

Comment thread src/InputHandler.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread src/InputHandler.h Outdated
Comment thread src/InputHandler.cpp Outdated
…uard _savedTabIdx with _journalOpenDispatched flag; defer QJO false-negative; use dedicated suspension guard constant

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@codepuncher codepuncher marked this pull request as ready for review June 17, 2026 16:50
@codepuncher codepuncher merged commit e49baf2 into main Jun 17, 2026
11 checks passed
@codepuncher codepuncher deleted the fix/input-handler branch June 17, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants