[ACCEPTED]-pyautogui.press() causing lag when called-pyautogui
I'm the author of PyAutoGUI. PyAutoGUI has 15 a "fail-safe" feature to help in case your 14 script is buggy and you want to shut it 13 off, but it may be moving the mouse around 12 making it impossible to hit the keyboard. There 11 is a 0.1 second delay after all PyAutoGUI 10 calls, giving you a chance to slam the mouse 9 to the upper right corner (PyAutoGUI will 8 raise FailSafeException
if the mouse is ever at coordinates 7 (0, 0).)
The tenth second delay gives the 6 user a chance to move the mouse to the upper 5 left corner. However, you can also disable 4 this by setting pyautogui.PAUSE
to 0
:
>>> pyautogui.PAUSE = 0
However, this means 3 if something screws up and your script causes 2 the mouse to constantly click around, you 1 might have a harder time killing your script.
I think there is some glitch in functions 7 like click or typewrite. I discovered that 6 if you use them in cycle you can get empty 5 mouse clicks or misswrites, e.g. if you 4 want to write 1001, you can get only 101. At 3 the moment testing raw functions like mouseDown 2 and mouseUp and it seems they tend to work 1 better. Hope that helps someone.
set MINIMUM_SLEEP = 0.0 in init.py file in the 1 package. It will work super fast.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.