From 9ed23a4b7983e88c0209468a8ef5af80edf929ed Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 14 Jan 2025 19:25:31 -0800 Subject: [PATCH] Updated SDL_SetEventFilter() documentation --- include/SDL3/SDL_events.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 55d417ef59..f372e0fae5 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -1377,8 +1377,9 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PushEvent(SDL_Event *event); typedef bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); /** - * Set up a filter to process all events before they change internal state and - * are posted to the internal event queue. + * Set up a filter to process all events before they are added to the internal event queue. + * + * If you just want to see events without modifying them or preventing them from being queued, you should use SDL_AddEventWatch() instead. * * If the filter function returns true when called, then the event will be * added to the internal queue. If it returns false, then the event will be @@ -1392,17 +1393,9 @@ typedef bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); * interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the * application at the next event poll. * - * There is one caveat when dealing with the SDL_QuitEvent event type. The - * event filter is only called when the window manager desires to close the - * application window. If the event filter returns 1, then the window will be - * closed, otherwise the window will remain open if possible. - * * Note: Disabled events never make it to the event filter function; see * SDL_SetEventEnabled(). * - * Note: If you just want to inspect events without filtering, you should use - * SDL_AddEventWatch() instead. - * * Note: Events pushed onto the queue with SDL_PushEvent() get passed through * the event filter, but events pushed onto the queue with SDL_PeepEvents() do * not.