Module org.testfx

Interface MouseRobot

  • All Known Implementing Classes:
    MouseRobotImpl

    public interface MouseRobot
    • Method Detail

      • pressNoWait

        void pressNoWait​(MouseButton... buttons)
        Presses the given mouse buttons, until explicitly released via release(MouseButton...). Once pressed, WaitForAsyncUtils.waitForFxEvents() is not called.

        Note: passing in an empty MouseButton[] will call press(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, calls WaitForAsyncUtils.waitForFxEvents().

        Note: passing in an empty MouseButton[] will release all pressed MouseButtons.

        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 pressed MouseButtons.

        Parameters:
        buttons - the mouse buttons to release without waiting afterwards
      • 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, calls WaitForAsyncUtils.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