Table of Contents

Enum PenAxis

Namespace
Sdl3Sharp.Input
Assembly
Sdl3Sharp.dll

Represents the various axes of pen input

public enum PenAxis

Fields

Distance = 3

The pen's distance to the drawing surface

Values are unidirectional, in the range from 0 to 1 (no distance to maximum distance).

Pressure = 0

The pressure applied by the pen

Values are unidirectional, in the range from 0 to 1 (no pressure to maximum pressure).

Rotation = 4

The pen's barrel rotation angle

Values are bidirectional, in the range from -180° to 179.9° (clockwise, 0 is facing up, -180° is facing down).

Slider = 5

The pen's finger wheel or slider position (e.g. for Airbrush pens)

Values are unidirectional, in the range from 0 to 1.

TangentialPressure = 6

The pressure applied from squeezing the pen ("barrel pressure")

XTilt = 1

The pen's horizontal tilt angle

Values are bidirectional, in the range from -90° to 90° (full left tilt to full right tilt).

YTilt = 2

The pen's vertical tilt angle

Values are bidirectional, in the range from -90° to 90° (full up tilt to full down tilt).

Remarks

The values defined here are the valid values for the Axis property in the PenAxisEvent. Values of these axes are either normalised to the range from 0 to 1 or report a (positive or negative) angle in degrees, with 0 representing the centre. Not all pens/backends support all axes. Values of unsupported axes are always zero.

To convert angles for tilt and rotation into vector representation, use the following formula for values (x) of the respective axis:

sin(x ⋅ π / 180°)

where x is the value of either the XTilt, the YTilt, or the Rotation axis.