public class Mouse extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
afterWait |
protected int |
beforeWait |
protected int |
buttons |
protected boolean |
clickDouble |
protected int |
innerWait |
static int |
LEFT |
static int |
MIDDLE |
protected Location |
mousePos |
static int |
RIGHT |
static int |
WHEEL_DOWN |
static int |
WHEEL_STEP_DELAY |
static int |
WHEEL_UP |
Modifier and Type | Method and Description |
---|---|
static Location |
at() |
protected static int |
click(Location loc,
int buttons,
Integer modifiers,
boolean dblClick,
Region region) |
static Location |
click(Location loc,
String action,
Integer... args)
to click (left, right, middle - single or double) at the given location using the given button
only useable for local screens
timing parameters:
- one value < 0 wait before mouse down > 0 wait after mouse up - 2 or 3 values 1st wait before mouse down 2nd wait after mouse up 3rd inner wait (milli secs, cut to 1000): pause between mouse down and up (Settings.ClickDelay) wait before and after: > 9 taken as milli secs - 1 ... |
static void |
down(int buttons)
press and hold the given buttons
Button |
protected static void |
down(int buttons,
Region region) |
static int |
getMouseMovedResponse()
current setting what to do if mouse is moved outside Sikuli's mouse protection
|
static boolean |
hasMoved()
check if mouse was moved since last mouse action
|
static void |
init() |
protected static boolean |
keep(Object owner) |
protected static boolean |
let() |
protected static boolean |
let(Object owner) |
static int |
move(int xoff,
int yoff)
move the mouse from the current position to the offset position given by the parameters
|
static int |
move(Location loc)
move the mouse to the given location (local and remote)
|
protected static int |
move(Location loc,
Region region) |
static void |
reset() |
static void |
setMouseMovedAction(int movedAction)
what to do if mouse is moved outside Sikuli's mouse protection
- Mouse.MouseMovedIgnore (0) ignore it (default) - Mouse.MouseMovedShow (1) show and ignore it - Mouse.MouseMovedPause (2) show it and pause until user says continue (2 not implemented yet - 1 is used) |
static void |
setMouseMovedCallback(Object callBack)
what to do if mouse is moved outside Sikuli's mouse protection
only 3 is honored: in case of event the user provided callBack.happened is called |
static void |
setMouseMovedHighlight(boolean state) |
static void |
up()
release all buttons
|
static void |
up(int buttons)
release the given buttons
Button |
protected static void |
up(int buttons,
Region region) |
protected static boolean |
use() |
protected static boolean |
use(Object owner) |
static void |
wheel(int direction,
int steps)
move mouse using mouse wheel in the given direction the given steps
the result is system dependent |
protected static void |
wheel(int direction,
int steps,
Region region) |
protected static void |
wheel(int direction,
int steps,
Region region,
int stepDelay) |
protected Location mousePos
protected boolean clickDouble
protected int buttons
protected int beforeWait
protected int innerWait
protected int afterWait
public static final int LEFT
public static final int MIDDLE
public static final int RIGHT
public static final int WHEEL_UP
public static int WHEEL_DOWN
public static final int WHEEL_STEP_DELAY
public static void init()
protected static boolean use()
protected static boolean use(Object owner)
protected static boolean keep(Object owner)
protected static boolean let()
protected static boolean let(Object owner)
public static Location at()
public static void reset()
public static int getMouseMovedResponse()
setMouseMovedAction(int)
public static void setMouseMovedAction(int movedAction)
movedAction
- valuepublic static void setMouseMovedCallback(Object callBack)
callBack
- ObserverCallBackpublic static void setMouseMovedHighlight(boolean state)
public static boolean hasMoved()
public static Location click(Location loc, String action, Integer... args)
loc
- where to clickaction
- L,R,M left, right, middle - D means double clickargs
- timing parametersprotected static int click(Location loc, int buttons, Integer modifiers, boolean dblClick, Region region)
public static int move(Location loc)
loc
- Locationpublic static int move(int xoff, int yoff)
xoff
- horizontal offset (< 0 left, > 0 right)yoff
- vertical offset (< 0 up, > 0 down)public static void down(int buttons)
Button
buttons
- valueprotected static void down(int buttons, Region region)
public static void up()
public static void up(int buttons)
Button
buttons
- (0 releases all buttons)protected static void up(int buttons, Region region)
public static void wheel(int direction, int steps)
direction
- Button
steps
- valueprotected static void wheel(int direction, int steps, Region region)
protected static void wheel(int direction, int steps, Region region, int stepDelay)