/** * move the mouse to the given location (local and remote) * * @param loc Location * @return 1 for success, 0 otherwise */ public static int move(Location loc) { return move(loc, null); }
/** * Move the mouse to this location point * * @return this */ public Location hover() { Mouse.move(this); return this; }
/** * move the mouse pointer to the given target location<br> same as hover<br> Pattern or Filename - do a find before * and use the match<br> Region - position at center<br> Match - position at match's targetOffset<br> * Location - position at that point<br> * * @param <PFRML> Pattern, Filename, Text, Region, Match or Location * @param target Pattern, Filename, Text, Region, Match or Location * @return 1 if possible, 0 otherwise * @throws FindFailed for Pattern or Filename */ public <PFRML> int mouseMove(PFRML target) throws FindFailed { Location loc = getLocationFromTarget(target); int ret = 0; if (null != loc) { ret = Mouse.move(loc, this); } return ret; }
/** * move the mouse from the current position to the offset position given by the parameters * @param xoff horizontal offset (< 0 left, > 0 right) * @param yoff vertical offset (< 0 up, > 0 down) * @return 1 for success, 0 otherwise */ public static int move(int xoff, int yoff) { return move(at().offset(xoff, yoff)); }
public static void init() { if (mouse == null) { log(3, "init start"); mouse = new Mouse(); mouse.device = new Device(mouse); mouse.device.isMouse = true; Location loc = at(); move(loc); mouse.device.lastPos = null; log(3, "init end"); } }
Match aMatch; if (len == 0 || args[0] == null) { Mouse.move(scr.checkMatch()); return Mouse.at(); try { aMatch = wait(args); Mouse.move(aMatch.getTarget()); } catch (Exception ex) { Mouse.move(scr.checkMatch()); Mouse.move(scr.checkMatch().offset(getInteger(aObj), getInteger(args[1]))); return Mouse.at(); } else if (len == 3 && loc != null && isNumber(args[1]) && isNumber(args[2])) { Mouse.move(loc.offset(getInteger(args[1], 0), getInteger(args[2], 0))); return Mouse.at(); Mouse.move(loc); return Mouse.at(); Mouse.move(scr.checkMatch()); return Mouse.at();
/** * move the mouse pointer to the given target location<br> and move the wheel the given steps in the given direction: * <br>Button.WHEEL_DOWN, Button.WHEEL_UP * * @param <PFRML> Pattern, Filename, Text, Region, Match or Location target * @param target Pattern, Filename, Text, Region, Match or Location * @param direction to move the wheel * @param steps the number of steps * @param stepDelay number of miliseconds to wait when incrementing the step value * @return 1 if possible, 0 otherwise * @throws FindFailed if the Find operation failed */ public <PFRML> int wheel(PFRML target, int direction, int steps, int stepDelay) throws FindFailed { Location loc = getLocationFromTarget(target); if (loc != null) { Mouse.use(this); Mouse.keep(this); Mouse.move(loc, this); Mouse.wheel(direction, steps, this, stepDelay); Mouse.let(this); return 1; } return 0; }