You can get the state of the keyboard, mouse and joysticks at any time. Use the following routines:

SDL_GetKeyState
SDL_GetMouseState
Joystick functions (scroll down)

Hope this helps.