X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fscenes%2Fmenu.py;h=822c87a1eb77db35d98b965694c3aff81e7b4dae;hb=1e797f12e1130f04cd736d63e46efc81ed971ce3;hp=c1fd5f814513eddab54e345c9671b8dc312c9425;hpb=24597ee01bda34802e020147c48fba7d131f0698;p=naja.git diff --git a/naja/scenes/menu.py b/naja/scenes/menu.py index c1fd5f8..822c87a 100644 --- a/naja/scenes/menu.py +++ b/naja/scenes/menu.py @@ -2,8 +2,11 @@ Main menu scene. """ +import pygame.locals as pgl + from naja.scenes.scene import Scene from naja.widgets.text import TextWidget +from naja.events import QuitGameEvent class MenuScene(Scene): @@ -14,4 +17,6 @@ class MenuScene(Scene): colour=(255, 255, 255))) def handle_event(self, ev): - pass + if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE): + QuitGameEvent.post() + return