1

Im writing a python/pygame program that measures and time user actions. The user touch the tablet (pygame.FINGERDOWN) and when a visual cue is presented, she should lift her finger (pygame.FINGERUP). I want to be able to tell whether the user lifts her finger before the visual cue was presented.

here is a sample code (that doesn't work):

import pygame

running =True
while True:
    if running == True:
        for i in range(100000):
             I = i
        # Present visual cue here.
        running = False

    for event in pygame.event.get():
        if event.type == pygame.FINGERUP and running==True:
            print("Very bad")

I need that a FINGERUP event will interrupt the main loop. This code doesn't do it.

How can I modify it?

Many thanks in advance

Roi

D_00
  • 1,440
  • 2
  • 13
  • 32
Roi Yozevitch
  • 197
  • 3
  • 13

0 Answers0