Skip to content

Fix script text area mouse clicks on 26.3 - #76

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. WidgetTextArea still used the old values:

  • mouseClicked: the "right click selects all" check (== 1) now matches a left click, so every left click selected the whole script instead of placing the cursor.
  • mouseClicked and mouseDragged: the left-click cursor placement and drag selection (== 0) never ran.

Fix

Compare against InputConstants.MOUSE_BUTTON_RIGHT and MOUSE_BUTTON_LEFT.

Validation

  • ./gradlew build passes, and ./gradlew runGameTestServer passes all 23 required tests.
  • Checked in a NeoForge 26.3 dev client: a Scripting Terminal with a drive and disk, editing a script containing hello world.
    • This branch: a left click placed the cursor at position 6, a drag selected hell, and a right click selected everything.
    • Original master-26 widget, hotswapped into the same client: the left click and the drag both just selected all of hello world.

🤖 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). A left click matched the
old right-click check and selected all text, and cursor placement and
drag selection never ran.

Related to CyclopsMC/IntegratedDynamics#1750

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016VFfUPDxbJ8RqPeQHsAbh7
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 36165311246

Coverage at 51.638% (no base build to compare)

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2618
Covered Lines: 1481
Line Coverage: 56.57%
Relevant Branches: 862
Covered Branches: 316
Branch Coverage: 36.66%
Branches in Coverage %: Yes
Coverage Strength: 20.5 hits per line

💛 - Coveralls

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