public class Mouse extends Object
Modifier and Type | Field and Description |
---|---|
static int |
LEFT |
static int |
MIDDLE |
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() |
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 |
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() |
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)
|
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 |
static void |
wheel(int direction,
int steps)
move mouse using mouse wheel in the given direction the given steps
the result is system dependent |
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()
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 parameterspublic 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
- valuepublic static void up()
public static void up(int buttons)
Button
buttons
- (0 releases all buttons)public static void wheel(int direction, int steps)
direction
- Button
steps
- valueCopyright © 2017. All rights reserved.