/** * Move the mouse to this location point and double click left * * @return this */ public Location doubleClick() { Mouse.click(this, "LD"); return this; }
/** * Move the mouse to this location point and click left * * @return this */ public Location click() { Mouse.click(this, "L"); return this; }
/** * Move the mouse to this location point and click right * * @return this */ public Location rightClick() { Mouse.click(this, "R"); return this; }
/** * right click at the given target location<br> holding down the given modifier keys<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 * @param modifiers the value of the resulting bitmask (see KeyModifier) * @return 1 if possible, 0 otherwise * @throws FindFailed for Pattern or Filename */ public <PFRML> int rightClick(PFRML target, Integer modifiers) throws FindFailed { Location loc = getLocationFromTarget(target); int ret = 0; if (null != loc) { ret = Mouse.click(loc, InputEvent.BUTTON3_MASK, modifiers, false, this); } //TODO SikuliActionManager.getInstance().rightClickTarget(this, target, _lastScreenImage, _lastMatch); return ret; }
/** * left click at the given target location<br> holding down the given modifier keys<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> to search: Pattern, Filename, Text, Region, Match or Location * @param target Pattern, Filename, Text, Region, Match or Location * @param modifiers the value of the resulting bitmask (see KeyModifier) * @return 1 if possible, 0 otherwise * @throws FindFailed for Pattern or Filename */ public <PFRML> int click(PFRML target, Integer modifiers) throws FindFailed { Location loc = getLocationFromTarget(target); int ret = 0; if (null != loc) { ret = Mouse.click(loc, InputEvent.BUTTON1_MASK, modifiers, false, this); } //TODO SikuliActionManager.getInstance().clickTarget(this, target, _lastScreenImage, _lastMatch); return ret; }
/** * double click at the given target location<br> holding down the given modifier keys<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 * @param modifiers the value of the resulting bitmask (see KeyModifier) * @return 1 if possible, 0 otherwise * @throws FindFailed for Pattern or Filename */ public <PFRML> int doubleClick(PFRML target, Integer modifiers) throws FindFailed { Location loc = getLocationFromTarget(target); int ret = 0; if (null != loc) { ret = Mouse.click(loc, InputEvent.BUTTON1_MASK, modifiers, true, this); } //TODO SikuliActionManager.getInstance().doubleClickTarget(this, target, _lastScreenImage, _lastMatch); return ret; }
/** * 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 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 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>
Device.delay(mouse.beforeWait); Settings.ClickDelay = mouse.innerWait / 1000; click(loc, mouse.buttons, 0, ((Mouse) get()).clickDouble, null); Device.delay(mouse.afterWait); get().device.let();