SDL_GetTextInputArea(3)
π SDL_GetTextInputArea π
okay bestie, welcome to the SDL_GetTextInputArea(3) page, straight out of the SDL3 FUNCTIONS section of the manual. this one's a lil baby function that just tells you where your text input area is at. no cap.
β¨ NAME β¨
SDL_GetTextInputArea β get the area used to type Unicode text input. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_keyboard.h>
bool SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor);
like. look at her. so simple. so iconic. π
π¦ DESCRIPTION π¦
so basically this function returns the values that were previously set by SDL_SetTextInputArea(). it's giving "read the receipt you already wrote" energy. it does not set anything, it does not judge anything, it just reports back what you told it before. periodt.
π FUNCTION PARAMETERS π
windowβ the window for which to query the text input area. yes, you need to tell her which window, she's not a mind reader πrectβ a pointer to anSDL_Rectfilled in with the text input area. and here's the slay part: it may beNULL. so if you don't care about the rect, you can just passNULLand she won't be mad at you.cursorβ a pointer to the offset of the current cursor location relative torect->x. and yup, this one may beNULLtoo. flexible queen behavior honestly.
β RETURN VALUE β
Returns true on success or false on failure. and if it fails? call SDL_GetError() for more information, because she will NOT explain herself unprompted. you gotta ask. π
π₯ THREAD SAFETY π₯
β οΈ this function should only be called on the main thread. do not try to be cute and call her from a worker thread. she will not respond to that energy. main thread only, bestie, that's the rule. π
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on something older, that's a you problem, go update. β
π SEE ALSO π
SDL_SetTextInputArea(3)β the setter to this getter, the other half of the duo, the matching set, the bestie to her bestie π«Ά
and that's the whole page, babes!! go forth and query your text input area with confidence. you got this, i believe in you fr fr. π
β with love from the Simple Directmedia Layer crew, this was SDL 3.4.18, dated like the very manual page you just read, signing off: SDL_GetTextInputArea(3) πβ¨
π¦ 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