I am attempting to use PyHook to disable keyboard and mouse while running the script, and I am having difficulties setting a timer function so that the keyboard and mouse will only be disabled for a predefined amount of time, e.g. 30 seconds, and then return to normal.
def windoow(event):
while True:
return False
time.sleep(30)
break
hm = pyHook.HookManager()
hm.MouseAll = windoow
hm.KeyAll = windoow
hm.HookMouse()
hm.HookKeyboard()
pythoncom.PumpMessages()
I am new to programming in general, and I am therefore hoping for an easy solution that I can learn from and understand.
Thank you.