printf("begin\n"); while(0 == SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYDOWN)){ printf("inside\n"); SDL_Delay(300); } printf("end\n");