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 an SDL_Rect filled in with the text input area. and here's the slay part: it may be NULL. so if you don't care about the rect, you can just pass NULL and she won't be mad at you.
  • cursor β€” a pointer to the offset of the current cursor location relative to rect->x. and yup, this one may be NULL too. 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