SDL_TextInputEvent(3type)

✨ SDL_TextInputEvent ✨

okay bestie, this is a page from the SDL3 DATATYPES manual, and today we're learning about SDL_TextInputEvent β€” the keyboard text input event structure, aka event.text.*. it's giving keyboard gossip. πŸŽ€


🌸 NAME 🌸

SDL_TextInputEvent β€” Keyboard text input event structure (event.text.*)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_events.h>

typedef struct SDL_TextInputEvent
{
    SDL_EventType type; /**< SDL_EVENT_TEXT_INPUT */
    Uint32 reserved;
    Uint64 timestamp;   /**< In nanoseconds, populated using SDL_GetTicksNS() */
    SDL_WindowID windowID; /**< The window with keyboard focus, if any */
    const char *text;   /**< The input text, UTF-8 encoded */
} SDL_TextInputEvent;

like, that's the whole struct, no notes, we love a compact icon πŸ’…


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea and it's kind of a big one: this event will never be delivered unless text input is enabled by calling SDL_StartTextInput().

and text input is disabled by default!! not me finding that out the hard way 😭 so if you're sitting there like "why is my SDL_EVENT_TEXT_INPUT not firing", bestie, you forgot to start it. that's the vibe check. do the call. slay.


⭐ AVAILABILITY ⭐

This struct is available since SDL 3.2.0. periodt. πŸ‘‘


🫢 SEE ALSO 🫢


and that's the page fr fr ✨ this one came from the Simple Directmedia Layer peeps, SDL 3.4.18, dated SDL_TextInputEvent(3type) β€” go enable your text input and eat, bestie πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from