0

I have some problems in returning the number of keys typed on the keyboard.

I finished the part when he can detect every key typed but I need the number of total keys typed.

This is my code written in python:

import pyHook
import pythoncom

def OnKeyboardEvent(event):
    print ('Key:', event.Key)
    print ('---')

    return True

def events():
    hm = pyHook.HookManager()
    hm.KeyDown = OnKeyboardEvent
    hm.HookKeyboard()
    pythoncom.PumpMessages()
    hm.UnHookKeyboard()

events()
Andrew F
  • 2,690
  • 1
  • 14
  • 25
Firas
  • 1
  • 3
  • Do you mean "typed" or perhaps "recorded"? – tripleee Feb 12 '19 at 13:56
  • typed when you type anything I need to return the number of keys that you clicked – Firas Feb 12 '19 at 13:58
  • 2
    Updating a global from within the hook would seem completely trivial compared to the code you already have written. If you didn't write this yourself, perhaps try a quick Python tutorial before asking for help? – tripleee Feb 12 '19 at 14:01

0 Answers0