Fix scroll input in request pipes - #126
Open
ThePixelbrain wants to merge 1 commit into
Open
Conversation
|
I can confirm that this works as intended on Wayland. Scrolling changes the amount by 1 and down by 1. |
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.
Summary
Fixes mouse scroll input in Logistics Request Pipes or Blocks on X11. When scrolling in these blocks to specify the amount of items to request, the selected amounts gets increased by about 100-200 items per scroll input.
This was previously broken in #78 by fixing scroll input for Wayland. This PR should work for both and also other platforms such as Windows and macOS (though I haven't tested them and don't know if #78 has broken them as well).
In the "original" LP code the raw wheel input from
Mouse.getEventDWheel()was simply divided by 120. This breaks for Wayland, as the wheel input seems to be just +-1, resulting in no increase / decrease.This PR simply checks if the value from
Mouse.getEventDWheel()is positive or negative by setting it to either 1 or -1, so each scroll input will result in the addition or removal of one request item, no matter how much delta is present.The other locations that #78 modified are fine, because the delta is already checked for being positive or negative before being used further.
I could only test this on X11, so testing it on other platforms before merging might be wise.
Checklist