Monday, June 2, 2008
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.
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.” -
said...
-
“hey mate. i just tried to use your contact form to send you a link to an example i knocked up for you and it said "do NOT try to do that" or something along those lines. Anyhow, in case the email didn't go through the link to the source is available at
http://lithium.codelib.net.au/andrew/CursorController.zip
feel free to use it how you wish if you think it's useful.
Cheers,
Andrew.”





