protected boolean let() { return let(null); }
protected static boolean let() { return get().device.let(null); }
/** * free the mouse globally for this owner after a block(owner) * * @param ownerGiven Object * @return success (false means: not blocked currently for this owner) */ public boolean unblock(Object ownerGiven) { if (ownerGiven == null) { ownerGiven = device; } else if (isNotLocal(ownerGiven)) { return false; } if (blocked && owner == ownerGiven) { blocked = false; let(ownerGiven); return true; } return false; }
protected static boolean let(Object owner) { return get().get().device.let(owner); }
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); } }
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(); }
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); } }
protected static int move(Location loc, Region region) { if (get().device.isSuspended()) { return 0; } if (loc != null) { IRobot r = null; IScreen s = loc.getScreen(); if (s == null) { return 0; } r = s.getRobot(); if (r == null) { return 0; } if (!r.isRemote()) { get().device.use(region); } r.smoothMove(loc); r.waitForIdle(); if (!r.isRemote()) { get().device.let(region); } return 1; } return 0; }
click(loc, mouse.buttons, 0, ((Mouse) get()).clickDouble, null); Device.delay(mouse.afterWait); get().device.let(); return loc;
r.waitForIdle(); profiler.lap("before let"); get().device.let(region); long duration = profiler.end(); Debug.action(getClickMsg(loc, buttons, modifiers, dblClick, duration));