Move keys to constants
[naja.git] / naja / scenes / game.py
index cca363f797d18b2a4f2774b9f90d530eba0b3260..5b24347a4670c2ba572fb1cc66377d8689c38ed9 100644 (file)
@@ -4,6 +4,7 @@ Gameboard scene.
 
 import pygame.locals as pgl
 
+from naja.constants import KEYS
 from naja.events import SceneChangeEvent
 from naja.scenes.scene import Scene
 from naja.widgets.board import BoardWidget
@@ -28,6 +29,6 @@ class GameScene(Scene):
 
     def handle_scene_event(self, ev):
         from naja.scenes.menu import MenuScene
-        if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE):
+        if ev.type == pgl.KEYUP and ev.key in KEYS.QUIT:
             SceneChangeEvent.post(MenuScene)
             return