moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.73k stars 243 forks source link

pynput.mouse.Controller().position sometimes returns None on Windows #559

Open yurivict opened 1 year ago

yurivict commented 1 year ago

Description This code:

from pynput.mouse import Controller as MouseController
currentPosition = MouseController().position
print(f"currentPosition={currentPosition}")

Sometimes returns None as currentPosition.

Platform and pynput version Windows Version: 1.7.6

This is a likely cause of the failure of keep-presence, see this report: https://github.com/carrot69/keep-presence/issues/17