Interface IMouseAPI


public interface IMouseAPI
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Clicks the left mouse button.
    boolean
    click(boolean rightClick)
    Clicks the left or right mouse button.
    boolean
    click(int x, int y)
    Moves the mouse and clicks at the given x,y coordinates.
    boolean
    click(int x, int y, boolean rightClick)
    Moves the mouse and clicks at the given x,y coordinates.
    boolean
    click(Clickable clickable)
    Moves the mouse and clicks on the given clickable entity.
    boolean
    click(Clickable clickable, boolean rightClick)
    Moves the mouse and clicks on the given clickable entity.
    boolean
    click(Point location)
    Moves the mouse and clicks on the given location.
    boolean
    click(Point location, boolean rightClick)
    Moves the mouse and clicks on the given location.
    boolean
    click(Shape shape)
    Moves the mouse and clicks on a random point on the given shape.
    boolean
    click(Shape shape, boolean rightClick)
    Moves the mouse and clicks on a random point on the given shape.
    boolean
    doubleClick(Point randomPoint)
     
    boolean
    drag(Point end)
    Drags the mouse from the current mouse location to the given location.
    boolean
    drag(Point start, Point end)
    Drags the mouse to the start location if not already there and drags the mouse to the given end location.
    boolean
    drag(Point start, Point end, int button)
    Drags the mouse to the start location if not already there and drags the mouse to the given end location.
    Gets the last known mouse location before it went of screen.
    Gets the current mouse location.
     
    int
     
    int
     
    int
     
    int
    Returns the base mouse movement speed in milliseconds.
    int
    Gets the current x-coordinate of the mouse.
    int
    Gets the current y-coordinate of the mouse.
    boolean
    hold(int duration, boolean rightClick)
    Holds the left or right mouse button for a duration at the current mouse location.
    boolean
    hold(Point location, int duration, boolean rightClick)
    Holds the left or right mouse button for a duration at the given location.
    boolean
     
    boolean
     
    boolean
     
    boolean
    move(Clickable clickable)
    Moves the mouse onto the given clickable entity.
    boolean
    move(Point location)
    Moves the mouse to the given location.
    boolean
    Simulates moving the mouse off screen.
    boolean
    Moves the mouse randomly.
    boolean
    moveRandomly(int maxDistance)
    Moves the mouse randomly between the maximum distance.
    boolean
    moveRandomly(int minDistance, int maxDistance)
    Moves the mouse randomly between the two distances.
    boolean
    scroll(boolean up)
    Scrolls the mouse wheel.
    boolean
    scroll(boolean up, int times)
    Scrolls the mouse wheel.
    void
    setMoveSpeedTime(int speedMs)
    Set the base mouse movement speed in milliseconds.
    void
    setX(int x)
    Sets the x-coordinate of the mouse.
    void
    setY(int y)
    Sets the y-coordinate of the mouse.
  • Field Details

  • Method Details

    • isPressed

      boolean isPressed()
    • isRightPressed

      boolean isRightPressed()
    • isPresent

      boolean isPresent()
    • click

      boolean click()
      Clicks the left mouse button.
      Returns:
      true if successful, false otherwise
    • click

      boolean click(boolean rightClick)
      Clicks the left or right mouse button.
      Parameters:
      rightClick - true to use the right mouse button, false otherwise
      Returns:
      true if successful, false otherwise
    • click

      boolean click(int x, int y)
      Moves the mouse and clicks at the given x,y coordinates.
      Parameters:
      x - the x-coordinate to move to
      y - the y-coordinate to move to
      Returns:
      true if successful, false otherwise
    • click

      boolean click(int x, int y, boolean rightClick)
      Moves the mouse and clicks at the given x,y coordinates.
      Parameters:
      x - the x-coordinate to move to
      y - the y-coordinate to move to
      rightClick - true to use the right mouse button, false otherwise
      Returns:
      true if successful, false otherwise
    • click

      boolean click(Shape shape)
      Moves the mouse and clicks on a random point on the given shape.
      Parameters:
      shape - the shape to click on
      Returns:
      true if successful, false otherwise
    • click

      boolean click(Shape shape, boolean rightClick)
      Moves the mouse and clicks on a random point on the given shape.
      Parameters:
      shape - the shape to click on
      rightClick - true to use the right mouse button, false otherwise
      Returns:
      true if successful, false otherwise
    • click

      boolean click(Point location)
      Moves the mouse and clicks on the given location.
      Parameters:
      location - the location
      Returns:
      true if successful, false otherwise
    • click

      boolean click(Point location, boolean rightClick)
      Moves the mouse and clicks on the given location.
      Parameters:
      location - the location
      rightClick - true to use the right mouse button, false otherwise
      Returns:
      true if successful, false otherwise
    • click

      boolean click(Clickable clickable)
      Moves the mouse and clicks on the given clickable entity.
      Parameters:
      clickable - the location
      Returns:
      true if successful, false otherwise
    • click

      boolean click(Clickable clickable, boolean rightClick)
      Moves the mouse and clicks on the given clickable entity.
      Parameters:
      clickable - the clickable entity
      rightClick - true to use the right mouse button, false otherwise
      Returns:
      true if successful, false otherwise
    • doubleClick

      boolean doubleClick(Point randomPoint)
    • hold

      boolean hold(int duration, boolean rightClick)
      Holds the left or right mouse button for a duration at the current mouse location.
      Parameters:
      duration - the duration to hold for
      rightClick - true to use the right mouse button, false otherwise
      Returns:
      true if successful, false otherwise
    • hold

      boolean hold(Point location, int duration, boolean rightClick)
      Holds the left or right mouse button for a duration at the given location.
      Parameters:
      location - the location to hold the mouse button at
      duration - the duration to hold for
      rightClick - true to use the right mouse button, false otherwise
      Returns:
      true if successful, false otherwise
    • move

      boolean move(Point location)
      Moves the mouse to the given location.
      Parameters:
      location - the location
      Returns:
      true if successful, false otherwise
    • move

      boolean move(Clickable clickable)
      Moves the mouse onto the given clickable entity.
      Parameters:
      clickable - the entity to move the mouse to
      Returns:
      true if successful, false otherwise
    • moveOffScreen

      boolean moveOffScreen()
      Simulates moving the mouse off screen.
      Returns:
      true if successful, false otherwise
    • moveRandomly

      boolean moveRandomly()
      Moves the mouse randomly.
      Returns:
      true if successful, false otherwise
    • moveRandomly

      boolean moveRandomly(int maxDistance)
      Moves the mouse randomly between the maximum distance.
      Parameters:
      maxDistance - The maximum distance to move.
      Returns:
      true if successful, false otherwise
    • moveRandomly

      boolean moveRandomly(int minDistance, int maxDistance)
      Moves the mouse randomly between the two distances.
      Parameters:
      minDistance - The minimum distance to move.
      maxDistance - The maximum distance to move.
      Returns:
      true if successful, false otherwise
    • scroll

      boolean scroll(boolean up)
      Scrolls the mouse wheel.
      Parameters:
      up - true to scroll up, false to scroll down
      Returns:
      true if successful, false otherwise
    • scroll

      boolean scroll(boolean up, int times)
      Scrolls the mouse wheel.
      Parameters:
      up - true to scroll up, false to scroll down
      times - the number of times the scroll wheel should be rolled
      Returns:
      true if successful, false otherwise
    • drag

      boolean drag(Point end)
      Drags the mouse from the current mouse location to the given location.
      Parameters:
      end - the location to stop dragging at
      Returns:
      true if successful, false otherwise
    • drag

      boolean drag(Point start, Point end)
      Drags the mouse to the start location if not already there and drags the mouse to the given end location.
      Parameters:
      start - the location to start dragging at
      end - the location to stop dragging at
      Returns:
      true if successful, false otherwise
    • drag

      boolean drag(Point start, Point end, int button)
      Drags the mouse to the start location if not already there and drags the mouse to the given end location.
      Parameters:
      start - the location to start dragging at
      end - the location to stop dragging at
      button - the mouse button to hold during the operation, see MouseEvent, defaults to left-click button (MouseEvent.BUTTON1)
      Returns:
      true if successful, false otherwise
    • getX

      int getX()
      Gets the current x-coordinate of the mouse.
      Returns:
      the x-coordinate or -1 if the mouse is not present
    • getY

      int getY()
      Gets the current y-coordinate of the mouse.
      Returns:
      the y-coordinate or -1 if the mouse is not present
    • setX

      void setX(int x)
      Sets the x-coordinate of the mouse.
    • setY

      void setY(int y)
      Sets the y-coordinate of the mouse.
    • getLocation

      Point getLocation()
      Gets the current mouse location.
      Returns:
      Point
      See Also:
    • getLastLocation

      Point getLastLocation()
      Gets the last known mouse location before it went of screen.
      Returns:
      Point
    • getMoveSpeedTime

      int getMoveSpeedTime()
      Returns the base mouse movement speed in milliseconds.
      Returns:
      milliseconds
    • setMoveSpeedTime

      void setMoveSpeedTime(int speedMs)
      Set the base mouse movement speed in milliseconds.
      Parameters:
      speedMs - base move time in milliseconds
    • getMouseCrossX

      int getMouseCrossX()
    • getMouseCrossY

      int getMouseCrossY()
    • getMouseCrossColor

      IMouseAPI.CrossColor getMouseCrossColor()
    • getMouseCrossState

      int getMouseCrossState()