/** * each screen has exactly one robot (internally used for screen capturing) * <br>available as a convenience for those who know what they are doing. Should not be needed * normally. * * @param id of the screen * @return the AWT.Robot of the given screen, if id invalid the primary screen */ public static IRobot getRobot(int id) { return getScreen(id).getRobot(); }
private IRobot getRobotForRegion() { if (getScreen() == null || isScreenUnion) { return Screen.getPrimaryScreen().getRobot(); } return getScreen().getRobot(); }
protected static void up(int buttons, Region region) { if (get().device.isSuspended()) { return; } Screen.getRobot(region).mouseUp(buttons); if (region != null) { get().device.let(region); } }
protected static void down(int buttons, Region region) { if (get().device.isSuspended()) { return; } get().device.use(region); Screen.getRobot(region).mouseDown(buttons); }
protected static void wheel(int direction, int steps, Region region, int stepDelay) { if (get().device.isSuspended()) { return; } IRobot r = Screen.getRobot(region); get().device.use(region); Debug.log(3, "Region: wheel: %s steps: %d", (direction == WHEEL_UP ? "WHEEL_UP" : "WHEEL_DOWN"), steps); for (int i = 0; i < steps; i++) { r.mouseWheel(direction); r.delay(stepDelay); } get().device.let(region); } }
public static void reset() { if (mouse == null) { return; } get().device.unblock(get().device.owner); mouse.get().device.let(get().device.owner); get().device.let(get().device.owner); get().device.mouseMovedResponse = get().device.MouseMovedIgnore; get().device.mouseMovedCallback = null; get().device.callback = null; get().device.lastPos = null; Screen.getPrimaryScreen().getRobot().mouseReset(); }