Introduction to Events
Event handling allows your application to receive input from the user. Event handling is initalised (along with video) with a call to:
The key to event handling in SDL is the SDL_Event union. The event queue itself is composed of a series of SDL_Event unions, one for each waiting event. SDL_Event unions are read from the queue with the SDL_PollEvent function and it is then up to the application to process the information stored with them.