SDL_PenButtonEvent(3type)
π SDL_PenButtonEvent β bestie, it's the pen button event struct π
okay so real quick, this page is SDL_PenButtonEvent(3type) from the SDL3 datatypes crew, and it's all about the lil buttons on your pen itself. yes, the pen has buttons. no cap. let's get into it ποΈβ¨
β¨ NAME β¨
SDL_PenButtonEvent β the pressure-sensitive pen button event structure, aka event.pbutton.* π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_events.h>
typedef struct SDL_PenButtonEvent
{
SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_WindowID windowID; /**< The window with mouse focus, if any */
SDL_PenID which; /**< The pen instance id */
SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */
float x; /**< X coordinate, relative to window */
float y; /**< Y coordinate, relative to window */
Uint8 button; /**< The pen button index (first button is 1). */
bool down; /**< true if the button is pressed */
SDL_PenDeviceType device_type; /**< the device type of the pen, if known (added in 3.4.18). */
} SDL_PenButtonEvent;
π¦ DESCRIPTION π¦
so this one is for the buttons that live on the pen itself β the ones your finger goes click on, yk? that's what this struct is for π
but here's the plot twist, bestie: when you press the pen down to draw, that's not this event. that one is SDL_EVENT_PEN_DOWN. totally different vibe. the way these two are always getting confused... π
do not mix them up. drawing-down β button-click. two separate events, two separate structs. periodt.
β AVAILABILITY β
this struct has been serving since SDL 3.2.0. iconic behavior honestly π
that's the whole page fr fr π«Ά this came to you from the fine folks at Simple Directmedia Layer, running SDL 3.4.18 β and yeah the footer's date slot was looking a lil empty ngl, so just picture a sparkly timestamp there πβ¨ bye bestie, go make some pen buttons pop! ππ¦
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms