Subject: bug#57526: 29.0.50; Precise pixel-scrolling works great with touchpad but not with mouse wheel

From: Po Lu <[email-masked]>
Date: Fri, 02 Sep 2022 09:15:00 +0800

Tassilo Horn <[email-masked]> writes:

> The reason for the difference is that the EVENTs passed to
> pixel-scroll-precision have very different delta values.  The touchpad
> events command emacs to scroll about 20 pixels, the mouse wheel events
> command it to scroll 150 pixels.

Try playing with pixel-scroll-precision-large-scroll-height; start with
a value of 30, and adjust it upwards if it interferes with trackpad
scrolling.

> I see there's some interpolation feature which might be relevant but I
> don't get into that code path because (device-class last-event-frame
> last-event-device) returns core-keyboard instead of mouse.  I get that
> value in both the case where I scrolled using touchpad as well as mouse.
> When I typed something with the real keyboard, it says just keyboard.

That part of the code will be reworked soon in accordance with an
earlier discussion, and you can assist with that by sending the result
of running "xinput list --long", which will help determine why your
mouse is not being recognized by Emacs.

Unfortunately momentum will not work with any non-trackpad mice other
than Apple's "Magic Mouse 2" (which recently gained driver support on
the kernel side), since the necessary tactile information is not
reported to programs by their hardware.