phpmousesimulate

simulate mouse move in php?


In this question, PHP is used in an unusual way. It is not used as a server side language ("no browser is open"). It is intended to be run on my own computer, simulating mouse move on my computer.

Is it possible to simulate mouse's move in PHP ? By that I mean to do something like :

$mouse->moveToCoordinate($x,$Y); // will move the screen to to the coordinate $X, $Y of the screen
$mouse->moveVector($x,$Y); // will move from the current point to the (current X + $X, current Y + $Y); 
$mouse->click(); // will simulate a mouse click on the screen.

This should be usable, even if no browser is open (so cannot use the classic browser-side javascript solution).


Solution

  • 1 - use exec() and : Simulate mouse movement in Ubuntu . Basically, use any other language, compile it if needed, and use the executable with argument throughout command line.

    2 - PHP-QT might do the trick

    | IT IS POSSIBLE !!! |

    People have suggested to use another language (javascript), but for this problem, it's not possible to use a browser. So other languages will do the trick.

    Thanks for your message though, and if anybody have other solutions, I'd be interested to know them.