Ashish Agarwal
Ashish Agarwal

Reputation: 11

how to move the cursor to a specific coordinates in pywinauto?

I need to automate the cursor to go to a specific coordinates. pywinauto.mouse.move(coords=(100,100)) isn't working. giving error as

mouse is not a part of a module.

from pywinauto import application,findwindows,mouse 
import pywinauto 
import win32api 

pywinauto.mouse.move(coords=(100,100)) 
#on the above line it gives error.

Should I import something else too for mouse?

Upvotes: 1

Views: 8113

Answers (1)

Vasily Ryabov
Vasily Ryabov

Reputation: 10000

Since you imported module mouse explicitly, just use

from pywinauto import mouse
mouse.move(coords=(100, 100))

import pywinauto doesn’t import mouse by default. We’re planning to fix it later.

Upvotes: 5

Related Questions