-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
force current position on move_mouse() to solve windows bug #22
base: master
Are you sure you want to change the base?
force current position on move_mouse() to solve windows bug #22
Conversation
Hi @carrot69 Thanks for looking into this. Just ran the code in this new branch but got the same error:
Jonas |
Hey @m-jonas! Sorry, I made a mistake with the variable name. I guess I'll need to refactor since I have two variables that are called the same but one with an underscore and the other with snake case. Can you verify now? Thanks! |
Hey @carrot69 I'm afraid the error still the same. Jonas |
I have done some troubleshooting, where I have added a few print statements: This is the outcome: Observe that the More observations: I have tested and I believe it is pressing CTRL+ALT+DEL that kills the script somehow, and not the Windows lock action. I have tested it by pressing CTRL+ALT+DEL and then pressing ESC to go back, instead of selecting 'Lock'. I can then see the script has already failed. |
Based on what you say and on this link: moses-palmer/pynput#81 My best guess is that pynput returns the mouse position as None because the screen is locked. I'm going to install Windows on a virtual machine so I can check this out and look for an elegant solution, but in the meanwhile you can try something like:
Does this work? |
Yeah :D I'm glad it worked! I'm going to do a little refactoring and improve this pull request so I can push the fix to master. Thanks for reporting this and helping debug it :) |
No problem, glad to help! |
No description provided.