PyUserInput icon indicating copy to clipboard operation
PyUserInput copied to clipboard

Second instance of PyMouseEvent crashes

Open cottyard opened this issue 10 years ago • 2 comments

Hi, all. I'm new to Python so maybe this is not an actual problem?

Here is the code:

class ClickEventListener(PyMouseEvent):
   def click(self, x, y, button, press):
      if press:
         my_callback()

m = ClickEventListener()
m.start()
m.stop()

n = ClickEventListener()
n.start()
n.stop()

The first instance m works all right but the second instance n doesn't work. And when I stop thread n, an exception is raised:

Exception AttributeError: "'HookManager' object has no attribute 'keyboard_hook'"
 in <bound method HookManager.__del__ of <pyHook.HookManager.HookManager object at 0x027B5830>>
 ignored

Does anyone know why? Thanks!

cottyard avatar Aug 29 '13 02:08 cottyard

Which os are you on? Sent from my BlackBerry 10 smartphone. From: cottyardSent: donderdag 29 augustus 2013 04:34To: SavinaRoja/PyUserInputReply To: SavinaRoja/PyUserInputSubject: [PyUserInput] Second instance of PyMouseEvent crashes (#12)Hi, all. I'm new to Python so maybe this is not an actual problem?

Here is the code:

class ClickEventListener(PyMouseEvent): def click(self, x, y, button, press): if press: my_callback()

m = ClickEventListener() m.start() m.stop()

n = ClickEventListener() n.start() n.stop()

The first instance m works all right but the second instance n doesn't work. And when I stop thread n, an exception is raised:

Exception AttributeError: "'HookManager' object has no attribute 'keyboard_hook'" in > ignored

Does anyone know why? Thanks!

—Reply to this email directly or view it on GitHub.

pepijndevos avatar Aug 29 '13 05:08 pepijndevos

I was on windows 7 enterprise

cottyard avatar Aug 29 '13 12:08 cottyard