def on_mouse_press(self, x, y, button, modifiers):
    self.mouse_captured = (not self.mouse_captured)
    self.set_exclusive_mouse(self.mouse_captured)
def on_mouse_press(self, x, y, button, modifiers):
    self.mouse_captured = (not self.mouse_captured)
    self.set_exclusive_mouse(self.mouse_captured)