SDL_PenInputFlags(3type)
π SDL_PenInputFlags π
okay bestie, gather round, because this is the SDL_PenInputFlags page from the SDL3 datatypes manual and it's genuinely such a cute little type. no cap.
β¨ NAME β¨
SDL_PenInputFlags β pen input flags, as reported by various pen events' pen_state field. that's it, that's the whole vibe. it's the little bundle of bits that tells you what your pen is doing rn ποΈβ¨
πΈ SYNOPSIS πΈ
first things first, you gotta pull in the header:
#include <SDL3/SDL_pen.h>
and here's the type itself, she's just a Uint32 underneath, lowkey iconic:
typedef Uint32 SDL_PenInputFlags;
then the actual flags, and bestie these are the whole point, look at them:
#define SDL_PEN_INPUT_DOWN (1u << 0) /**< pen is pressed down */
#define SDL_PEN_INPUT_BUTTON_1 (1u << 1) /**< button 1 is pressed */
#define SDL_PEN_INPUT_BUTTON_2 (1u << 2) /**< button 2 is pressed */
#define SDL_PEN_INPUT_BUTTON_3 (1u << 3) /**< button 3 is pressed */
#define SDL_PEN_INPUT_BUTTON_4 (1u << 4) /**< button 4 is pressed */
#define SDL_PEN_INPUT_BUTTON_5 (1u << 5) /**< button 5 is pressed */
#define SDL_PEN_INPUT_ERASER_TIP (1u << 30) /**< eraser tip is used */
#define SDL_PEN_INPUT_IN_PROXIMITY (1u << 31) /**< pen is in proximity (since SDL 3.4.0) */
let's walk through the squad, one by one, fr fr:
SDL_PEN_INPUT_DOWNβ(1u << 0)β pen is pressed down. the pen is touching, she's committed πSDL_PEN_INPUT_BUTTON_1β(1u << 1)β button 1 is pressed.SDL_PEN_INPUT_BUTTON_2β(1u << 2)β button 2 is pressed.SDL_PEN_INPUT_BUTTON_3β(1u << 3)β button 3 is pressed.SDL_PEN_INPUT_BUTTON_4β(1u << 4)β button 4 is pressed.SDL_PEN_INPUT_BUTTON_5β(1u << 5)β button 5 is pressed. yes bestie, five whole buttons, the pen said "more" π«ΆSDL_PEN_INPUT_ERASER_TIPβ(1u << 30)β eraser tip is used. flipped her over, she's erasing now πSDL_PEN_INPUT_IN_PROXIMITYβ(1u << 31)β pen is in proximity (since SDL 3.4.0). she's hovering, not touching, just near you. main character energy honestly π
notice how the bit positions are all over the place? 0 through 5 up front, then a jump way out to 30 and 31. that's not a typo, that's just how she's built. do not "fix" it. π
these flags show up in the pen_state field of various pen events. that's the field you're reading, that's where the tea lives. π
π¦ AVAILABILITY π¦
This datatype is available since SDL 3.2.0. (and SDL_PEN_INPUT_IN_PROXIMITY specifically? that one's newer, SDL 3.4.0, as noted up there in the define.) β¨
and that's the whole page, bestie, you ate it. this little cutie came to you from Simple Directmedia Layer, SDL 3.4.18, and she's the SDL_PenInputFlags(3type) page. mwah, go write something iconic with it ππ
π¦ 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