Repository navigation
Conversation
…held A left press on the ground that was released over an RmlUi window never reached HandleMouseButton: the UI consumed the release, MouseLButton stayed true and the hero kept walking after the cursor (ZzzInterface's held-button move) until the next left click, across maps. Only the right button had the "release while the game holds it" exception. Every button release the UI consumed now still reaches the game while the game holds that button (Core::Input::IsReleaseOfHeldButton), which replaces the right-only check in PassesRightButtonToGame (now PassesButtonToGame). A press the UI took never set the game's button, so clicks on window buttons stay with the UI as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Press the left button on the ground and release it over an RmlUi window (the skill bar, the MU Helper window, the inventory). The release never reaches
HandleMouseButton:Core::Input::RouteToUireports it consumed,MouseLButtonstaystrue, and as soon as the cursor leaves the windowZzzInterface's held-button move (if (MouseLButton) Success = true;) keeps sending the hero to whatever ground is under the cursor, every frame, with no button down. The hero follows the mouse across the map (a player walked from Lorencia to Devias this way) until the next left click.The right button already had this exception (
PassesRightButtonToGame: "a right release does while the game holds the button, so it can't stick"). The left and middle buttons did not.This PR generalizes it: any mouse-button release that the UI consumed still reaches the game while the game holds that button. The check lives in
Core::Input::IsReleaseOfHeldButton(next toRecordPressEdge, so it can be unit tested), andPassesRightButtonToGamebecomesPassesButtonToGame(the party-card right press is unchanged).A press the UI took never set the game's button, so its release still stays with the UI: clicking a window's buttons works as before and does not click the world. Gameplay keeps its own
IsMouseOverUI()gates, so the passed release does not act on the world under the window either; it only clears the held state.Files
Core/Input/KeyState.h/.cpp:IsReleaseOfHeldButton(const SDL_Event&)(left/right/middle vsMouseLButton/MouseRButton/MouseMButton).App/Platform/Windows/Winmain.cpp:PassesRightButtonToGame→PassesButtonToGame, releases go through the new check.tests/core/test_synthetic_input.cpp: one test case for held/not held, press vs release, each button.How to reproduce (on
main)On
mainthe hero keeps walking after the cursor wherever it goes. With this PR it stops when the button is released.Testing
A release the UI took still reaches the game while the game holds that button [core][input]intest_synthetic_input(Windows x64 Release,-DENABLE_CONTROL_SOCKET=ON), passes with the other 25[core][synthetic-input]/[core][input]cases.-demo), Lorencia, Blade Knight. Steps above, released over the skill bar, then the cursor moved over the ground on two sides without clicking. Position from the map label:maincode)🤖 Generated with Claude Code