Skip to content

fix: dispatch short press via MenuOpenHandler for any control binding#9

Merged
codepuncher merged 9 commits into
mainfrom
fix/short-press-generic-dispatch
May 17, 2026
Merged

fix: dispatch short press via MenuOpenHandler for any control binding#9
codepuncher merged 9 commits into
mainfrom
fix/short-press-generic-dispatch

Conversation

@codepuncher
Copy link
Copy Markdown
Owner

@codepuncher codepuncher commented May 17, 2026

Short press was broken for anyone using default controls (because I forgot the defaults) — Start is bound to "System"/"Pause" by default, not "Journal" or "Tween Menu" as the old
whitelist assumed.

Reads the actual user event from ControlMap at runtime and passes a synthetic
ButtonEvent to MenuOpenHandler::ProcessButton on short press, so any binding
works correctly.

Also fixes a pre-existing bug where _mapTriggered wasn't set before the
UIMessageQueue null check, causing a spurious short press dispatch if the
queue was unavailable at hold threshold.

Copilot AI review requested due to automatic review settings May 17, 2026 13:10
Copy link
Copy Markdown

Copilot AI left a comment

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 updates QuickMap’s Start short-press handling to use the current ControlMap user event instead of a hard-coded Journal/Tween menu whitelist, while keeping hold-to-map behavior.

Changes:

  • Caches the Start button’s user event and dispatches short presses through MenuOpenHandler.
  • Marks map holds as triggered before checking UIMessageQueue.
  • Updates user-facing documentation to describe custom Start bindings.

Reviewed changes

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

File Description
src/InputHandler.h Replaces cached menu name state with cached user event state.
src/InputHandler.cpp Updates short-press dispatch and hold-threshold handling.
README.md Updates the short-press behavior description.
docs/nexus-page.md Updates Nexus overview wording for custom Start bindings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/InputHandler.cpp Outdated
Comment thread src/InputHandler.h Outdated
@codepuncher codepuncher force-pushed the fix/short-press-generic-dispatch branch from 52885f1 to 29d7121 Compare May 17, 2026 13:15
Copilot AI review requested due to automatic review settings May 17, 2026 13:20
Copy link
Copy Markdown

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/InputHandler.cpp:154

  • Because the original Start event has already been consumed, any Start binding that MenuOpenHandler does not handle is lost here. That means rebinding Start to a non-menu action will produce only this warning instead of executing the user's binding, so the implementation still does not preserve “any control binding.”
	if (!menuControls->menuOpenHandler->CanProcess(syntheticEvent)) {
		logger::warn("MenuOpenHandler rejected short press — press consumed but no menu opened");
		syntheticEvent->~ButtonEvent();
		RE::free(syntheticEvent);
		return;

Comment thread src/InputHandler.h
Comment thread src/InputHandler.cpp Outdated
Comment thread README.md Outdated
Comment thread docs/nexus-page.md Outdated
@codepuncher codepuncher force-pushed the fix/short-press-generic-dispatch branch from 3e2f41b to 6fe64bf Compare May 17, 2026 13:30
@codepuncher codepuncher requested a review from Copilot May 17, 2026 13:30
Copy link
Copy Markdown

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/InputHandler.h Outdated
Comment thread README.md
Comment thread .github/workflows/ci.yml
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated no new comments.

@codepuncher codepuncher merged commit 0736fb3 into main May 17, 2026
12 checks passed
@codepuncher codepuncher deleted the fix/short-press-generic-dispatch branch May 17, 2026 14:03
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