Need justification for mouse scroll release event
Hi All,
I just came across a logical problem i m having in one of my module. I have to emulate All mouse events (Right-Middle-Left buttons press/release and scroll up/down events handling).
I am using SuSE-10.2 and application is QT based and i m using XTest library function XTestFakeButtonEvent for emulating mouse events. Untill the handling of "Right-Middle-Left" buttons "press/release" events all things were fine. But the logical thing start from wheel event processing. To Make Mouse Scroll event up & down i used following code respectively.
_XDisplay *XDsp = XOpenDisplay(NULL);
...blah
..blah
.blah
XTestFakeButtonEvent (XDsp, Button4,1, CurrentTime);// Scroll Up Press
XTestFakeButtonEvent (XDsp, Button5,1, CurrentTime);// Scroll Down Press
Technically it is necessary to call corresponding Scroll up & down Release functions after each of the above call. e.g.
1---> XTestFakeButtonEvent (XDsp, Button4,1, CurrentTime); // Scroll Up Press
2---> XTestFakeButtonEvent (XDsp, Button4,0, CurrentTime); // Scroll Up Release
3---> XTestFakeButtonEvent (XDsp, Button5,1, CurrentTime); // Scroll Down Press
4---> XTestFakeButtonEvent (XDsp, Button5,0, CurrentTime); // Scroll Down Release
But my question is. What above two calls does actually and when the scroll release event occurs? i.e. Why the code doesn't run as intended when i comment out both release event function calls(line 2 and 4).
I am just looking for the justification of placing scroll RELEASE event for scroll up/down events just after scroll PRESS event.
Thanks in advance
Deepak Chanalia
|