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.
This PR accounts for horizontal scrolling (as opposed to the traditional vertical scrolling), i.e. when holding SHIFT on macOS, to be accounted for by the game by passing
xoffset
(horizontal scroll offset) instead ofyoffset
(vertical scroll offset) toMouse#addWheelEvent
whenyoffset
is0
(and thus not vertical) when initializingDisplay$Window#mouseButtonCallback
.This was a bug in Minecraft ever since it updated to LWJGL 3 officially, until it was fixed in 1.20.2.
Note that the vanilla game (now) inverts horizontal scrolling by default - for example, in my case (on my macOS machine), when scrolling through items in the hotbar, scrolling normally would move the item selector(?) in one direction, while doing so while holding SHIFT would move it in the other.
This does not match the behavior of the few mods that fixed this issue before Mojang did (including EmuNO, MacOS Input Fixes, and McMouser), which would scroll in the same direction regardless of whether SHIFT was held.
Because of this discrepancy, this PR also adds a config option to invert horizontal scrolling specifically. Note that it respects / "stacks with" the general "invert scrolling" config option - having both enabled would invert horizontal scrolling twice, making it go in the same direction as when both config options are disabled, etc.