Pressure-sensitive pen button event structure (event.pbutton.*)
Defined in <SDL3/SDL_events.h>
typedef struct SDL_PenButtonEvent
{/**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */
SDL_EventType type;
Uint32 reserved;/**< In nanoseconds, populated using SDL_GetTicksNS() */
Uint64 timestamp; /**< The window with mouse focus, if any */
SDL_WindowID windowID; /**< The pen instance id */
SDL_PenID which; /**< Complete pen input state at time of event */
SDL_PenInputFlags pen_state; float x; /**< X coordinate, relative to window */
float y; /**< Y coordinate, relative to window */
/**< The pen button index (first button is 1). */
Uint8 button; bool down; /**< true if the button is pressed */
} SDL_PenButtonEvent;
This is for buttons on the pen itself that the user might click. The pen itself pressing down to draw triggers a SDL_EVENT_PEN_DOWN event instead.
This struct is available since SDL 3.1.3.