Python Forum
take over control of mouse/keyboard
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
take over control of mouse/keyboard
#1
My script periodically needs to control mouse/keyboard to do things for a few seconds then give the control back to user. This script just disable them, not what I want. Please advise. Thanks.


import pythoncom, pyHook 

def uMad(event):
    return False

hm = pyHook.HookManager()
hm.MouseAll = uMad
hm.KeyAll = uMad
hm.HookMouse()
hm.HookKeyboard()
pythoncom.PumpMessages()
Reply
#2
Not sure this is what you're looking for, but think so

for keyboard see: https://pypi.org/project/keyboard/
for mouse see: https://pypi.org/project/mouse/
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Control Mouse and Keyboard Across the Country Without VNC on Target PC Khuber79 5 2,928 Feb-21-2021, 02:42 AM
Last Post: NullAdmin
  mouse 0.7.0 - mouse polling hate 125-1000hz penahuse 1 2,465 Dec-06-2019, 09:51 PM
Last Post: Larz60+
  Python 3+ kybd and mouse control keycodes ineuw 5 2,838 Aug-20-2019, 07:51 AM
Last Post: ineuw

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020