The peocedure

[pascal]
SDL_PumpEvents
[/pascal]

will process all pending Input state and update, in effect clearing the state.