PyUserInput
PyUserInput copied to clipboard
Second instance of PyMouseEvent crashes
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!
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.
I was on windows 7 enterprise