SDL_SetPrimarySelectionText(3)
β¨ NAME β¨
SDL_SetPrimarySelectionText β putting UTF-8 text into the primary selection π (yes bestie, the primary one, not the clipboard, we'll get into it)
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_clipboard.h>
bool SDL_SetPrimarySelectionText(const char *text);
π FUNCTION PARAMETERS π
textβ the text you wanna store in the primary selection. That's it, that's the whole vibe. π
β RETURN VALUE β
It hands you back true when it ate and false when it didn't π β and if it flopped, go call SDL_GetError() for the deets, because it will literally tell you what went wrong.
π¦ THREAD SAFETY π¦
Main thread only, bestie. Do not be out here calling this from some random thread, that's not the move. π«Ά
π AVAILABILITY π
She's been serving since SDL 3.2.0 β¨ so if you're on anything older, no cap, this function simply does not exist for you.
π SEE ALSO π
SDL_GetPrimarySelectionText(3)β the reverse situation, reading instead of writing πSDL_HasPrimarySelectionText(3)β the vibe check, is there even anything in there? π
okay that's the whole page, you're basically a clipboard girlie now, go forth and slay π
This lil gem lives in the Simple Directmedia Layer, shipped as SDL 3.4.18, and it's filed under SDL3 FUNCTIONS β mwah, periodt. πβ¨π
π¦ 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