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

Mouse Wheel scrolls 3 pages at once #23

Open
leissa opened this issue Oct 31, 2024 · 5 comments
Open

Mouse Wheel scrolls 3 pages at once #23

leissa opened this issue Oct 31, 2024 · 5 comments

Comments

@leissa
Copy link

leissa commented Oct 31, 2024

Thanks for the great tool.

I noticed one annoyance: Mouse wheel scrolls 3 pages at once instead of one page at a time.

@itsjunetime
Copy link
Owner

I'm not quite certain what to do about this - tdf scrolls once per mouse 'event', as defined by crossterm's EventStream struct. If you try this on a touchpad, or something that's more granular with how it sends scroll input, you'll see this. However, I do understand that your mouse may just increase its sensitivity by sending more events per scroll, and it's not really reasonable for tdf to automatically know how many scroll events corresponds to a single 'scroll' of the mouse.

I feel like the best solution for this would be some sort of scroll-factor or scroll-sensitivity option? Specifically, the scroll-factor option, which you can enter as an integer, could which defines how many scroll events to wait for before scrolling a single time? Or maybe, on the other side, the scroll-sensitivity option could be passed in as a float between 0.0 -> 1.0 and define what percentage of a scroll each scroll event should represent (e.g. 0.2 would mean you only scroll once per 5 scroll events)?

Do either of these options sound appealing to you or were you thinking something different?

@leissa
Copy link
Author

leissa commented Nov 15, 2024

Okay, so you are saying that one mouse wheel corresponds to several MouseEvents in crossterm? Can't you just empty the event queue after each scroll event?

@itsjunetime
Copy link
Owner

@leissa PR #34 is an attempt at emptying the event queue after each scroll event. Would you be able to pull the code from the PR, build it, and let me know if it fixes your issue?

@leissa
Copy link
Author

leissa commented Nov 19, 2024

I've just tried #34. Unfortunately, the problem still persists. :(

@ralencode
Copy link

for me it's 7 pages at once

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 a pull request may close this issue.

3 participants