---
name: "al_get_clipboard_text"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_get_clipboard_text"
---

# al\_get\_clipboard\_text(3)

Allegro 5 API

## NAME

al\_get\_clipboard\_text - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  char *al_get_clipboard_text(ALLEGRO_DISPLAY *display)
  ```

## DESCRIPTION

This function returns a pointer to a string, allocated with [al\_malloc(3)](/al_malloc/3.md) with the text contents of the clipboard if available. If no text is available on the clipboard then this function returns NULL. You must call [al\_free(3)](/al_free/3.md) on the returned pointer when you don’t need it anymore.

Beware that text on the clipboard on Windows may be in Windows format, that is, it may have carriage return newline combinations for the line endings instead of regular newlines for the line endings on Linux or OSX.

## SINCE

5\.1.12

## SEE ALSO

[al\_set\_clipboard\_text(3)](/al_set_clipboard_text/3.md), [al\_clipboard\_has\_text(3)](/al_clipboard_has_text/3.md)
