0

i was working on a project on python and it involves keyboard hooking with pyhook.I'm trying to get keyboard inputs.But unfortunately the inputs recieved is wrong somtimes.The following are the test code and the output i got from them.The problem occurs randomly but almost frequently.

Test Code

import pyHook, pythoncom


def OnKeyboardEvent(event):

    print(chr(event.Ascii))

    return True

hooks_manager = pyHook.HookManager ( )
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard ( )
pythoncom.PumpMessages ()

Output :

enter image description here

and yeah that was abcd... i pressed. Any explanation and remedy for this problem is appreciated.

Sreyas
  • 461
  • 3
  • 15

0 Answers0