SDL Event
lastmod 2026-11-10created 2015-06-172 edits
SDL_Event is a union in SDL that combines the structures for different kinds of events, such as keyboard, mouse, window, and joystick, into one. You check the event kind with the type field and then access the corresponding member, such as key, motion, or window. Events are taken from the queue with SDL_PollEvent() or SDL_WaitEvent(), and it is central to input handling in the game loop.
A union that contains structures for the different event types.