fix: dispatch short press via MenuOpenHandler for any control binding#9
Merged
Conversation
There was a problem hiding this comment.
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.
52885f1 to
29d7121
Compare
There was a problem hiding this comment.
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
MenuOpenHandlerdoes 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;
3e2f41b to
6fe64bf
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.
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.