Class Mouse


  • public final class Mouse
    extends java.lang.Object
    • Method Detail

      • click

        public static boolean click​(Mouse.Button button)
        Presses a button and waits a calculated time before release.
      • click

        public static boolean click​(Mouse.Button button,
                                    int delay)
        Presses a button, and waits a specific amount of time before release
      • click

        public static boolean click​(Interactable target,
                                    Mouse.Button button)
        Moves the mouse over the target and presses the specified button
        Returns:
        true if the target acknowledges the click
      • getPosition

        public static java.awt.Point getPosition()
        The current position of the virtual mouse
      • getSpeedMultiplier

        public static double getSpeedMultiplier()
      • setSpeedMultiplier

        public static void setSpeedMultiplier​(double multiplier)
      • getTarget

        public static Interactable getTarget()
        The target that the mouse is moving towards
      • getPreviousTarget

        public static Interactable getPreviousTarget()
      • isInputAllowed

        public static boolean isInputAllowed()
      • isMenuInteractionForced

        public static boolean isMenuInteractionForced()
      • isMoving

        public static boolean isMoving()
      • isPressed

        public static boolean isPressed​(Mouse.Button button)
        Gets whether the specified mouse button is pressed
      • isPressed

        public static boolean isPressed()
        Gets whether or mouse button is pressed
      • move

        public static boolean move​(Interactable target)
        Moves the mouse over the interactable target
        Returns:
        true if hovering the target
      • press

        public static boolean press​(Mouse.Button button)
      • release

        public static boolean release​(Mouse.Button button)
      • scroll

        public static void scroll​(boolean down)
        Scrolls the mouse
        Parameters:
        down - true to scroll the mouse down, otherwise up
      • scroll

        public static void scroll​(boolean down,
                                  int delay)
        Rotates the mouse wheel and then delays for the specified amount of time
      • setForceMenuInteraction

        public static void setForceMenuInteraction​(boolean value)
      • toggleInput

        @Deprecated
        public static void toggleInput()
        Deprecated.
        DEPRECATED - toggling mouse and keyboard input is now exclusively controlled by the user, who can set a default value via user settings.
      • wasClickSuccessful

        @Deprecated
        public static boolean wasClickSuccessful​(Interactable target)
        Deprecated.
      • getOverlayCrosshairColorFor

        public static Mouse.CrosshairState getOverlayCrosshairColorFor​(Interactable target)
        Checks if a recent click was likely successful based on target type and the current crosshair state. This is used internally by the interaction engine and shouldn't be used elsewhere.