SDL_TextEditingEvent(3type)
SDL_TextEditingEvent π β¨
okay bestie, welcome to the SDL3 DATATYPES corner of the manual, where we talk about the keyboard text editing event structure β you'll see it in the wild as event.edit.* and it's genuinely so cute of it.
β¨ SYNOPSIS β¨
#include <SDL3/SDL_events.h>
typedef struct SDL_TextEditingEvent
{
SDL_EventType type; /**< SDL_EVENT_TEXT_EDITING */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_WindowID windowID; /**< The window with keyboard focus, if any */
const char *text; /**< The editing text */
Sint32 start; /**< The start cursor of selected editing text, or -1 if not set */
Sint32 length; /**< The length of selected editing text, or -1 if not set */
} SDL_TextEditingEvent;
like, look at her. she's giving struct and she's serving every field you need. no notes. π«Ά
πΈ DESCRIPTION πΈ
so the start cursor is literally the position β counted in UTF-8 characters β where your brand new typing is gonna get inserted into the editing text. main character insertion point energy, fr fr.
and the length? that's the number of UTF-8 characters that are gonna get replaced by that new typing. gone. deleted. replaced. periodt. π
π¦ AVAILABILITY π¦
this struct has been around since SDL 3.2.0. she's not new new, but she's still iconic.
ngl if you're handling IME / text editing, this is your girl β don't sleep on her π
and that's the whole vibe check, bestie! this page came to you from Simple Directmedia Layer, SDL 3.4.18, filed under SDL_TextEditingEvent(3type) β go forth and slay your text editing β¨ππ¦π
π¦ 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