---
name: "SDL_UserEvent"
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_UserEvent/3type"
---

# SDL\_UserEvent(3type)

A user-defined event type (event.user.\*)

## NAME

SDL\_UserEvent - A user-defined event type (event.user.\*)

## HEADER FILE

Defined in SDL3/SDL\_events.h

## SYNOPSIS

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

**typedef struct SDL\_UserEvent** **{**     **Uint32 type;        /\*\*\< SDL\_EVENT\_USER through SDL\_EVENT\_LAST-1, Uint32 because these are not in the SDL\_EventType enumeration \*/**     **Uint32 reserved;**     **Uint64 timestamp;   /\*\*\< In nanoseconds, populated using SDL\_GetTicksNS() \*/**     **SDL\_WindowID windowID; /\*\*\< The associated window if any \*/**     **Sint32 code;        /\*\*\< User defined event code \*/**     **void \*data1;        /\*\*\< User defined data pointer \*/**     **void \*data2;        /\*\*\< User defined data pointer \*/** **} SDL\_UserEvent;**

## DESCRIPTION

This event is unique; it is never created by SDL, but only by the application. The event can be pushed onto the event queue using

**SDL\_PushEvent** (). The contents of the structure members are completely up to the programmer; the only requirement is that '''type''' is a value obtained from  **SDL\_RegisterEvents** ().

## AVAILABILITY

This struct is available since SDL 3.2.0.
