PDA

View Full Version : Simulate mouse clicks



cam888
September 25th, 2009, 09:45 PM
Is there a way to simulate mouse clicks in ubuntu, preferably using a compiled language (python, php), but I don't mind having to use C/C++. For example a function like Click(x, y) kind of thing. Anyone know of anything?

Thanks

doas777
September 25th, 2009, 09:48 PM
Is there a way to simulate mouse clicks in ubuntu, preferably using a compiled language (python, php), but I don't mind having to use C/C++. For example a function like Click(x, y) kind of thing. Anyone know of anything?

Thanks

I do it in C# on windows on occasion. check out the mono runtime.

cam888
September 25th, 2009, 10:07 PM
I don't really know C#, and I'd prefer not to have to learn another language for this. Thank you anyway though. Anyone know of any other way?

unutbu
September 25th, 2009, 10:14 PM
If you install the xdotool package, you can simulate a mouse click by running


xdotool click 1 # left mouse click
xdotool click 2 # middle mouse click
xdotool click 3 # right mouse click
xdotool mousemove 500 500 # moves the mouse to (500,500)

cam888
September 25th, 2009, 10:19 PM
Thank you, that looks perfect.