Skip to content

Fix widget mouse button checks on 26.3 - #247

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

rubensworks merged 1 commit into
master-26from
fix-mouse-buttons-26.3

Conversation

@rubensworks

@rubensworks rubensworks commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

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 left 1, middle 2, right 3 (InputConstants.MOUSE_BUTTON_*). Before, it used GLFW's left 0, right 1, middle 2. 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 == 0 check never matched, so the override that passes drags to the focused widget was skipped. Vanilla's AbstractContainerScreen#mouseDragged swallows 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 || == 1 only 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_LEFT and MOUSE_BUTTON_RIGHT. Everything is in loader-common, so all loaders get the fix.

Validation

  • ./gradlew build passes for all loaders, and ./gradlew runGameTestServer passes (all required tests).
  • Checked in a NeoForge 26.3 dev client (IntegratedTerminals and IntegratedDynamics), comparing the released CyclopsCore 1.30.0-1159 with this branch published to Maven local:
    • Storage Terminal search box containing diamond, left click near the start. Released: everything selected, cursor at 0. This branch: cursor at 2, nothing selected. Right click still selects all.
    • Logic Programmer: press on the scrollbar, drag down a bit, then drag onto a hotbar slot. Released: scroll stays at 0.21. This branch: it continues to 1.0.
    • Storage Terminal scrollbar: a real left drag from the top to the bottom scrolls to the end. Calling the widget's mouseDragged directly with left or right moves it, and middle does not.

🤖 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).

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

Copy link
Copy Markdown

@coveralls

coveralls commented Sep 25, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 31.278%. remained the same — fix-mouse-buttons-26.3 into master-26

@rubensworks
rubensworks merged commit c7addd1 into master-26 Sep 25, 2026
7 checks passed
@rubensworks
rubensworks deleted the fix-mouse-buttons-26.3 branch September 25, 2026 17:58
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