-
- All Known Implementing Classes:
MouseRobotImpl
public interface MouseRobot
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<MouseButton>getPressedButtons()Gets the mouse buttons that have been pressed but not yet released.voidmove(Point2D location)Moves the mouse to the given location.voidmoveNoWait(Point2D location)Moves the mouse to the given location.voidpress(MouseButton... buttons)Presses the given mouse buttons, until explicitly released viarelease(MouseButton...).voidpressNoWait(MouseButton... buttons)Presses the given mouse buttons, until explicitly released viarelease(MouseButton...).voidrelease(MouseButton... buttons)Releases the given mouse buttons.voidreleaseNoWait(MouseButton... buttons)Releases the given mouse buttons.voidscroll(int wheelAmount)Scrolls the mouse wheel by the given amount.voidscrollNoWait(int wheelAmount)Scrolls the mouse wheel by the given amount.
-
-
-
Method Detail
-
press
void press(MouseButton... buttons)
Presses the given mouse buttons, until explicitly released viarelease(MouseButton...). Once pressed, callsWaitForAsyncUtils.waitForFxEvents().Note: passing in an empty
MouseButton[]will callpress(MouseButton.PRIMARY).- Parameters:
buttons- the mouse buttons to press
-
pressNoWait
void pressNoWait(MouseButton... buttons)
Presses the given mouse buttons, until explicitly released viarelease(MouseButton...). Once pressed,WaitForAsyncUtils.waitForFxEvents()is not called.Note: passing in an empty
MouseButton[]will callpress(MouseButton.PRIMARY).- Parameters:
buttons- the mouse buttons to press without waiting afterwards
-
getPressedButtons
Set<MouseButton> getPressedButtons()
Gets the mouse buttons that have been pressed but not yet released.- Returns:
- an (unmodifiable) set containing the pressed (but not yet released) buttons
-
release
void release(MouseButton... buttons)
Releases the given mouse buttons. Once pressed, callsWaitForAsyncUtils.waitForFxEvents().Note: passing in an empty
MouseButton[]will release all pressedMouseButtons.- Parameters:
buttons- the mouse buttons to release
-
releaseNoWait
void releaseNoWait(MouseButton... buttons)
Releases the given mouse buttons. Once pressed,WaitForAsyncUtils.waitForFxEvents()is not called.Note: passing in an empty
MouseButton[]will release all pressedMouseButtons.- Parameters:
buttons- the mouse buttons to release without waiting afterwards
-
move
void move(Point2D location)
Moves the mouse to the given location. Once moved, callsWaitForAsyncUtils.waitForFxEvents().- Parameters:
location- the location to move the mouse to
-
moveNoWait
void moveNoWait(Point2D location)
Moves the mouse to the given location. Once moved,WaitForAsyncUtils.waitForFxEvents()is not called.- Parameters:
location- the location to move the mouse to without waiting afterwards
-
scroll
void scroll(int wheelAmount)
Scrolls the mouse wheel by the given amount. Once scrolled, callsWaitForAsyncUtils.waitForFxEvents().- Parameters:
wheelAmount- the amount to scroll the mouse by
-
scrollNoWait
void scrollNoWait(int wheelAmount)
Scrolls the mouse wheel by the given amount. Once scrolled,WaitForAsyncUtils.waitForFxEvents()is not called.- Parameters:
wheelAmount- the amount to scroll the mouse by without waiting afterwards
-
-