Monday, June 2, 2008
Controlling the mouse in OS X
Monday, June 2, 2008
Has anyone seen Flash (AIR, executable, etc.) that controls the x, y position of the SYSTEM mouse?
We can easily hide the system cursor, use a custom cursor, restrict the position of that custom cursor Sprite, but what I'd really like to do is to be able to control the x, y position of the OS X mouse. If its within a certain range, move it with code. I am wondering if AppleScript might be able to do this, or some other method.
I found this method below in an Apple technote, but it's deprecated.
If someone has done this, please share ;)
Update:
I found this link. However I'm not sure how I'd actually call the method I need.
We can easily hide the system cursor, use a custom cursor, restrict the position of that custom cursor Sprite, but what I'd really like to do is to be able to control the x, y position of the OS X mouse. If its within a certain range, move it with code. I am wondering if AppleScript might be able to do this, or some other method.
I found this method below in an Apple technote, but it's deprecated.
This is a really strange thing to want to do, but I am wondering if there is any way at all. Flash needs to send the commands... can it be done via Python maybe or something?
CGDisplayErr CGDisplayMoveCursorToPoint(
CGDirectDisplayID display, CGPoint point);
If someone has done this, please share ;)
Update:
I found this link. However I'm not sure how I'd actually call the method I need.
Comments:
There are currently 2 Comments:
-
said...“I've been able to get this going with java and particularly the java.awt.Robot class. It wouldn't take much to set up a socket server to receive the commands from an air app.
Cheers,
A.”


