[visionegg] having trouble quiting run forever loops

  • From: "J. Henry" <jdhenry@xxxxxxxxxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Mon, 19 Jan 2004 16:33:18 -0800 (PST)


I am trying to atack go loops so that there is an outer runforever loop,
and multiple inner go loops. I am using keystrokes as handle event
callbacks to both quit the outer loop, and initiate inner finite go loops.
If I execute the code, my run forever loop works fine, I hit escape and it
quits just fine. If I execute the code and trigger the inner go loop, that
loop plays just fine. Howver, once I trigger an inner loop, the escape key
no longer quits the run forever loop. I can, however, still trigger teh
inner go loop.

Sample Code:

....define some state for run forever loop p
... define some state for inner go loop q
...make a presentaion abject for q

global p

def keydown(event):
        if event.key==pygame.locals.K_ESCAPE:
        if event.ky==pygame.locals.k_a:

handle_event_callbacks = [(pygame.locals.KEYDOWN,keydown)]

p =
  handle_event_callbacks = handle_event_callbacks)


Has anyone else run up against this problem? Any suggestions?


Jordanna Sprayberry
The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: