0
import pyHook
import pythoncom
def tecla_pressionada(evento):
# print("Alguma tecla pressionada")
print (chr(evento.Ascii))
hook = pyHook.HookManager()
hook.KeyDown = tecla_pressionada #sem ()
hook.HookKeyboard()
pythoncom.PumpMessages() #cria loop infinito e espera mensagens do SO
The above code works with the library pyHook
for Windows.
How to make a similar code in Python for Linux?
how to install pyxhook?
– Ed S
@Eds Updated the answer, see.
– stderr
Thank you, @zekk.
– Ed S