Python pygame 模块,JOYBUTTONUP 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用pygame.JOYBUTTONUP

项目:EasierLife    作者:littlecodersh    | 项目源码 | 文件源码
def __main_thread_fn(self):
        while 1:
            for event in pygame.event.get():
                if event.type == pygame.JOYBUTTONDOWN:
                    self.__functionDict['button'][event.button]('down')
                elif event.type == pygame.JOYBUTTONUP:
                    self.__functionDict['button'][event.button]('up')
            for i in range(self.__joyStick.get_numaxes()):
                self.__switch_determine('axis', i,
                    self.__get_axis_status(self.__joyStick.get_axis(i)))
            hatValue = self.__joyStick.get_hat(0)
            for i in range(2): self.__switch_determine('hat', i, hatValue[i])