Creating a mouse scroll event on Linux

I have little doubt about generating mouse events from program C. I am writing a program to generate mouse events from program C on Linux. I implemented a mouse click, drag and drop ... etc using xlib. But I have no idea about generating a mouse scroll event.

Operating System: Fedora 15

+4
source share
1 answer

X11 has two mechanisms for reporting scroll events. The old-fashioned way is to access the scroll wheel in the form of two additional mouse buttons: scrolling up is reported as button 4 and scrolling down as button 5 (or vice versa, I don’t remember). The modern way is to report them through the XInput2 extension, which allows you to use functions such as horizontal scrolling and smooth scrolling, etc.

0
source

All Articles