#include #include SDL_Surface *screen; void cleanup() { SDL_FreeSurface(screen); SDL_Quit(); } int main() { SDL_Event event; SDL_Init(SDL_INIT_VIDEO); screen = SDL_SetVideoMode(800, 600, 32, 0); while (1) { while (SDL_PollEvent(&event)) { printf("%d", event.type); if (event.type == SDL_KEYUP || event.type == SDL_KEYDOWN) { printf(", %d", event.key.keysym.scancode); } printf("\n"); if (event.type == SDL_QUIT) { cleanup(); return 0; } } } }