Interface MouseDriver


  • public interface MouseDriver
    Driver interface for direct cursor control, clicking, and wheel scrolling. Calls on the client or UI thread return acceptance immediately; background callers may wait for completion. Use compound click methods for an atomic move and click.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean click()  
      boolean click​(boolean rightClick)  
      boolean click​(java.awt.Rectangle rectangle)  
      boolean click​(Destination destination)  
      boolean click​(net.runelite.api.Point point)  
      boolean click​(net.runelite.api.Point point, boolean rightClick)  
      boolean drag​(int endX, int endY, int button)  
      boolean drag​(net.runelite.api.Point to, int button)  
      net.runelite.api.Point getPosition()  
      void hop​(net.runelite.api.Point point)  
      boolean isDragging()  
      boolean move​(java.awt.Rectangle rectangle)  
      boolean move​(Destination destination)  
      boolean move​(net.runelite.api.Point point)  
      default boolean rotateCamera​(int yaw, int pitch, java.util.function.BooleanSupplier interrupt)  
      boolean scroll​(boolean up, int timeoutMs, java.util.function.BooleanSupplier condition)  
      void scroll​(int notches)  
      default boolean setCameraZoom​(int zoom)  
      default boolean submitHoldingKey​(int keyCode, MenuRequest request)
      Deliver request with the cursor while holding a modifier key, such as Ctrl for a run toggle on a walk click.
      default boolean typeAndChoose​(java.lang.String text, java.util.function.Supplier<MenuRequest> choice, long timeoutMs, java.util.function.BooleanSupplier context)
      Type text into the open chatbox prompt, wait up to timeoutMs for choice to name the interaction that picks the result, then deliver it with the cursor.
      default boolean typeText​(java.lang.String text, boolean enter, java.util.function.BooleanSupplier context)
      Canvas-local key input; context is checked on the client thread before each key.
      default boolean zoomCamera​(int notches)  
    • Method Detail

      • move

        boolean move​(net.runelite.api.Point point)
      • move

        boolean move​(java.awt.Rectangle rectangle)
      • click

        boolean click()
      • click

        boolean click​(boolean rightClick)
      • click

        boolean click​(net.runelite.api.Point point)
      • click

        boolean click​(net.runelite.api.Point point,
                      boolean rightClick)
      • click

        boolean click​(java.awt.Rectangle rectangle)
      • scroll

        boolean scroll​(boolean up,
                       int timeoutMs,
                       java.util.function.BooleanSupplier condition)
      • scroll

        void scroll​(int notches)
      • getPosition

        net.runelite.api.Point getPosition()
      • isDragging

        boolean isDragging()
      • drag

        boolean drag​(net.runelite.api.Point to,
                     int button)
      • drag

        boolean drag​(int endX,
                     int endY,
                     int button)
      • hop

        void hop​(net.runelite.api.Point point)
      • typeText

        default boolean typeText​(java.lang.String text,
                                 boolean enter,
                                 java.util.function.BooleanSupplier context)
        Canvas-local key input; context is checked on the client thread before each key.
      • typeAndChoose

        default boolean typeAndChoose​(java.lang.String text,
                                      java.util.function.Supplier<MenuRequest> choice,
                                      long timeoutMs,
                                      java.util.function.BooleanSupplier context)
        Type text into the open chatbox prompt, wait up to timeoutMs for choice to name the interaction that picks the result, then deliver it with the cursor. Runs as one cursor action, so nothing can interleave between typing and choosing. context must stay true throughout or the action stops.
      • submitHoldingKey

        default boolean submitHoldingKey​(int keyCode,
                                         MenuRequest request)
        Deliver request with the cursor while holding a modifier key, such as Ctrl for a run toggle on a walk click. The key is released however the action ends.
      • rotateCamera

        default boolean rotateCamera​(int yaw,
                                     int pitch,
                                     java.util.function.BooleanSupplier interrupt)
      • setCameraZoom

        default boolean setCameraZoom​(int zoom)
      • zoomCamera

        default boolean zoomCamera​(int notches)