@Unstable public class MouseRobotImpl extends Object implements MouseRobot
Constructor and Description |
---|
MouseRobotImpl(BaseRobot baseRobot) |
Modifier and Type | Method and Description |
---|---|
Set<MouseButton> |
getPressedButtons()
Gets the buttons that have been pressed but not yet released.
|
void |
move(Point2D location)
Moves mouse to given location.
|
void |
moveNoWait(Point2D location)
Moves mouse to given location.
|
void |
press(MouseButton... buttons)
Presses given buttons, until explicitly released via
MouseRobot.release(MouseButton...) . |
void |
pressNoWait(MouseButton... buttons)
Presses given buttons, until explicitly released via
MouseRobot.release(MouseButton...) . |
void |
release(MouseButton... buttons)
Releases given buttons.
|
void |
releaseNoWait(MouseButton... buttons)
Releases given buttons.
|
void |
scroll(int wheelAmount)
Scrolls mouse wheel by the given amount.
|
void |
scrollNoWait(int wheelAmount)
Scrolls mouse wheel by the given amount.
|
public BaseRobot baseRobot
public MouseRobotImpl(BaseRobot baseRobot)
public final Set<MouseButton> getPressedButtons()
MouseRobot
getPressedButtons
in interface MouseRobot
public void press(MouseButton... buttons)
MouseRobot
MouseRobot.release(MouseButton...)
. Once pressed,
calls WaitForAsyncUtils.waitForFxEvents()
.
Note: passing in an empty MouseButton[]
will call press(MouseButton.PRIMARY)
.press
in interface MouseRobot
buttons
- the mouse buttonspublic void pressNoWait(MouseButton... buttons)
MouseRobot
MouseRobot.release(MouseButton...)
. Once pressed,
WaitForAsyncUtils.waitForFxEvents()
is not called.
Note: passing in an empty MouseButton[]
will call press(MouseButton.PRIMARY)
.pressNoWait
in interface MouseRobot
buttons
- the mouse buttonspublic void release(MouseButton... buttons)
MouseRobot
WaitForAsyncUtils.waitForFxEvents()
.
Note: passing in an empty MouseButton[]
will release all pressed MouseButton
s.release
in interface MouseRobot
buttons
- the mouse buttonspublic void releaseNoWait(MouseButton... buttons)
MouseRobot
WaitForAsyncUtils.waitForFxEvents()
is not called.
Note: passing in an empty MouseButton[]
will release all pressed MouseButton
s.releaseNoWait
in interface MouseRobot
buttons
- the mouse buttonspublic void move(Point2D location)
MouseRobot
WaitForAsyncUtils.waitForFxEvents()
.move
in interface MouseRobot
location
- the location to movepublic void moveNoWait(Point2D location)
MouseRobot
WaitForAsyncUtils.waitForFxEvents()
is
not called.moveNoWait
in interface MouseRobot
location
- the location to movepublic void scroll(int wheelAmount)
MouseRobot
WaitForAsyncUtils.waitForFxEvents()
.scroll
in interface MouseRobot
wheelAmount
- the amount to scrollpublic void scrollNoWait(int wheelAmount)
MouseRobot
WaitForAsyncUtils.waitForFxEvents()
is not called.scrollNoWait
in interface MouseRobot
wheelAmount
- the amount to scroll