Wags
Wags

Reputation: 79

Sikulix : move the mouse to the right

I need to move the mouse after a selection of a picture.

The mouse go to the picture but after the mouse need to go to the right and the position of the picture is not always at the same place.

How can i move the mouse 50px to the right please.

Thanks

Upvotes: 0

Views: 4150

Answers (2)

Jeremy Thompson
Jeremy Thompson

Reputation: 65564

You can do it like this:

# Get current mouse position
mousePos = Env.getMouseLocation()
x = mousePos.getX()
y = mousePos.getY()

# Move the mouse cursor to the desired location....
new_x = x - 450
new_y = y - 500
mouseMove(Location(new_x, new_y))

However if you try a click after this move the mouse will move back to the original location before clicking! So if you want to click a position then specify the click operation with coordinates:

rightClick(Location(new_x, new_y))

Upvotes: 1

Wags
Wags

Reputation: 79

I have find

x=50 y=0 mouseMove(x,y)

From the official documentation: https://sikulix-2014.readthedocs.io/en/latest/region.html#lowlevelmouseandkeyboardactions """ mouseMove(xoff, yoff) Move the mouse pointer from it’s current position to the position given by the offset values (<0 left, up >0 right, down) """

Upvotes: 2

Related Questions