def idle(self): # warping the mouse or init'ing sdl seems to cause a few to many # mouse events. this clears all the events that are currently in the # queue soya.clear_events() soya.Idler.idle(self)
def start_mouse_grab(self): soya.cursor_set_visible(0) soya.set_grab_input(1) soya.set_mouse_pos(camera.width / 2, camera.height / 2) soya.clear_events() Rx, ry = soya.get_mouse_rel_pos() self.grab_cursor = 1