Is there any way that I can still make the program open videos after locking the mouse?

45 Views Asked by At

I have made a small program (copied the code which locks the mouse from the internet) with which I can open videos and I was wondering if there is a way which still opens videos but also locks the mouse. I have tried a lot of things yet I have found no solution.

This is the code:

o = 0

while o != 1:
    time.sleep(10)
    webopen = random.choice(really_funny_vids)
    webbrowser.open(webopen)
    o = o + 1

    def uMad(event):
        return False

    hm = pyWinhook.HookManager()
    hm.MouseAll = uMad
    hm.HookMouse()
    pythoncom.PumpMessages()

    time.sleep(10)


while True:
    webopen = random.choice(funny_vids)
    webbrowser.open(webopen)
    time.sleep(10)

Note: The time is set to 10 because I was testing the program. Normally it would be 600 (first time.sleep), 140 (second time.sleep) and 40 (third time.sleep) but I don't think that should change anything.

0

There are 0 best solutions below