Commit 39d27a6380f23c7f8b294b4d30539bcefed7521f

Philipp Wiesemann 2015-05-21T21:25:14

Fixed undefined key access in test program.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/test/testdrawchessboard.c b/test/testdrawchessboard.c
index ef89c2d..a0bb56b 100644
--- a/test/testdrawchessboard.c
+++ b/test/testdrawchessboard.c
@@ -68,7 +68,7 @@ loop()
 			return;
 		}
 
-		if(e.key.keysym.sym == SDLK_ESCAPE) {
+		if ((e.type == SDL_KEYDOWN) && (e.key.keysym.sym == SDLK_ESCAPE)) {
 			done = 1;
 #ifdef __EMSCRIPTEN__
 			emscripten_cancel_main_loop();