One of the easiest ways to move the mouse in Mac OS X and other operating systems is to use a Java Robot. It can also simulate other events. For example, the mouse down or even a key press. However, it moves the pointer to a given screen coordinates. So the only thing you need to do is to convert your physical units into appropriate coordinates. Here is a code example:
import java.awt.AWTException;
import java.awt.Robot;
public final class JavaRobotExample
{
public static void main(String[] args) throws AWTException
{
Robot robot = new Robot();
robot.setAutoDelay(5);
robot.setAutoWaitForIdle(true);
robot.mouseMove(0, 0);
robot.delay(1000);
robot.mouseMove(200, 10);
robot.delay(1000);
robot.mouseMove(40, 130);
System.exit(0);
}
}
To test this code, put it into JavaRobotExample.java file, then compile it using the following command:
javac JavaRobotExample.java
Once JavaRobotExample.class file is produced, run it:
java JavaRobotExample
Java runtime comes with Mac OS X by default. I am not sure about the SDK (compiler) though. If you don't have a javac command, simply install Xcode.