static void moveMouse(int newx, int newy) ctex { Point p = getMouseLocation(); //int steps = 20, delay = 40; // slow //int steps = 20, delay = 20; // fast int steps = 20, delay = 30; // medium new Robot robot; for (int i = 1; i <= steps; i++) { Point p2 = blendPoints(p, new Point(newx, newy), ((double) i) / steps); robot.mouseMove(p2.x, p2.y); if (i != steps) sleep(delay); } } static void moveMouse(Pt p) { if (p != null) moveMouse(p.x, p.y); }