Skip to content

Implement high resolution scrolling

https://www.kernel.org/doc/html/latest/input/event-codes.html#ev-rel

Using REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES should allow for more fine-grained scrolling for those applications that support it.

Make sure to emit BOTH events. REL_WHEEL/REL_HWHEEL should be emitted every 120 units of REL_WHEEL_HI_RES/REL_HWHEEL_HI_RES. Use a counter for both that adds emitted event values to itself and emits a wheel event when it reaches 120/-120, resetting 120 units closer to 0.

Also implement mouse.wheel.sensitivity setting which is used to control the maximum scroll speed. The speed should increase linearly from deadzone to minimum/maximum nub value.

Edited by Teemu Erkkola