Michael Hoffman wrote:
> I think this is going to be much harder than you think, and I imagine
> this will only end in frustration for you. You will not be able to do it
> well with just Python. I would recommend a different fun project.


Actually, it's pretty easy, using the pyHook and Python win32 modules.
I use code like this to detect when the user is away from the keyboard.

import pyHook
import time
import pythoncom

def OnKeyboardEvent(event):
    print event.Ascii

hm = pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
hm.HookKeyboard()

while True:
    pythoncom.PumpMessages()


Sw.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to