SDL_PenAxisEvent(3type)
π SDL_PenAxisEvent (3type) β¨
okay bestie, welcome to the SDL3 DATATYPES corner of the manual β this one's about the pressure-sensitive pen pressure / angle event structure, aka the <hotpink>event.paxis.*</hotpink> vibe. it's giving stylus main character energy ποΈπ
πΈ NAME πΈ
SDL_PenAxisEvent β the pressure-sensitive pen pressure / angle event structure, also known as <purple>event.paxis.*</purple>. no cap, that's literally the whole name section, we move π
β¨ SYNOPSIS β¨
so first you gotta include the header, periodt:
#include <SDL3/SDL_events.h>
and here's the struct itself, character for character, don't touch a thing:
typedef struct SDL_PenAxisEvent
{
SDL_EventType type; /**< SDL_EVENT_PEN_AXIS */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_WindowID windowID; /**< The window with pen 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 */
SDL_PenAxis axis; /**< Axis that has changed */
float value; /**< New value of axis */
SDL_PenDeviceType device_type; /**< the device type of the pen, if known (added in 3.4.18). */
} SDL_PenAxisEvent;
let's break the fields down bc they're all kinda iconic in their own way π«Ά
typeβ it's anSDL_EventType, and for this one it's<rainbow>SDL_EVENT_PEN_AXIS</rainbow>πreservedβ aUint32. it's reserved. mind your business, bestie πtimestampβ aUint64, measured in nanoseconds, and it gets populated usingSDL_GetTicksNS()β±οΈwindowIDβ anSDL_WindowID: the window with pen focus, if any (emphasis on if any, sometimes there's nobody home π)whichβ anSDL_PenID: the pen instance id, so you know which pen is which ποΈpen_stateβ anSDL_PenInputFlags: the complete pen input state at the time of the event. complete. the whole picture. slay πxβ afloat: X coordinate, relative to window πyβ afloat: Y coordinate, relative to window πaxisβ anSDL_PenAxis: the axis that has changed π―valueβ afloat: the new value of that axis β¨device_typeβ anSDL_PenDeviceType: the device type of the pen, if known (and heads up, this one was added in 3.4.18) π
π DESCRIPTION π
so the thing about this one, bestie, and it's lowkey important:
You might get some of these events even if the pen isn't touching the tablet.
like. it's not even touching it. and you're still getting events. the pen is just hovering there, being mysterious, doing its own thing π¦ iykyk.
π AVAILABILITY π
this struct has been available since SDL 3.2.0. so if you're on anything older... no it isn't, sorry babe π
okay that's the whole page, you ate it up fr fr π
this was brought to you by Simple Directmedia Layer, version SDL 3.4.18 β the <cyan>SDL_PenAxisEvent(3type)</cyan> page, straight from the SDL3 DATATYPES section. mwah, go draw something cute with your stylus πβ¨π
π¦ 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