def ShowPhoto(photoFile):
screen = pygameEngine.GetScreen()
image = pygame.image.load(photoFile).convert()
image = pygame.transform.scale(image, (config.WIDTH,config.HEIGHT))
screen.blit(image, (0,0))
pygame.display.update()
sleep(1)
pygameEngine.ShowNavButtons()
i = 0
while True:
# get one pygame event
event = pygame.event.poll()
# handle events
# Button 1 = Quit
if (event.type == pygame.MOUSEBUTTONUP and event.button == 1) or (event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE) or GPIO.input(config.GPIO_NUMBER_BUTTON_1):
return -1
# Button 2 = Cycle old photos
if (event.type == pygame.MOUSEBUTTONUP and event.button == 3) or (event.type == pygame.KEYDOWN and event.key == pygame.K_RETURN) or GPIO.input(config.GPIO_NUMBER_BUTTON_2):
return 1
# Button Esc or Q = Quit keys
if event.type == pygame.KEYDOWN and (event.key == pygame.K_ESCAPE or event.key == pygame.K_q) :
return -1
评论列表
文章目录