Scroll events not captured smoothly on trackpad? (Debian 12 Linux, i3WM, X11)

Godot Version

4.3

Question

I’ve tested 2 methods of scrolling within Godot, a manual scrolling method which I wrote using an integer to keep track of position and listening to event changes in mouseEvent.Factor and another using the scroll container node. There’s always a choppy ‘jump’ that occurs when i scroll using both methods caused by the .Factor property always being output as 0 or 1.0 (0 if no event found, 1.0 if either a scroll up or scroll down event is found). I imagine that the scroll container node’s internals use some similar input capture to the .Factor property of the mouse event, so I wanted to know if anyone has a fix for this?

Any help is appreciated, I’m quite new to the Godot ecosystem.

As a brief side-note, the Godot editor’s menus themselves also don’t scroll smoothly on my device.

if you reply you’ll get a cookie

In X11, scrolling is reported as a sequence of button presses; IIRC “mouse 5” and “mouse 6”, I think? That’s probably what’s causing this; they get reported with a strength of 1 by default. So if you scroll and print the results, you get:

mouse 5 pressed, strength 1
mouse 5 pressed, strength 1
mouse 5 pressed, strength 1
...

Mouse scroll wheels were originally intended for line-wise scrolling of text on machines that weren’t particularly comfortable with floating point yet.

1 Like