-
- All Known Implementing Classes:
MouseRobotImpl
public interface MouseRobot
-
-
Method Summary
Modifier and Type Method Description Set<javafx.scene.input.MouseButton>
getPressedButtons()
Gets the mouse buttons that have been pressed but not yet released.void
move(javafx.geometry.Point2D location)
Moves the mouse to the given location.void
moveNoWait(javafx.geometry.Point2D location)
Moves the mouse to the given location.void
press(javafx.scene.input.MouseButton... buttons)
Presses the given mouse buttons, until explicitly released viarelease(MouseButton...)
.void
pressNoWait(javafx.scene.input.MouseButton... buttons)
Presses the given mouse buttons, until explicitly released viarelease(MouseButton...)
.void
release(javafx.scene.input.MouseButton... buttons)
Releases the given mouse buttons.void
releaseNoWait(javafx.scene.input.MouseButton... buttons)
Releases the given mouse buttons.void
scroll(int wheelAmount)
Scrolls the mouse wheel by the given amount.void
scrollNoWait(int wheelAmount)
Scrolls the mouse wheel by the given amount.
-
-
-
Method Detail
-
press
void press(javafx.scene.input.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(javafx.scene.input.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<javafx.scene.input.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(javafx.scene.input.MouseButton... buttons)
Releases the given mouse buttons. Once pressed, callsWaitForAsyncUtils.waitForFxEvents()
.Note: passing in an empty
MouseButton[]
will release all pressedMouseButton
s.- Parameters:
buttons
- the mouse buttons to release
-
releaseNoWait
void releaseNoWait(javafx.scene.input.MouseButton... buttons)
Releases the given mouse buttons. Once pressed,WaitForAsyncUtils.waitForFxEvents()
is not called.Note: passing in an empty
MouseButton[]
will release all pressedMouseButton
s.- Parameters:
buttons
- the mouse buttons to release without waiting afterwards
-
move
void move(javafx.geometry.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(javafx.geometry.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
-
-