Search code examples
hidmicropythonraspberry-pi-picoadafruit-circuitpython

Is there a way to move a mouse to exact coordinates using CircuitPython?


I am using a Raspberry Pi Pico to move my mouse to an absolute position on a button press. However, I have noticed mouse.move moves your current mouse position by x and y units, but I want to change my mouse position to be exact and not based on the current position. Is there a way to dot his


Solution

  • you could create a simple function with very big x,y coordinates with negative signs as to reset the cursor to its initial position and then give your desired coordinate values to mimic the absolute position, as shown below:

    xx,yy= map(int,input().split())
    mouse.move(x=-10000,y=-10000) 
    mouse.move(xx,yy)