---
name: "SDL_PenAxis"
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_PenAxis"
---

# SDL\_PenAxis(3type)

Pen axis indices.

## NAME

SDL\_PenAxis - Pen axis indices.

## HEADER FILE

Defined in SDL3/SDL\_pen.h

## SYNOPSIS

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

**typedef enum SDL\_PenAxis** **{**     **SDL\_PEN\_AXIS\_PRESSURE,  /\*\*\< Pen pressure.  Unidirectional: 0 to 1.0 \*/**     **SDL\_PEN\_AXIS\_XTILT,     /\*\*\< Pen horizontal tilt angle.  Bidirectional: -90.0 to 90.0 (left-to-right). \*/**     **SDL\_PEN\_AXIS\_YTILT,     /\*\*\< Pen vertical tilt angle.  Bidirectional: -90.0 to 90.0 (top-to-down). \*/**     **SDL\_PEN\_AXIS\_DISTANCE,  /\*\*\< Pen distance to drawing surface.  Unidirectional: 0.0 to 1.0 \*/**     **SDL\_PEN\_AXIS\_ROTATION,  /\*\*\< Pen barrel rotation.  Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). \*/**     **SDL\_PEN\_AXIS\_SLIDER,    /\*\*\< Pen finger wheel or slider (e.g., Airbrush Pen).  Unidirectional: 0 to 1.0 \*/**     **SDL\_PEN\_AXIS\_TANGENTIAL\_PRESSURE,    /\*\*\< Pressure from squeezing the pen (***barrel***pressure").***\*/*     **SDL\_PEN\_AXIS\_COUNT       /\*\*\< Total known pen axis types in this version of SDL. This number may grow in future releases! \*/** **} SDL\_PenAxis;**

## DESCRIPTION

These are the valid values for the **axis** field in

**SDL\_PenAxisEvent** . All axes are either normalised to 0..1 or report a (positive or negative) angle in degrees, with 0.0 representing the centre. Not all pens/backends support all axes: unsupported axes are always zero.

To convert angles for tilt and rotation into vector representation, use

**SDL\_sinf**\
  on the XTILT, YTILT, or ROTATION component, for example: **SDL\_sinf(xtilt**\***SDL\_PI\_F**/**180.0)** .

## AVAILABILITY

This enum is available since SDL 3.2.0.
