Keystroke logger for Windows

Elaine Jackson elainejackson7355 at home.com
Fri Aug 22 21:51:04 EDT 2003


I found this on the web someplace. It may be relevant.

# /usr/local/bin/Python
# Displays the keysym for each KeyPress event as you type
import Tkinter
root = Tkinter.Tk()

root.title("Keysym Logger")

def reportEvent(event):
    print 'keysym=%s, keysym_num=%s' % (event.keysym, event.keysym_num)

text  = Tkinter.Text(root, width=20, height=5, highlightthickness=2)

text.bind('<KeyPress>', reportEvent)

text.pack(expand=1, fill="both")
text.focus_set()

root.mainloop()


"hokieghal99" <hokiegal99 at hotmail.com> wrote in message
news:bi66lq$skj$1 at solaris.cc.vt.edu...
| Does anyone know of a keystroke logger that has been written in Python
| for Windows machines? I'd like to see such a script and use it as a
| point of reference for a real-time backup project that I'm working on.
| Basically, I'd like to be able to capture all keystrokes from the
| keyboard buffer and write them to a text file so I could reporduce
| emails, documents, etc. in the event of file loss that occurs between
| nightly backups. For example, my boss comes to me, he has deleted an
| email that he was writing... he has been working on the email all day...
| and he expects me to wave a magic wand and bring it back.
|
| Thanks for any advice, code or pointers. Also, if Python isn't suited
| for this, let me know and I'll look at doing this in c
|






More information about the Python-list mailing list