From f6a9d8ae4e0e6890cf396f79d06f07bb42082d3b Mon Sep 17 00:00:00 2001 From: Wout Rombouts Date: Wed, 3 May 2023 19:52:38 +0200 Subject: [PATCH] s --- Software/threads/customthreads.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Software/threads/customthreads.py b/Software/threads/customthreads.py index e7bccab..fc273a6 100644 --- a/Software/threads/customthreads.py +++ b/Software/threads/customthreads.py @@ -159,7 +159,7 @@ def run(self): logging.info("Initialising Controller...") - mngr = pyjoystick.ThreadEventManager(self.__controller_add, self.__controller_remove, self.__controller_process) + mngr = pyjoystick.ThreadEventManager(event_loop=run_event_loop, add_joystick=self.__controller_add, remove_joystick=self.__controller_remove, handle_key_event=self.__controller_process, alive=self.__controller_alive) mngr.start() self.init_event.set() @@ -196,6 +196,9 @@ def __controller_process(self, key): logging.debug("Controller event: " + str(key)) self.pipe.append(data) + def __controller_alive(self): + return self.stop_event.is_set() + class ImageProcessingThread(Thread): def __init__(self, pipe, stop_event, init_event, pause_event): super(ImageProcessingThread, self).__init__(name="ImageProcessingThread")