/** * @return current location of mouse pointer * @deprecated use {@link Mouse#at()} instead */ @Deprecated public static Location atMouse() { return Mouse.at(); } //</editor-fold>
/** * @return current Location * @deprecated use {@link Mouse#at()} instead */ @Deprecated public static Location getMouseLocation() { return Mouse.at(); }
/** * check if mouse pointer is inside current region * * @return true/false */ public boolean containsMouse() { return contains(Mouse.at()); }
@Override public void smoothMove(Location dest) { smoothMove(Mouse.at(), dest, (long) (Settings.MoveMouseDelay * 1000L)); }
/** * 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)); }
/** * 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 if possible, 0 otherwise */ public int mouseMove(int xoff, int yoff) { try { return mouseMove(Mouse.at().offset(xoff, yoff)); } catch (Exception ex) { return 0; } }
/** * move the mouse with hover() and click using the left button * * @param args see hover() * @return the location, where the click was done */ public static Location click(Object... args) { logCmd("click", args); Location loc = hoverx(args); Mouse.click(null, Button.LEFT, 0, false, null); return Mouse.at(); }
/** * move the mouse with hover() and double click using the left button * * @param args see hover() * @return the location, where the double click was done */ public static Location doubleClick(Object... args) { logCmd("doubleClick", args); Location loc = hoverx(args); Mouse.click(null, Button.LEFT, 0, true, null); return Mouse.at(); }
/** * move the mouse with hover() and do a right click * * @param args see hover() * @return the location, where the right click was done */ public static Location rightClick(Object... args) { logCmd("rightClick", args); Location loc = hoverx(args); Mouse.click(null, Button.RIGHT, 0, false, null); return Mouse.at(); } //</editor-fold>
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"); } }
if (len == 0 || args[0] == null) { Mouse.move(scr.checkMatch()); return Mouse.at(); Mouse.move(scr.checkMatch()); return Mouse.at(); } else if (aObj instanceof Region) { loc = ((Region) aObj).getTarget(); if (isNumber(aObj) && isNumber(args[1])) { 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(); return Mouse.at(); return Mouse.at();
if (getNumberScreens() > 1) { log(lvl, "initScreens: multi monitor mouse check"); Location lnow = Mouse.at(); float mmd = Settings.MoveMouseDelay; Settings.MoveMouseDelay = 0f; lc = s.getCenter(); Mouse.move(lc); lcn = Mouse.at(); if (!lc.equals(lcn)) { log(lvl, "*** multimonitor click check: %s center: (%d, %d) --- NOT OK: (%d, %d)",
if (loc == null) { shouldMove = false; loc = at();