top | item 35586008

Mouse scroll wheel acceleration, implemented in user space

75 points| albertzeyer | 3 years ago |github.com | reply

54 comments

order
[+] 082349872349872|3 years ago|reply
Ages ago, in my own editor (and missing HP chipmunk physical "paddle wheel" scrolling), I implemented the following mouse scrolling scheme:

    - Integrate the area* enclosed by recent mouse movement
    - Ignore everything under a threshold (this is normal, straight-line, mousing)
    - Scroll according to the sign of the area.
        . naively this would be slow scroll for small circles; fast for large
        . but I found it more intuitive to reverse the action:
            the bigger the gesture, the more controlled the scroll
            (probably closer to scroll-by-radian than scroll-by-area)
It looks like I could use this package to do something similar, only system-wide and portably, but I mention it here as it's the sort of project I'm extremely unlikely to Get Around To (and would therefore be chuffed if someone else were to!)

* https://en.wikipedia.org/wiki/Planimeter

[+] rzzzt|3 years ago|reply
Both Synaptics and ELAN drivers offered circular/chiral scrolling, but it seems this option is not prominently featured (or maybe unavailable) in Windows 10 and above.

IIRC the gesture starts at the edge of the trackpad much like regular edge scrolling, but then you can extend the motion to the entire working area of the trackpad, pretending to spin an imaginary jog wheel.

[+] numbol|3 years ago|reply
It was also implemented physically in some mouses

for example, Logtiech G502: " Dual-Mode Hyper-Fast Scroll Wheel

Unlock the scroll wheel for hyper-fast continuous scrolling to spin quickly through long pages, or lock it down for single click precision scrolling. The weighty, metal wheel delivers confident, smooth and satisfying control for either mode. "

https://www.youtube.com/watch?v=aANF2OOVX40 ( Interstellar Mouse ^^ )

[+] jaquesy|3 years ago|reply
This is what I love about the MX Master 3, it's like a hybrid for this where it has precision scrolling when moving it slowly but give it a flick and it will automatically unlock and go into smooth scrolling. https://youtu.be/KTzZui0nrrs

I wish this feature was on more mice

[+] jimbob45|3 years ago|reply
Until you have an unlocked wheel, you don’t know what you’re missing out on.

On the other hand, gestures in Firefox, specifically “Scroll to Bottom”, have made me miss mine less. Also, unlocked scroll wheels get you banned within seconds on Counter Strike servers for input lag.

[+] mock-possum|3 years ago|reply
It’s a feature that I rolled my eyes at when I got my mouse, but now use several times a day. Unlock the wheel and spiiiiiiiiiiiiiin until I get far enough down the page. So much more convenient and versatile than clicking and dragging the scroll bar tab.
[+] kevviiinn|3 years ago|reply
The G502 is a phenomenal mouse
[+] berkes|3 years ago|reply
I have one of those at my current job.

I very much dislike it. Probably because I'm not used to it.

Gnome, my DE, has all sorts of 'scroll on hover' tricks. Scroll while hovering an app icon, will "alt tab" between windows of that app. Scroll over the volume icon to up or down it. And so forth.

At least once a day, all my windows get jumbled, or the volume set to 100, because the wheel was spinning while I moved my mouse over something. I did learn of some nice scroll-on-hover features in Gnome this way, though.

[+] deutschepost|3 years ago|reply
I wish there would be a setting that the mouse works normal when locked, but would scroll one pixel at a time when unlocked. It feels very unnatural to scroll with an unlocked mousewheel and not scroll when doing small adjustments.
[+] spoonjim|3 years ago|reply
How would that have acceleration?
[+] Kwpolska|3 years ago|reply
The acceleration macOS has for boring old mice with boring old scroll wheels is atrocious. The first movement of the wheel barely scrolls things, and makes precise scrolling harder. I prefer the Windows behaviour of constant but usually larger (and configurable) distances.
[+] asksomeoneelse|3 years ago|reply
Ah yes, the monday morning little ritual: try to move down a dozen lines, maybe half a page, scroll a bit and realized I moved 3 pixels. Try again scrolling a bit faster and end up zooming by 3 pages. Repeat in the other direction. Use the scroll bar out of desperation after 3 failed attempts.

Gets a bit better once the coffee and the muscle memory kick in, but I really wish Apple would give some love to common old-fashioned rodents instead of letting their users having to rely on community-made apps to have a decent behavior for those. I'm probably not the only one using a laptop provided by an employer with fairly strict rules about the installation of "unnecessary" software.

[+] canadaduane|3 years ago|reply
Forgive me if I'm incorrect, but doesn't a user space implementation mean it does not understand to reset momentum between window focus events? So if I scroll like crazy in app1 then Alt-Tab to app2, scrolling carries to app2?
[+] albertzeyer|3 years ago|reply
Yes that's correct. That's certainly a problem I sometimes actually observe.

Although you could extend it to handle that. But that makes it more platform dependent. E.g. on Linux and MacOS, the scroll events are send to the top-most window under the mouse cursor. It does not matter what window you have focused. I think on Windows it is always send to the focused windows?

PRs are welcome. :)

[+] dwattttt|3 years ago|reply
It could be designed either way; shared memory could allow current velocity etc to be shared between processes, or it could just not be shared. I haven't checked this implementation to see which it would be
[+] pjmlp|3 years ago|reply
While not part of the OS, this has been available in many Windows drivers provided by mouse vendors for ages, e.g Logitech.

Naturally installing them also installs some other junk that the hardware makers always do for product differentiation.

[+] heavyset_go|3 years ago|reply
Looks like this is X based, wonder if it could be ported to Wayland.
[+] albertzeyer|3 years ago|reply
In the README, I mentioned X11 because an earlier implementation was for X11.

However, this implementation now is platform independent. It uses pynput. It should work on all major desktop environments, like X11, Wayland, MacOS, Windows.

[+] cachvico|3 years ago|reply
Isn't this exactly what the Mac touchpad and the Apple mouse's touch-scroll-wheel do?
[+] skavi|3 years ago|reply
that is exactly what it says in the linked article