Is there a way of disabling or locking mouse and keyboard using python? I want to freeze the mouse and disable the keyboard.
See Question&Answers more detail:osIs there a way of disabling or locking mouse and keyboard using python? I want to freeze the mouse and disable the keyboard.
See Question&Answers more detail:osI haven't tested (actually I've tested the mouse part, and it annoyingly works) but something like this using pyhook would do what you want:
import pythoncom, pyHook
def uMad(event):
return False
hm = pyHook.HookManager()
hm.MouseAll = uMad
hm.KeyAll = uMad
hm.HookMouse()
hm.HookKeyboard()
pythoncom.PumpMessages()