I'm coding a little tool that displays the key presses on the screen with Tkinter, useful for screen recording.
Is there a way to get a listener for all key presses of the system globally with Tkinter? (for every keystroke including F1, CTRL, ..., even when the Tkinter window does not have the focus)
I currently know a solution with pyHook.HookManager()
, pythoncom.PumpMessages()
, and also solutions from Listen for a shortcut (like WIN+A) even if the Python script does not have the focus but is there a 100% tkinter
solution?
Indeed, pyhook
is only for Python 2, and pyhook3
seems to be abandoned, so I would prefer a built-in Python3 / Tkinter solution for Windows.