asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
9.93k stars 1.21k forks source link

pyautogui.moveTo() #854

Open DevYuriOliveira73 opened 2 months ago

DevYuriOliveira73 commented 2 months ago

[EN] I'm having trouble with mouse-related functions. Even passing the parameters related to mouse movement time, the mouse on my screen does not move. Are there any settings I can change to resolve this?

[BR] Estou tendo problema com as funções relacionadas ao mouse. mesmo passando o parâmetros relacionado ao tempo de movimento do mouse, o mouse na minha tela não se movimenta. Há alguma configuração que eu possa alterar para solucionar isso?

darkb0ts commented 2 months ago

Please mention OS name and version and paste error.

Here is a short Python 3 program that will constantly print out the position of the mouse cursor:

#! python3
import pyautogui, sys
print('Press Ctrl-C to quit.')
try:
    while True:
        x, y = pyautogui.position()
        positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
        print(positionStr, end='')
        print('\b' * len(positionStr), end='', flush=True)
except KeyboardInterrupt:
    print('\n')