python - Recording keystrokes with pyHook -
i've been trying work time (to keyid print in text, a="a", not a=125.)
here code, either prints "none" , prints wrong type, or keyid again. (with different idtoname arguments)
import pyhook pyhook import hookmanager pyhook.hookmanager import hookconstants import time import pythoncom def onkeyboardevent(event): print hookconstants.idtoname(event.ascii) hm = pyhook.hookmanager() hm.keydown = onkeyboardevent hm.hookkeyboard() while true: pythoncom.pumpmessages()
why not use event.key
? xx
Comments
Post a Comment