SDL 3.0
SDL_PenMotionEvent Struct Reference

#include <SDL_events.h>

Data Fields

SDL_EventType type
 
Uint32 reserved
 
Uint64 timestamp
 
SDL_WindowID windowID
 
SDL_PenID which
 
SDL_PenInputFlags pen_state
 
float x
 
float y
 

Detailed Description

Pressure-sensitive pen motion event structure (event.pmotion.*)

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 SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP events, or check pen_state & SDL_PEN_INPUT_DOWN to decide if a pen is "drawing" when dealing with pen motion.

Since
This struct is available since SDL 3.1.3.

Definition at line 815 of file SDL_events.h.

Field Documentation

◆ pen_state

SDL_PenInputFlags SDL_PenMotionEvent::pen_state

Complete pen input state at time of event

Definition at line 822 of file SDL_events.h.

◆ reserved

Uint32 SDL_PenMotionEvent::reserved

Definition at line 818 of file SDL_events.h.

◆ timestamp

Uint64 SDL_PenMotionEvent::timestamp

In nanoseconds, populated using SDL_GetTicksNS()

Definition at line 819 of file SDL_events.h.

◆ type

SDL_EventType SDL_PenMotionEvent::type

SDL_EVENT_PEN_MOTION

Definition at line 817 of file SDL_events.h.

◆ which

SDL_PenID SDL_PenMotionEvent::which

The pen instance id

Definition at line 821 of file SDL_events.h.

◆ windowID

SDL_WindowID SDL_PenMotionEvent::windowID

The window with mouse focus, if any

Definition at line 820 of file SDL_events.h.

◆ x

float SDL_PenMotionEvent::x

X coordinate, relative to window

Definition at line 823 of file SDL_events.h.

◆ y

float SDL_PenMotionEvent::y

Y coordinate, relative to window

Definition at line 824 of file SDL_events.h.


The documentation for this struct was generated from the following file: