Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale wheel event value according to whether they're lines or pixels #8

Merged
merged 2 commits into from Dec 27, 2021
Merged

Conversation

rivertam
Copy link
Contributor

When using this with bevy in the browser, this previously would give some whacky behavior with the scroll wheel. Previously, this library was just using event.y, which was 53 on my machine. When I ran with a desktop backend, it was using Line, so it was just feeding back 1, so I assume that's what you were testing with because that looked fine.

@bonsairobo
Copy link
Owner

bonsairobo commented Dec 27, 2021

What is a "line" in this context? MouseScrollUnit doesn't have docs.

@rivertam
Copy link
Contributor Author

rivertam commented Dec 27, 2021

I think it's a click of the scroll wheel, maybe corresponding to a line of text (like a line of code, sort of like pressing the up or down arrow key). I don't think I was able to make it do more than one, and I don't happen to have any other mice to test it with, so the only difference I've noticed for myself is "it's Pixels/53 in my browser and Lines/1 on native" (and it scrolls way too fast in the browser).

The answer is likely in the source code of winit.

@bonsairobo bonsairobo merged commit fb41a44 into bonsairobo:main Dec 27, 2021
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.

None yet

2 participants