How do I properly implement scrolling in X11?
01:53 21 Apr 2026

The only thing I could find online about scrolling is that Xlib gives you scrolling events as regular XButtonEvents (since, you know, we obviously need to track both scroll button presses and releases). However, this doesn't tell me anything about the amount the user wants to scroll with that button press, and it doesn't cover something like touchpad scrolling. Touchpad scrolling also seems especially horrid, since the user can “throw” the content with the touchpad, thus triggering page movement while not touching the pad. How am I supposed to handle all of this?

c x11 xlib