Skip to content

Fix terminal mouse clicks being misread on 26.3 - #230

Merged
rubensworks merged 2 commits into
master-26from
fix-mouse-buttons-26.3
Sep 25, 2026
Merged

rubensworks merged 2 commits into
master-26from
fix-mouse-buttons-26.3

Conversation

@rubensworks

@rubensworks rubensworks commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Fixes CyclopsMC/IntegratedDynamics#1750.

Cause

Minecraft 26.3 moved input to SDL, so MouseButtonEvent.button() now uses SDL ids: left 1, middle 2, right 3 (InputConstants.MOUSE_BUTTON_*). Before, it used GLFW ids: left 0, right 1, middle 2. The terminal code still compared against the old values:

  • Tab selection and all left-column buttons (sort, filter, scale, auto-refill) only reacted to button 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.
  • Storage slot clicks passed the raw button to 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.
  • mouseDragged delegation to the focused widget never fired.

Fix

  • Compare against InputConstants.MOUSE_BUTTON_LEFT / MOUSE_BUTTON_RIGHT / MOUSE_BUTTON_MIDDLE everywhere.
  • ITerminalStorageTabClient#handleClick now takes InputConstants.MOUSE_BUTTON_* values (javadoc updated). TerminalStorageTabIngredientComponentClient compares against them, and the internal callers that passed 0 now pass MOUSE_BUTTON_LEFT. This changes the meaning of the mouseButton argument in that API, so external implementers or callers (e.g. IntegratedTerminalsCompat) need the same update.
  • The pick-item drag check used keyPickItem.getKey().getValue() == button - 100, an old offset that never matched. It now uses keyPickItem.isActiveAndMatches(...).

Validation

  • Reproduced with clientdevbridge on a NeoForge 26.3 dev client (cable, Storage Terminal, Item Interface on chests). Before the fix, clicking either tab did nothing, while calling setTabByIndex directly worked. Logging showed a left click arriving as button() == 1.
  • After the fix, in the same client:
    • the tabs switch, and AZ sorting toggles between descending and ascending
    • on a 64 stack, a left click picks up 64, a right click 32 and a middle click 1
    • a left click puts the selection into a player slot, and a shift-click moves it back into storage (checked on the server side)
  • ./gradlew build passes, and ./gradlew runGameTestServer passes all 83 required tests.
  • No automated test added: this code is GUI input handling.

🤖 Generated with Claude Code

https://claude.ai/code/session_016VFfUPDxbJ8RqPeQHsAbh7

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
@coveralls

coveralls commented Sep 25, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 36170820108

Coverage decreased (-0.003%) to 27.46%

Details

  • Coverage decreased (-0.003%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 470 coverage regressions across 8 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

470 previously-covered lines in 8 files lost coverage.

File Lines Losing Coverage Coverage
org/cyclops/integratedterminals/core/terminalstorage/TerminalStorageTabIngredientComponentClient.java 223 0.66%
org/cyclops/integratedterminals/client/gui/container/ContainerScreenTerminalStorage.java 123 0.0%
org/cyclops/integratedterminals/client/gui/container/ContainerScreenTerminalCraftingJobs.java 56 0.0%
org/cyclops/integratedterminals/inventory/container/ContainerTerminalStorageBase.java 45 44.53%
org/cyclops/integratedterminals/core/terminalstorage/button/TerminalButtonSortClient.java 8 0.0%
org/cyclops/integratedterminals/core/terminalstorage/button/TerminalButtonFilterCraftingClient.java 5 0.0%
org/cyclops/integratedterminals/core/terminalstorage/button/TerminalButtonItemStackCraftingGridAutoRefillClient.java 5 0.0%
org/cyclops/integratedterminals/core/terminalstorage/button/TerminalButtonScaleGuiClient.java 5 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 7857
Covered Lines: 2411
Line Coverage: 30.69%
Relevant Branches: 2649
Covered Branches: 474
Branch Coverage: 17.89%
Branches in Coverage %: Yes
Coverage Strength: 1.57 hits per line

💛 - Coveralls

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
@rubensworks
rubensworks merged commit 10556d4 into master-26 Sep 25, 2026
3 checks passed
@rubensworks
rubensworks deleted the fix-mouse-buttons-26.3 branch September 25, 2026 18:06
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.

3 participants