Closed dade68 closed 2 years ago
i found that the listener function can't listen mouse when mouse move in some windows, such as task manager in windows system
Thank you for your report.
This is caused by the Windows access control and isa security feature of the operating system. The limitation cannot be worked around in this library, so I will close this issue as there is unfortunately nothing to do.
Description when move mouse in windos task mannger, listener can't capture mouse positon and movement
Platform and pynput version Windows10
To Reproduce from pynput import keyboard from pynput import mouse from datetime import datetime
def on_press(key): try: print(f'{key.char} down') except AttributeError: print(f'{key} down')
def on_release(key): print(f'{key} up')
def on_move(x, y): print('move to ', x, y)
def on_click(x, y, button, pressed): if pressed == False: print('click at ', x, y, button, pressed) print(datetime.now().isoformat(timespec='microseconds'))
def on_scroll(x, y, dx, dy): print('scroll at ', x, y, 'by', dx, dy)
def listen_mouse(): listener = mouse.Listener( on_move=None, on_click=on_click, on_scroll=on_scroll ) listener.start()
if name == 'main': listen_mouse() while True: pass