SL5net
SL5net

Reputation: 2556

move mouse relatively in Linux

I want to move my mouse relatively to the right. I already installed

My prototype (below) can do absolutely move. Is that possible with autopilot.input or do I have to try something different?

from autopilot.input import Mouse
mouse = Mouse.create()
mouse.move(3600, 80, animate=True, rate=1000, time_between_events=0.01)

I read: https://phone.docs.ubuntu.com/en/apps/api-autopilot-development/autopilot.input.Mouse

Upvotes: 1

Views: 1961

Answers (1)

SL5net
SL5net

Reputation: 2556

it moves the mouse relatively using autopilot.input.

to install:

sudo apt-get install python3-autopilot

from autopilot.input import Mouse
mouse = Mouse.create()
x, y = mouse.position()
mouse.move(x + 100, y + 100)

Upvotes: 1

Related Questions