List of functions and data types in SDL
SDLEvent nextEvent()
Usage
Get the next input event. Currently key presses, mouse movements, and mouse button presses are supported. An SDLQuit Exception will be thrown if the application window is closed. You should catch this, and run appropriate program shutdown routines, including sdlQuit.