Open u2ros opened 4 years ago
Or should i say... get_gamepad() blocks...
I too am having the same issue. I am starting two threads to monitor keyboard and mouse events. I am unable to .join() the threads after setting a shutdown flag as they are blocking on the read(). I have yet to find a flag or interrupt that can shutdown inputs cleanly.
def keyboard_handler(self): while self.run_keyboard_handler: events = self.keyboard.read() for event in events: self.process_event(event)
Hi, i am running inputs in a python threading.Thread custom class. Therun methond looks like this:
Usually i shutdown a thread by using a running flag in the while loop, or, when using a threading.queue i send a None task which then breaks the loop on shutdown.
None of these methods is applicable here, since the run method only fires when events are rad from get_gamepad(). Any idea how to kill this thrad from another thread?