ui.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:mqtt-control-panel 作者: colinodell 项目源码 文件源码
def process_input(self):
        # Process touchscreen input
        from alarmpanel.button import STATE_PRESSED
        for event in pygame.event.get():
            if event.type is pygame.MOUSEBUTTONDOWN:
                pos = pygame.mouse.get_pos()
                for b in self._buttons:
                    if b.down(pos): break
            elif event.type is pygame.MOUSEBUTTONUP:
                pos = pygame.mouse.get_pos()
                for b in self._buttons:
                    if b.up(pos): pass
                    # Redraw other buttons which might be stuck in the down position
                    elif b.state == STATE_PRESSED:
                        b.set_state(STATE_DEFAULT)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号