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)
评论列表
文章目录