Error in pyHook KeyboardSwitch ()


I'm experimenting with a keylogger:

import pyHook, pythoncom

def eventoTeclado(event):
        data_key = 'WindowName:'+str(event.WindowName)+ '; Ascii:'+ str(event.Ascii)+" "+ chr(event.Ascii)+ '; Key:'+ str(event.Key)+ '; KeyID:'+ str(event.KeyID)
        print ('WindowName:',event.WindowName)
        print ('Ascii:', event.Ascii, chr(event.Ascii))
        print ('Key:', event.Key)
        print ('KeyID:', event.KeyID)
        print ('ScanCode:', event.ScanCode)
        return True
controlador = pyHook.HookManager()
controlador.KeyDown = eventoTeclado

the code works well in some windows, but for example in the notebook or google returns me:

TypeError: KeyboardSwitch() missing 8 required positional arguments: 'msg', 'vk_code', 'scan_code', 'ascii', 'flags', 'time', 'hwnd', and 'win_name'

how could I solve this error?

asked by Aimspot 13.10.2018 в 04:55

0 answers