SDL_HasClipboardText(3)
π SDL_HasClipboardText(3) π
okay bestie, so we're in the SDL3 FUNCTIONS section of the manual and today's main character is SDL_HasClipboardText β yes, the whole page, and she ate. β¨
πΈ NAME πΈ
SDL_HasClipboardText β this is the lil function you call when you're like "heyβ¦ does the clipboard even exist rn, and is there actually a non-empty text string chillin' in it?" π
β¨ SYNOPSIS β¨
first you gotta bring her in, she lives in this header:
#include <SDL3/SDL_clipboard.h>
and here's the whole entire signature, no notes:
bool SDL_HasClipboardText(void);
like. that's it. no arguments. she takes nothing. lowkey iconic behavior. π
π«Ά RETURN VALUE π«Ά
- returns
trueif the clipboard has text in it π - returns
falseif it does not π
that's the whole vibe check. no error code, no secret third option, just a good ol' bool. fr fr.
π§΅ THREAD SAFETY π§΅
β οΈ bestie. LISTEN. this function should only be called on the main thread. do not be out here threading this one from a worker thread, I am begging you. π main thread only. periodt.
π AVAILABILITY π
this one's been around since SDL 3.2.0 β so if you're on anything older, she is simply not there yet, sorry queen π
π SEE ALSO π
the whole clipboard friend group, go say hi:
SDL_GetClipboardText(3)β when you actually wanna read the text πSDL_SetClipboardText(3)β when you wanna put text in there, main character move π
and that's the page!! go check your clipboard, she's probably fine π¦
Simple Directmedia Layer π SDL 3.4.18 β mwah, love u, bye 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