function SDL_PollEvent(event : PSDL_Event) : Integer;
This function polls for currently pending events, and returns 1 if there are any pending events, or 0 if there are none available. If event is not nil, the next event is removed from the queue and stored in the block of memory pointed to by the event pointer.
FOLDOC gives the definition of poll as, "To check the status of an input line, sensor, or memory location to see if a particular external event has been registered."
See program SDL_ImageDemo1 for code to handle a keyboard event.