Closed RugnirViking closed 3 months ago
valid. found any solutions?
Thank you for your report.
Please see the documentation regarding blocking listener callbacks.
Notably, on Windows, this will incur delays throughout the operating system. flush_input
in your example does block. I would suggest to dispatch flushing to another thread.
I will close this issue, as the is an issue of the platform and a known limitation.
Description I was making a terminal app with this library which was working fine. I have a listener running in non-blocking mode, but when I ask the terminal for input, like to have the user enter a number, some kind of process fighting behind the scenes starts happening, as ALL keyboard input, even when the console is minimised starts to have very long delay,
I could of course handle the number entry myself with keys but I don't want to go through the hassle
Platform and pynput version pynput 1.7.6 windows 10 build 19042.1466
To Reproduce Run following file, press b, and observe all keyboard input in all processes are hanging. On a second note, I was not able to stop the listener for the input either, running the "pynput.keyboard.Listener.stop" command that the docs claim works from anywhere in fact results in an error ( TypeError: stop() missing 1 required positional argument: 'self' )