diff --git a/src/input.c b/src/input.c index b0ac944..6fcea3d 100644 --- a/src/input.c +++ b/src/input.c @@ -2,9 +2,27 @@ int checkQuit() { + int quit = 0; SDL_Event event; - if (SDL_PollEvent(&event) && event.type == SDL_QUIT) return 1; + if (SDL_PollEvent(&event)) + { + switch(event.type) + { + case SDL_QUIT: + quit = 1; + break; - return 0; + case SDL_KEYDOWN: + if (event.key.keysym.sym == SDLK_q) + { + quit = 1; + } + + default: + break; + } + } + + return quit; }