Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Why is pyautogui mousemovement not recognised by Win10? #748

Open
Tech4Ever opened this issue Dec 16, 2022 · 2 comments
Open

Comments

@Tech4Ever
Copy link

Hi,

I used AutoHotKey and the function mousemove() for a while. With hthis code, my windows did not lock and MS Teams e.g. showed me as active:

Loop{ MouseMove, 10, 5, ,R sleep 300000 }

I tried to reproduce this with pyautogui and this code:

`import pyautogui as py
import time

while True:
py.moveRel(5,10)
time.sleep(300)`

I see the mouse moving, but MS Teams shows me as inactive after 5 minutes and after 10 minuters my monitor turns off.

So what´s wrong here?

@MiniMitre
Copy link

MiniMitre commented Dec 17, 2022

Hey! so what might be happening is that your mouse is hitting the bottom right corner of the screen (which is a failsafe in PyAutoGui to stop the code if the mouse moves to a corner of the screen).

Possible fix would be to add a py.moveRel(-5,-10) inside the while loop.

Also, the exact Windows sleep settings of your machine will change the outcome, so double check those as well.

@Tech4Ever
Copy link
Author

Hi,

I can confirm that PYAutoGui failsafe is not the reason why it is not working! As you can see the mouse is moving every 5 minutes only 10 and 5 pixels and it did defintely not hit any corner of the screen in that time. And after 5 minutes monitor turns off. As I mentioned, with Autohotkey I have no problems. I really want to understand why it´s not workig in PyAutoGui because I can see the mouse is moving, but it seems to be not recogised by windows!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants