0

I'm trying to detect whether or not the left moues button is down or up with pyHook. What I currently have is:

def OnDown():
     toggle = True
def OnUp()
     toggle = False

hm = pyHook.HookManager()
hm.HookMouse()
hm.MouseLeftDown = OnDown
hm.MouseLeftUp = OnUp
PumpMessages()
hm.UnhookMouse()

From what I can tell, it registered when my mouse is down but not when I release the button. Any idea as to how I can make it work?

1 Answers1

1

Silly me, I just have to return True.

def OnDown(event):
     toggle = "True"
     return True


def OnUp(event):
    toggle = "False"
    return True