libxdo - Mouse Wheel Up and Down

1,027 views
Skip to first unread message

Saurabh Manchanda

unread,
Apr 17, 2011, 2:29:26 PM4/17/11
to j...@semicomplete.com, xdotoo...@googlegroups.com
Hi,

I'm using the libxdo in my project where I need to simulate all the actions of a mouse. I have been able to perform left & right click plus the drag but I'm having problems with implementing SCROLL. I'm using the following code:

            xdo_mousedown(xdo, CURRENTWINDOW, 4);  
          /*
           * No idea what to put here
           * so that the scroll action actually takes place.
          */
            xdo_mouseup(xdo, CURRENTWINDOW, 4);

I've tried to fill the above void by
1. sending the process to sleep (after doing a mousedown )
2. calling xdo_mousemove_relative

Both of the above don't cause a scroll. Could you please guide me and tell what needs to be done in order to get it working ?


Saurabh Manchanda

Jordan Sissel

unread,
Apr 18, 2011, 2:59:49 AM4/18/11
to Saurabh Manchanda, xdotoo...@googlegroups.com
On Sun, Apr 17, 2011 at 11:29 AM, Saurabh Manchanda <saurab...@gmail.com> wrote:
Hi,

I'm using the libxdo in my project where I need to simulate all the actions of a mouse. I have been able to perform left & right click plus the drag but I'm having problems with implementing SCROLL. I'm using the following code:

            xdo_mousedown(xdo, CURRENTWINDOW, 4);  
          /*
           * No idea what to put here
           * so that the scroll action actually takes place.
          */
            xdo_mouseup(xdo, CURRENTWINDOW, 4);


button 4 is scroll-up, button 5 is scroll-down

If I do 'xdotool click 4' I observe a scroll up as if I had moved my wheel up one click. Same for 'xdotool click 4'

All you should need to do is

xdo_click(xdo, CURRENTWINDOW, 4); // scroll up one unit

Although, mousedown+mouseup should do the same.

-Jordan
Reply all
Reply to author
Forward
0 new messages