(self)
The main event loop for a joystick
The main event loop for a joystick
The main event loop for a joystick
def dispatch_events(self):
        "The main event loop for a joystick"
        state = self.get_state()
        if not state:
            raise RuntimeError(
                "Joystick %d is not connected" % self.device_number)
        if state.packet_number != self._last_state.packet_number:
            # state has changed, handle the change
            self.update_packet_count(state)
            self.handle_changed_state(state)
        self._last_state = state
def dispatch_events ( self ) : state = self . get_state ( ) if not state : raise RuntimeError ( "Joystick %d is not connected" % self . device_number ) if state . packet_number != self . _last_state . packet_number : # state has changed, handle the change self . update_packet_count ( state ) self . handle_changed_state ( state ) self . _last_state = state