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

# SDL\_FilterEvents(3)

Run a specific filter function on the current event queue, removing any events for which the filter returns false.

## NAME

SDL\_FilterEvents - Run a specific filter function on the current event queue, removing any events for which the filter returns false.

## HEADER FILE

Defined in SDL3/SDL\_events.h

## SYNOPSIS

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

**void SDL\_FilterEvents(SDL\_EventFilter filter, void \*userdata);**

## DESCRIPTION

See  **SDL\_SetEventFilter** () for more information. Unlike

**SDL\_SetEventFilter** (), this function does not change the filter permanently, it only uses the supplied filter until this function returns.

## FUNCTION PARAMETERS

- *filter*

  the  **SDL\_EventFilter**\
    function to call when an event happens.

- *userdata*

  a pointer that is passed to **filter** .

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetEventFilter**(3)](/SDL_GetEventFilter/3.md), **•**(3), [**SDL\_SetEventFilter**(3)](/SDL_SetEventFilter/3.md)
