
Quit Events:
typedef struct {
Uint8 type; /* Always SDL_QUIT */
} SDL_QuitEvent;
An SDL_QUIT
is generated when the user tries to close
the application window. If it is ignored or filtered out, the window
will remain open. If it is not ignored or filtered, it is queued normally
and the window is allowed to close. When the window is closed, screen
updates will complete, but have no effect.
SDL_Init()
installs signal handlers for SIGINT
(keyboard interrupt) and SIGTERM
(system termination request),
if handlers do not already exist, that generate SDL_QUIT
events as well. There is no way to determine the cause of an
SDL_QUIT
, but setting a signal handler in your application
will override the default generation of quit events for that signal.
There are no functions directly affecting the quit event, but a macro
SDL_QuitRequested()
will let you know whether or not
the user has requested that the application quit (via closing the window
or generating a keyboard interrupt.).

Unknown Window Events:
The system window manager event contains a pointer to system-specific
information about unknown window manager events. If you enable this event
using SDL_EventState()
, it will
be generated whenever unhandled events are received from the window manager.
This can be used, for example, to implement cut-and-paste in your application.
/* If you want to use this event, you should include SDL_syswm.h */
typedef struct {
Uint8 type;
SDL_SysWMmsg *msg;
} SDL_SysWMEvent;
If you want to obtain system-specific information about the window manager,
you can fill the version member of a SDL_SysWMinfo structure using the
SDL_VERSION()
macro found in SDL_version.h, and pass it to
the function:
extern int SDL_GetWMInfo(SDL_SysWMinfo *info);