Fix sliders & cycling controllers 26.3+ by using constants for mouse buttons (Fixes #348) - #358
Merged
Merged
Conversation
…or mouse buttons (Fixes isXander#348)
isXander
approved these changes
Aug 17, 2026
Owner
|
Thank you! |
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.
I ran into the same issue as #348 with sliders when testing my mod on 26.3.
In 26.3-snapshot-4, we get "unified" mouse device input numbering (mapping left click to 1 instead of 0).
I saw the slider component had these buttons hard-coded, and searched the code to find that the cycling controller was the only other place the code hardcoded 0 and 1 for left and right buttons.
I swapped these hardcoded integers out for
InputConstants.MOUSE_BUTTON_LEFTandInputConstants.MOUSE_BUTTON_RIGHTlike I saw in OptionListWidget and YACLScreen. Now they work great on Fabric 26.3. I assume since there's no Stonecutter branching in those scenarios, and the rest of the code already relies on these constants working fine across all versions, then there's virtually zero risk of this breaking anything on older versions.