Closed jimburnsphd closed 3 years ago
Thank you for your report.
pynput does not inhibit the key events from reaching other parts of your system, so having a key listener active does not affect the keys sent to stdout
upon application termination.
If you want to prevent the keys from being printed, and possibly be interpreted by your shell, you may want to drain stdout
before exiting.
Simplest key listener still dumps all keys pressed to stdout after exit.
from pynput import keyboard, mouse STOP_KEY = keyboard.Key.esc def evt_kybrd_OnPress(key):
print(key)
with keyboard.Listener(on_press=evt_kybrd_OnPress) as kL: kL.join() print('Done')