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 πŸ‘‘


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