0

I want to be able to return False in a function and then start up another function. This is because I made a testing tool that records but needs to record the coordinates and not let the mouseclick through.

What I have now in combination with a pyhook mousehook is this:

def OnMouseEvent(event):
    if temp == 0:
          temp = 1
          originalcoordinates = x/y mouse
          return False
    if temp == 1:
         do a lot of things that take up a lot of time
         click on original coordinates
         temp = 0
         return False

At the moment the first return False works and doesn't let the mouseclick through but the second has to many arguments and time befor the return and the mouseclick handle is already passed on to windows and clicks.

georg
  • 211,518
  • 52
  • 313
  • 390
Wealot
  • 201
  • 2
  • 9
  • When you downvote please do leave a comment on why – Wealot Mar 10 '15 at 13:31
  • I tried to give a better title, hope I understood you right. – georg Mar 10 '15 at 13:36
  • So, the first time you click it should save the coordinates, and the second time do something longer with those coordinates? – francisco sollima Mar 10 '15 at 13:36
  • Yes indeed so all the code with the coordinates etc. that works (and takes up a page so I didn't want to post it). But the problem is that when there is a lot of code the mouseclick is forwarded to windows before the return false that would stop that. In other words I click while I do not want that.... – Wealot Mar 10 '15 at 13:42

0 Answers0