On this page

clipboard.h

The system clipboard as UTF-8 text, main thread only.

#include "isolenui/platform/clipboard.h". The guide starts at Text editing and IME.

Clipboard

Explained in Text editing and IME.

clipboard_setclipboard_get

Example

share.cpp
#include "isolenui/platform/clipboard.h"
#include "isolenui/ui/ui.h"
#include "isolenui/kit/kit.h"

#include <string.h>

// copy a readout, and paste a short code into a buffer the app owns
static void share_row(ui::ctx* u, const char* link, char* code, uint32_t cap)
{
    if (ui::button(u, "copy link")) {
        clipboard_set(link, uint32_t(strlen(link)));
    }
    if (ui::button(u, "paste code")) {
        // the full length comes back even when it did not fit
        const uint32_t n = clipboard_get(code, cap - 1u);
        code[n < cap - 1u ? n : cap - 1u] = '\0';
    }
}

Last updated 23 October 2026