Fix widget mouse button checks on 26.3 - #247
Merged
Merged
Conversation
Minecraft 26.3 uses SDL mouse button ids (left 1, middle 2, right 3) instead of GLFW's (left 0, right 1, middle 2). - WidgetTextFieldExtended: a left click matched the old right-click check and selected all text instead of placing the cursor. - ContainerScreenScrolling: drag delegation to the focused widget never ran. - WidgetScrollBar: right-drag no longer moved the scrollbar. Related to CyclopsMC/IntegratedDynamics#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016VFfUPDxbJ8RqPeQHsAbh7
|
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.



Related to CyclopsMC/IntegratedDynamics#1750 (same root cause as CyclopsMC/IntegratedTerminals#230).
Cause
Minecraft 26.3 moved input to SDL, so
MouseButtonEvent.button()now uses left1, middle2, right3(InputConstants.MOUSE_BUTTON_*). Before, it used GLFW's left0, right1, middle2. Three shared widgets still used the old values:WidgetTextFieldExtended#mouseClicked: the "right click selects all" check (== 1) now matches a left click. Left-clicking any Cyclops text field (such as the Storage Terminal search box) selected all text instead of placing the cursor. This affects every mod that uses this widget.ContainerScreenScrolling#mouseDragged: the== 0check never matched, so the override that passes drags to the focused widget was skipped. Vanilla'sAbstractContainerScreen#mouseDraggedswallows drag events while the cursor is over a slot, so dragging a scrollbar stopped scrolling as soon as the cursor passed over a slot.WidgetScrollBar#mouseDragged:== 0 || == 1only matched left. Correcting it to left or right restores the intended behaviour at the widget level. In practice, vanilla screens only forward left-button drags to the focused widget, so right-drags reach the scrollbar only in screens that forward them.Fix
Compare against
InputConstants.MOUSE_BUTTON_LEFTandMOUSE_BUTTON_RIGHT. Everything is inloader-common, so all loaders get the fix.Validation
./gradlew buildpasses for all loaders, and./gradlew runGameTestServerpasses (all required tests).1.30.0-1159with this branch published to Maven local:diamond, left click near the start. Released: everything selected, cursor at 0. This branch: cursor at 2, nothing selected. Right click still selects all.mouseDraggeddirectly with left or right moves it, and middle does not.🤖 Generated with Claude Code
https://claude.ai/code/session_016VFfUPDxbJ8RqPeQHsAbh7