From 39d27a6380f23c7f8b294b4d30539bcefed7521f Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Thu, 21 May 2015 21:25:14 +0200 Subject: [PATCH] Fixed undefined key access in test program. --- test/testdrawchessboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testdrawchessboard.c b/test/testdrawchessboard.c index ef89c2de7..a0bb56b90 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();