SDL_HasPrimarySelectionText(3)
π SDL_HasPrimarySelectionText π
okay bestie so this is a lil function from the SDL3 FUNCTIONS crew, and her whole entire job is: does the primary selection even exist, and is there actually some non-empty text sitting in it? that's it. that's the vibe. she's the vibe check for your clipboard-adjacent situation β¨
β¨ NAME β¨
SDL_HasPrimarySelectionText β ask the universe whether the primary selection exists and whether it's holding a non-empty text string π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_clipboard.h>
bool SDL_HasPrimarySelectionText(void);
like. she takes no arguments. zero. nada. she's just a lil yes/no girlie π
π RETURN VALUE π
trueβ yesss, the primary selection has text in it πfalseβ nope, no text there, sorry babe π
π§ THREAD SAFETY π§
β οΈ okay this is the important one: this function should only be called on the main thread. do NOT be out here calling her from a worker thread, that's not the move. main thread only. periodt. π
π AVAILABILITY π
she's been around since SDL 3.2.0 β so if you're on anything older, she's not there yet, no cap π¦
β SEE ALSO β
go read those too, they're her sisters and they're iconic π
Simple Directmedia Layer β’ SDL 3.4.18 β’ SDL_HasPrimarySelectionText(3)
k bye ily, go check that primary selection bestie πΈπ β¨
π¦ 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