Fix terminal mouse clicks being misread on 26.3 - #230
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). Tabs, sort and other buttons only reacted to button 0, so left clicks did nothing, and storage slot clicks treated left as right. Compare against the InputConstants constants, and convert to container click buttons before passing them to the tab click handlers, as vanilla does. The pick-item drag check now matches the key binding properly. Closes CyclopsMC/IntegratedDynamics#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016VFfUPDxbJ8RqPeQHsAbh7
This was referenced Sep 25, 2026
rubensworks
commented
Sep 25, 2026
Instead of converting to vanilla container click buttons, ITerminalStorageTabClient#handleClick now receives InputConstants.MOUSE_BUTTON_* values directly. 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.
Fixes CyclopsMC/IntegratedDynamics#1750.
Cause
Minecraft 26.3 moved input to SDL, so
MouseButtonEvent.button()now uses SDL ids: left1, middle2, right3(InputConstants.MOUSE_BUTTON_*). Before, it used GLFW ids: left0, right1, middle2. The terminal code still compared against the old values:0, so a left click did nothing. On the sort buttons, a left click took the "right click" branch and reset the sorter, so it looked like nothing happened.handleClick, which checked for the old values. A left click was handled as a right click (half stack), and a right click as a middle click.mouseDraggeddelegation to the focused widget never fired.Fix
InputConstants.MOUSE_BUTTON_LEFT/MOUSE_BUTTON_RIGHT/MOUSE_BUTTON_MIDDLEeverywhere.ITerminalStorageTabClient#handleClicknow takesInputConstants.MOUSE_BUTTON_*values (javadoc updated).TerminalStorageTabIngredientComponentClientcompares against them, and the internal callers that passed0now passMOUSE_BUTTON_LEFT. This changes the meaning of themouseButtonargument in that API, so external implementers or callers (e.g. IntegratedTerminalsCompat) need the same update.keyPickItem.getKey().getValue() == button - 100, an old offset that never matched. It now useskeyPickItem.isActiveAndMatches(...).Validation
setTabByIndexdirectly worked. Logging showed a left click arriving asbutton() == 1../gradlew buildpasses, and./gradlew runGameTestServerpasses all 83 required tests.🤖 Generated with Claude Code
https://claude.ai/code/session_016VFfUPDxbJ8RqPeQHsAbh7