def update_joystick(self,task):
        if self.callbacks_connected and self.joystick is not None:
            for e in pygame.event.get(): pass
            x = self.joystick.get_axis(1)
            y = self.joystick.get_axis(0)
            if self.joystick.get_numaxes() >= 5:
                u = self.joystick.get_axis(3)
                v = self.joystick.get_axis(4)
            else:
                u = 0
                v = 0
            buttons = (self.joystick.get_button(0),self.joystick.get_button(1),self.joystick.get_button(2),self.joystick.get_button(3))
            if not (self.last_x == x and self.last_y == y and self.last_u == u and self.last_v == v  and self.last_buttons == buttons): 
                self.joymove_mastercallback(x,y,u,v,buttons)
                self.last_x = x
                self.last_y = y
                self.last_u = u
                self.last_v = v
                self.last_buttons = buttons
        return Task.cont
dataset/ETHPy150Open sccn/SNAP/src/modules/LSE/LSE_GameClient.py/Main.update_joystick/original