SDL_TEXTEDITINGCANDIDATESEVENT(3type)
π SDL_TextEditingCandidatesEvent π
okay bestie, sit DOWN, because this one is literally the keyboard IME candidates event structure, and it lives at event.edit_candidates.*. yes, that's a real path, that's its whole address. it's a 3type page from the SDL3 DATATYPES crew and it's giving "your IME is trying to show you a lil menu of options" energy. π
β¨ NAME β¨
SDL_TextEditingCandidatesEvent β Keyboard IME candidates event structure (and yes, the fields hang out under event.edit_candidates.*, iykyk) π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_events.h>
typedef struct SDL_TextEditingCandidatesEvent
{
SDL_EventType type; /**< SDL_EVENT_TEXT_EDITING_CANDIDATES */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_WindowID windowID; /**< The window with keyboard focus, if any */
const char * const *candidates; /**< The list of candidates, or NULL if there are no candidates available */
Sint32 num_candidates; /**< The number of strings in `candidates` */
Sint32 selected_candidate; /**< The index of the selected candidate, or -1 if no candidate is selected */
bool horizontal; /**< true if the list is horizontal, false if it's vertical */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
} SDL_TextEditingCandidatesEvent;
π DESCRIPTION π
so here's the tea, field by field, no skipping, we do not gatekeep here π
typeβ it's anSDL_EventTypeand it's alwaysSDL_EVENT_TEXT_EDITING_CANDIDATES. that's the vibe check, that's how you know who you're dealing with.reservedβ aUint32doing absolutely nothing. main character energy of just standing there. don't touch it, bestie.timestampβ aUint64in nanoseconds, and it's populated usingSDL_GetTicksNS(). it's the "when did this happen" receipt. β±οΈwindowIDβ anSDL_WindowID: the window with keyboard focus, if any. "if any" being the key phrase, so don't assume it's always there, ok?candidatesβ aconst char * const *, aka the list of candidates, orNULLif there are no candidates available. so like, sometimes the list is empty-empty, andNULLis how it tells you. πnum_candidatesβ aSint32, the number of strings incandidates. count 'em. literally.selected_candidateβ aSint32: the index of the selected candidate, or-1if no candidate is selected. so-1is the "nobody's picked yet" mood. πhorizontalβ abool:trueif the list is horizontal,falseif it's vertical. layout lore. β¨padding1,padding2,padding3β threeUint8s of pure structural filler. they exist. they are padding. that's the whole job. π§
π AVAILABILITY π
this struct is available since SDL 3.2.0. so if you're on something older, it's simply not there, no cap. π«Ά
lowkey reminder: copy the struct exactly as shown, padding and all, because thosepadding1/padding2/padding3bytes are not decorative, bestie. π₯
and that's the whole page, you ate it π this was the Simple Directmedia Layer era, SDL 3.4.18, SDL_TextEditingCandidatesEvent(3type) β go forth and handle your IME candidates, queen ππβ
π¦ 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