SDL_GetPrimarySelectionText(3)
β¨ SDL_GetPrimarySelectionText β¨
okay bestie, so this one lives in the SDL3 FUNCTIONS corner of the SDL_GetPrimarySelectionText(3) manual, and it's literally the vibe: get UTF-8 text from the primary selection. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_clipboard.h>
char * SDL_GetPrimarySelectionText(void);
no args, no stress, just a void and a dream. π«Ά
π DESCRIPTION π
so like, this function hands you the primary selection's content as UTF-8 text.
and here's the tea π: if there is not enough memory left for a copy of the primary selection's content, it returns an empty string. yes, that's the fail state. it's giving "quiet quitting" but make it a char *.
π RETURN VALUE π
- on success β you get the primary selection text β¨
- on failure β you get an empty string π and you should call
SDL_GetError()for more information, fr fr
and listen β when you're done with it, it should be freed with SDL_free(). no cap. do not leave it hanging, that's not the move. π§
π§΅ THREAD SAFETY π§΅
β οΈ this function should only be called on the main thread. main character energy only, bestie. do not bring your little background threads to this party. π
π AVAILABILITY π
this function is available since SDL 3.2.0. iconic. historic. periodt. π
π¦ SEE ALSO π¦
iykyk β go read those next, they're the whole squad. π
kisses, and remember: free your strings, protect your main thread, and stay hydrated πβ¨
this has been your girl, bringing you Simple Directmedia Layer β SDL 3.4.18 β SDL_GetPrimarySelectionText(3). slay, bye! ππΈ
π¦ 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