Can I control the mouse cursor from within R?

Posted by Bernd Meyer on Stack Overflow See other posts from Stack Overflow or by Bernd Meyer
Published on 2013-11-01T09:48:01Z Indexed on 2013/11/01 9:53 UTC
Read the original article Hit count: 184

Filed under:
|
|

Is it possible, to control the mouse pointer from the R console?

I have something like this in mind:

move_mouse(x_pos=100,y_pos=200)   # move the mouse pointer to position (100,200)
mouse_left_button_down            # simulate a press of the left button
move_mouse(x_pos=120,y_pos=250)   # move mouse to select something
mose_release_left_button          # release the pressed button

In MATLAB, something like this is possible with the following code

import java.awt.Robot;
mouse = Robot;
mouse.mouseMove(0, 0);
mouse.mouseMove(100, 200);

Is something similar possible for the keybord? E.g. simulate keybord events?

© Stack Overflow or respective owner

Related posts about r

    Related posts about keyboard