```{index} single: SDL_PushEvent (SDL2) ``` ```{index} single: SDL2::SDL_PushEvent ``` # SDL_PushEvent Puts an event on the queue, so a later `SDL_PollEvent` returns it. Takes the same hash reference shape `SDL_PollEvent` hands back, so an event can be captured, altered and replayed. Give at least `type`; any field that type carries may be set and the rest default to zero. ```perl SDL_PushEvent({ type => SDL_KEYDOWN, sym => SDLK_LEFT }); SDL_PushEvent({ type => SDL_QUIT }); ``` Returns 1 if the event was queued, 0 if a filter dropped it, and a negative number on error. Synthesising input this way is how a test drives a program that normally waits for a person.