Connecting Tech Pros Worldwide Forums | Help | Site Map

Move Mouse with keyboard

Familiar Sight
 
Join Date: Sep 2007
Posts: 181
#1: Sep 22 '08
Hey just doing a little expirement is it possible to change the position of the mouse at runtime with .php, i.e. in the case that u want to move the mouse with a keyboard.

It doesn't have to be in the same document cause i know .php is pre-compiled so wont run at runtime but perhaps a pop up screen that can refresh.

Any ideas on how to change the positon of the mouse first will be great, then ill look into how to reading in keyboard input lol.

Any help is always appreciated

MarkoKlacar's Avatar
Expert
 
Join Date: Aug 2007
Location: Stockholm, Sweden
Posts: 294
#2: Sep 22 '08

re: Move Mouse with keyboard


Hi,

You could start with this. It does not entirely do what you describe, I'm not quite sure you can do what you describe. Still it's an interesting thought....

Good luck.

/MK
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#3: Sep 22 '08

re: Move Mouse with keyboard


Hi.

Are you trying to do this in a web-page?
If so then no, you won't (and shouldn't) be able to do that.

If you want this to control the mouse of on the server machine, then it may be possible. It would depend on your OS. Would most likely require some additional external code. I can't find any PHP extension that is meant to do this.
Familiar Sight
 
Join Date: Sep 2007
Posts: 181
#4: Sep 22 '08

re: Move Mouse with keyboard


Thanks for info on mouse events that should be a good place to start with recognizings mouse position on a screen.

The next i was wondering how do i send a mouse click, is there any php function that could replicate this??

Oh yer also i am trying to do this on a website, so it could possible need to be a bit of a mix between javascript and php.

Thanks for the replys,
MarkoKlacar's Avatar
Expert
 
Join Date: Aug 2007
Location: Stockholm, Sweden
Posts: 294
#5: Sep 22 '08

re: Move Mouse with keyboard


Hi,

Just keep checking the php.net site, you'll find all the info there.
What you're trying to do seems like a longshot but good luck.

/MK
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#6: Sep 23 '08

re: Move Mouse with keyboard


Heya, Chazzy.

If you're running the script on a Mac, you should be able to shell_exec() some osascript to interact with the system. It's a big ol' hack, but what the heck; it works (:
Reply