Class RSBSystemCalls

java.lang.Object
rsb.internal.naturalmouse.RSBSystemCalls
All Implemented Interfaces:
com.github.joonasvali.naturalmouse.api.SystemCalls

public class RSBSystemCalls extends Object implements com.github.joonasvali.naturalmouse.api.SystemCalls
  • Constructor Details

    • RSBSystemCalls

      public RSBSystemCalls(InputManager inputManager)
  • Method Details

    • currentTimeMillis

      public long currentTimeMillis()
      Specified by:
      currentTimeMillis in interface com.github.joonasvali.naturalmouse.api.SystemCalls
    • sleep

      public void sleep(long time) throws InterruptedException
      Specified by:
      sleep in interface com.github.joonasvali.naturalmouse.api.SystemCalls
      Throws:
      InterruptedException
    • getScreenSize

      public Dimension getScreenSize()
      Specified by:
      getScreenSize in interface com.github.joonasvali.naturalmouse.api.SystemCalls
    • setMousePosition

      public void setMousePosition(int x, int y)

      Moves the mouse to specified pixel using the provided Robot.

      It seems there is a certain delay, measurable in less than milliseconds, before the mouse actually ends up on the requested pixel when using a Robot class. this usually isn't a problem, but when we ask the mouse position right after this call, there's extremely low but real chance we get wrong information back. I didn't add sleep here as it would cause overhead to sleep always, even when we don't instantly use the mouse position, but just acknowledged the issue with this warning. (Use fast unrestricted loop of Robot movement and checking the position after every move to invoke the issue.)

      Specified by:
      setMousePosition in interface com.github.joonasvali.naturalmouse.api.SystemCalls
      Parameters:
      x - the x-coordinate
      y - the y-coordinate