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 true if the clipboard has text in it πŸ’š
  • returns false if 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:


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