---
name: "SDL_EventFilter"
section: "3type"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_EventFilter"
---

# SDL\_EventFilter(3type)

A function pointer used for callbacks that watch the event queue.

## NAME

SDL\_EventFilter - A function pointer used for callbacks that watch the event queue.

## HEADER FILE

Defined in SDL3/SDL\_events.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**typedef bool (SDLCALL \*SDL\_EventFilter)(void \*userdata, SDL\_Event \*event);**

## FUNCTION PARAMETERS

- *userdata*

  what was passed as **userdata** to  **SDL\_SetEventFilter** () or  **SDL\_AddEventWatch** , etc.

- *event*

  the event that triggered the callback.

## RETURN VALUE

Returns true to permit event to be added to the queue, and false to disallow it. When used with  **SDL\_AddEventWatch** , the return value is ignored.

## THREAD SAFETY

SDL may call this callback at any time from any thread; the application is responsible for locking resources the callback touches that need to be protected.

## AVAILABILITY

This datatype is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_SetEventFilter**(3)](/SDL_SetEventFilter/3.md), **•**(3), [**SDL\_AddEventWatch**(3)](/SDL_AddEventWatch/3.md)
