mouse-scroll-wheel-acceleration-userspace icon indicating copy to clipboard operation
mouse-scroll-wheel-acceleration-userspace copied to clipboard

The acceleration only works in every second or so mwheel ticks

Open dixflatlinr opened this issue 1 year ago • 6 comments
trafficstars

Sadly the acceleration feature doesn't work as expected. It would be nice if it moved the same amount for each wheel event, but now it moves the original amount for the first event, then the accelerated amount. The expected result would be to move the same amount with every mouse wheel event.

See the attached video with keymon overlay.

https://www.youtube.com/watch?v=FzziK8osZtE

I'm running Deb 12/X11.

dixflatlinr avatar May 19 '24 19:05 dixflatlinr

Acceleration by definition means that you don't have the same amount on each wheel event but that you get a different amount. That's what acceleration means: It increases the velocity over time.

However, if you don't want to have acceleration, but still just faster scrolling, you can get that too.

See the formula again:

m = user_scroll_speed ** exp
target_scroll_speed = user_scroll_speed * m * multiplier

Just set exp=0 and multiplier=2 or so. That will give you twice the speed.

Btw, I saw in your video that you use exp=10. That's way too much. I use exp=0.4 multiplier=1.2 on some system, but it varies a bit on what you prefer, on the mouse and on the OS.

albertz avatar May 19 '24 19:05 albertz

Same issue persist, no matter the values set.

dixflatlinr avatar May 22 '24 11:05 dixflatlinr

Can you try with ./main.py -vv --exp 0 --multiplier 2 and also record a video? I'm also interested in the log output you get then.

albertz avatar May 22 '24 11:05 albertz

It does the same, erroneous behaviour :(.

dixflatlinr avatar May 22 '24 12:05 dixflatlinr

I've checked the code. Since the only thing you can control is whether the event goes through or not and how many times, it would be much easier and straightforward (at least with my mouse this works), is to send multiple events of the same whenever a scroll up/down event occurs.

dixflatlinr avatar May 22 '24 12:05 dixflatlinr

But that's what I do already? In _on_scroll, it calculates the current user velocity (user_scroll_speed), and then it calculates the target velocity based on the acceleration scheme (target_scroll_speed), and thus how much additional scroll events to perform (target_scroll_speed - user_scroll_speed) via _scroll.

albertz avatar May 22 '24 12:05 albertz