[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame.QUIT event



Jacob Hartline wrote:

On 10/8/06, *Farai Aschwanden* <fash@xxxxxxxxxx <mailto:fash@xxxxxxxxxx>> wrote:


    I dont know on what your question is based on. Do you want to control
    an exit?


Of course. What if my app is run in fullscreen mode? Can the user do something to make pygame.QUIT happen in that situation?
import pygame
from pygame.locals import *
pygame.display.init()
screen = pygame.display.set_mode((640,480),FULLSCREEN)
while 1:
   for event in pygame.event.get():
       if event.type == KEYDOWN:
           if event.key == K_ESCAPE:
              pygame.quit()
             raise SystemExit
   pygame.display.update()


#this may not work, I don't have time to test it, but that's the basic idea behind exiting your app in fullscreen.
HTH,
-Luke