glfwGetClipboardString

Returns the contents of the clipboard as a string.

This function returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string. If the clipboard is empty or if its contents cannot be converted, null is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated.

extern (C) @nogc nothrow __gshared
const(char)*
glfwGetClipboardString

Parameters

window GLFWwindow*

Deprecated. Any valid window or null.

Return Value

Type: const(char)*

The contents of the clipboard as a UTF-8 encoded string, or null if an error occurred.

Errors: Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_PLATFORM_ERROR.

Pointer lifetime

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to @ref glfwGetClipboardString or @ref glfwSetClipboardString, or until the library is terminated.

Thread Safety

This function must only be called from the main thread.

@sa @ref clipboard @sa @ref glfwSetClipboardString

Meta

Since

Added in version 3.0.

Ingroup: input