SDL_ClipboardEvent(3type)

πŸ’– NAME πŸ’–

SDL_ClipboardEvent β€” the event that gets triggered when the clipboard contents have changed (that's the event.clipboard.* family, bestie 🫢)


✨ SYNOPSIS ✨

#include <SDL3/SDL_events.h>

typedef struct SDL_ClipboardEvent
{
    SDL_EventType type; /**< SDL_EVENT_CLIPBOARD_UPDATE */
    Uint32 reserved;
    Uint64 timestamp;   /**< In nanoseconds, populated using SDL_GetTicksNS() */
    bool owner;         /**< are we owning the clipboard (internal update) */
    Sint32 num_mime_types;   /**< number of mime types */
    const char **mime_types; /**< current mime types */
} SDL_ClipboardEvent;

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: somebody copies something. anything. a screenshot, a meme, a whole thesis. the clipboard goes πŸ‘€ and changes, and this is the struct that shows up to tell you about it. it's giving "I have news" energy πŸ’…

here's the field-by-field vibe check:

  • type β€” it's an SDL_EventType, and the comment says SDL_EVENT_CLIPBOARD_UPDATE. that's the whole personality of this event fr fr.
  • reserved β€” a Uint32 that's just… there. not your business, don't touch it, it's reserved bestie πŸ™ˆ
  • timestamp β€” a Uint64 in nanoseconds, populated using SDL_GetTicksNS(). yes, nanoseconds. she's precise like that ⏱️
  • owner β€” a bool. the comment asks: are we owning the clipboard (internal update). so if it's you doing the copying, you're the main character here πŸ‘‘
  • num_mime_types β€” a Sint32 holding the number of mime types. the headcount, basically.
  • mime_types β€” a const char ** holding the current mime types. the actual list. lowkey the star of the show 🌈
not me being obsessed with a clipboard event. but the way that a copy can come with a whole array of mime types?? iconic. periodt. πŸ’€

🌸 AVAILABILITY 🌸

this struct is available since SDL 3.2.0. so if you're on anything older… no she's not there yet, bestie 😭


Simple Directmedia Layer wrote this, it's the SDL 3.4.18 era of the docs, and the page is filed under SDL_ClipboardEvent(3type). mwah, go copy something and enjoy the event πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from