---
name: "SDL_SetClipboardText"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_SetClipboardText"
---

# SDL\_SetClipboardText(3)

Put UTF-8 text into the clipboard.

## NAME

SDL\_SetClipboardText - Put UTF-8 text into the clipboard.

## HEADER FILE

Defined in SDL3/SDL\_clipboard.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_SetClipboardText(const char \*text);**

## FUNCTION PARAMETERS

- *text*

  the text to store in the clipboard.

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

This function should only be called on the main thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetClipboardText**(3)](/SDL_GetClipboardText/3.md), **•**(3), [**SDL\_HasClipboardText**(3)](/SDL_HasClipboardText/3.md)
