Commit e6e8dcde authored by Georgiy Yankovskiy's avatar Georgiy Yankovskiy

Gamepad polling terminate

parent 7fd78120
...@@ -34,6 +34,7 @@ class Gamepad: ...@@ -34,6 +34,7 @@ class Gamepad:
self.thread.start() self.thread.start()
def cycle(self): def cycle(self):
try:
while not self.terminated: while not self.terminated:
# pygame.event.pump() # pygame.event.pump()
pygame.event.wait() pygame.event.wait()
...@@ -69,10 +70,12 @@ class Gamepad: ...@@ -69,10 +70,12 @@ class Gamepad:
# for i in range(self.joystick.get_numbuttons()): # for i in range(self.joystick.get_numbuttons()):
# button = self.joystick.get_button(i) # button = self.joystick.get_button(i)
# print(f"Button {i}: {button}") # print(f"Button {i}: {button}")
except pygame.error:
pass
def terminate(self): def terminate(self):
# TODO self.terminated = True
# self.thread. pygame.quit()
pass pass
pass pass
...@@ -26,6 +26,10 @@ Window { ...@@ -26,6 +26,10 @@ Window {
} }
} }
Component.onDestruction: {
console.log("Desctructing window");
}
id: window id: window
width: 640 width: 640
height: 480 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