Commit e6e8dcde authored by Georgiy Yankovskiy's avatar Georgiy Yankovskiy

Gamepad polling terminate

parent 7fd78120
......@@ -34,6 +34,7 @@ class Gamepad:
self.thread.start()
def cycle(self):
try:
while not self.terminated:
# pygame.event.pump()
pygame.event.wait()
......@@ -69,10 +70,12 @@ class Gamepad:
# for i in range(self.joystick.get_numbuttons()):
# button = self.joystick.get_button(i)
# print(f"Button {i}: {button}")
except pygame.error:
pass
def terminate(self):
# TODO
# self.thread.
self.terminated = True
pygame.quit()
pass
pass
......@@ -26,6 +26,10 @@ Window {
}
}
Component.onDestruction: {
console.log("Desctructing window");
}
id: window
width: 640
height: 480
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment