Take the 2-minute tour ×

I having small doubt in generating mouse event from C program. I am writing a program to generate mouse events from a C program in linux. I have implemented mouse click,drag. .. etc using xlib. But dont have any idea about generating mouse scroll event.

Operating System : Fedora 15

share|improve this question

1 Answer 1

X11 has two mechanism to report scroll events. The old-fashioned way is to treat the scroll wheel as two extra mouse buttons: scroll up is reported as button 4 and scroll down as button 5 (or vice versa, I don't remember). The modern way is to report them via the XInput2 extension, which allows things like horizontal scrolling and smooth scroll and suchlike.

share|improve this answer

Your Answer


