Skip to content

TSdlPenMotionEvent

Pressure-sensitive pen motion event structure (Event.PenMotion.* )

Depending on the hardware, you may get motion events when the pen is not touching a tablet, for tracking a pen even when it isn't drawing. You should listen for TSdlEventKind.PenDown and TSdlEventKind.PenUp events, or check TSdlPenInputFlags.Down in PenState to decide if a pen is "drawing" when dealing with pen motion.

Definition

Unit: Neslib.Sdl3.Events

type TSdlPenMotionEvent = record ... end;

Properties

Name Description
Kind Event kind (TSdlEventKind.PenMotion)
PenID The pen instance id
PenState Complete pen input state at time of event
Position Position, relative to window
Timestamp In nanoseconds, populated using SdlGetTicksNS
Window The window with pen focus, if any
WindowID The ID of the window with pen focus, if any
X X coordinate, relative to window
Y Y coordinate, relative to window

Property Descriptions

Kind

Event kind (TSdlEventKind.PenMotion)

property Kind: TSdlEventKind read GetKind

Type: TSdlEventKind


PenID

The pen instance id

property PenID: TSdlPenID read FHandle.which

Type: TSdlPenID


PenState

Complete pen input state at time of event

property PenState: TSdlPenInputFlags read GetPenState

Type: TSdlPenInputFlags


Position

Position, relative to window

property Position: TSdlPointF read GetPosition

Type: TSdlPointF


Timestamp

In nanoseconds, populated using SdlGetTicksNS

property Timestamp: UInt64 read FHandle.timestamp

Type: UInt64


Window

The window with pen focus, if any

property Window: TSdlWindow read GetWindow

Type: TSdlWindow


WindowID

The ID of the window with pen focus, if any

property WindowID: TSdlWindowID read FHandle.windowID

Type: TSdlWindowID


X

X coordinate, relative to window

property X: Single read FHandle.x

Type: Single


Y

Y coordinate, relative to window

property Y: Single read FHandle.y

Type: Single