---
name: "SDL_PenProximityEvent"
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_PenProximityEvent"
---

# SDL\_PenProximityEvent(3type)

Pressure-sensitive pen proximity event structure (event.pmotion.\*)

## NAME

SDL\_PenProximityEvent - Pressure-sensitive pen proximity event structure (event.pmotion.\*)

## HEADER FILE

Defined in SDL3/SDL\_events.h

## SYNOPSIS

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

**typedef struct SDL\_PenProximityEvent** **{**     **SDL\_EventType type; /\*\*\< SDL\_EVENT\_PEN\_PROXIMITY\_IN or SDL\_EVENT\_PEN\_PROXIMITY\_OUT \*/**     **Uint32 reserved;**     **Uint64 timestamp;   /\*\*\< In nanoseconds, populated using SDL\_GetTicksNS() \*/**     **SDL\_WindowID windowID; /\*\*\< The window with pen focus, if any \*/**     **SDL\_PenID which;        /\*\*\< The pen instance id \*/** **} SDL\_PenProximityEvent;**

## DESCRIPTION

When a pen becomes visible to the system (it is close enough to a tablet, etc), SDL will send an

**SDL\_EVENT\_PEN\_PROXIMITY\_IN**\
  event with the new pen's ID. This ID is valid until the pen leaves proximity again (has been removed from the tablet's area, the tablet has been unplugged, etc). If the same pen reenters proximity again, it will be given a new ID.

Note that "proximity" means "close enough for the tablet to know the tool is there." The pen touching and lifting off from the tablet while not leaving the area are handled by  **SDL\_EVENT\_PEN\_DOWN**

and  **SDL\_EVENT\_PEN\_UP** .

## AVAILABILITY

This struct is available since SDL 3.2.0.
