PyUserInput icon indicating copy to clipboard operation
PyUserInput copied to clipboard

Runtime Error

Open ipsBruno opened this issue 7 years ago • 1 comments

Hello ...

I have this code

class mouseevent(PyMouseEvent):
        def __init__(self):
            PyMouseEvent.__init__(self)
        
        def move(self, x, y):
            global lastKey 
            lastKey = time.time()





class keyevent(PyKeyboardEvent):
        def __init__(self):                      
            super(keyevent, self).__init__()
        def tap(self, keycode, character, press):
            global lastKey 
            lastKey = time.time()


keyHandlerThread = keyevent()
mouseHandlerThread = mouseevent()
keyHandlerThread.start()
mouseHandlerThread.run()

Works fine!

But on close application i get: Runtime Error: R6031

Apparently the threads are not killed. Someone with this problem?

Thanks in advance

ipsBruno avatar Feb 20 '18 15:02 ipsBruno

You should start and stop event threads with run() and stop() methods, or call thread.join() after start() method.

mondeja avatar Jul 20 '18 14:07 mondeja