+ while(SDL_PollEvent(&e)) {
+ switch(e.type) {
+ case SDL_QUIT: return;
+ case SDL_KEYUP:
+ if(e.key.keysym.sym == SDLK_ESCAPE
+ || e.key.keysym.sym == SDLK_q)
+ return;
+ break;
+ case SDL_KEYDOWN:
+ if(state == HIGH_SCORE_ENTRY)
+ if(!process_score_input(&e.key.keysym)) {
+ // Write the high score table to the file
+ write_high_score_table();
+ // continue to display the scores briefly
+ state = HIGH_SCORE_DISPLAY;
+ state_timeout = 200;
+ play_tune(TUNE_TITLE_PAGE);
+ }
+ break;
+ }
+ }