I have looked all over, and was shocked to be unable to find anything on the topic.
I just want to be able to capture events from a simple mouse scrollwheel.
Yep, this is incredibly confusing. That's because X11 decided to assign mouse scroll wheel events as mouse button 4 and 5. Receiving scrollwheel events is the same as receiving mouse button press events (ButtonPress events according to /usr/include/X11/X.h). Note also that the header file defines Button1..Button5. Buttons 4 and 5 correspond to up or down-- maybe not that order, you'll have to determine this empirically. The header file never mentions scrollwheel events.
Thankfully, higher level APIs (like GDK) explicitly provide scrollwheel support by name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With