Browse Source

Fixed undefined key access in test program.

Philipp Wiesemann 10 years ago
parent
commit
39d27a6380
1 changed files with 1 additions and 1 deletions
  1. 1 1
      test/testdrawchessboard.c

+ 1 - 1
test/testdrawchessboard.c

@@ -68,7 +68,7 @@ loop()
 			return;
 			return;
 		}
 		}
 
 
-		if(e.key.keysym.sym == SDLK_ESCAPE) {
+		if ((e.type == SDL_KEYDOWN) && (e.key.keysym.sym == SDLK_ESCAPE)) {
 			done = 1;
 			done = 1;
 #ifdef __EMSCRIPTEN__
 #ifdef __EMSCRIPTEN__
 			emscripten_cancel_main_loop();
 			emscripten_cancel_main_loop();