GLFW

- Documentation
- Download
- Media
- Community

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Functions
Clipboard support

## Functions
void | glfwSetClipboardString (GLFWwindow *window, const char *string)
| Sets the clipboard to the specified string. More...
const char * | glfwGetClipboardString (GLFWwindow *window)
| Retrieves the contents of the clipboard as a string. More...

## Detailed Description

## Function Documentation

const char* glfwGetClipboardString | ( | GLFWwindow * | window | ) |

This function returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string.

Parameters

  [in] | window | The window that will request the clipboard contents.

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

Note
  This function may only be called from the main thread.
  The returned string is allocated and freed by GLFW. You should not free it yourself.
  The returned string is valid only until the next call to glfwGetClipboardString or glfwSetClipboardString.

See Also
  glfwSetClipboardString

void glfwSetClipboardString | ( | GLFWwindow * | window,
|  | const char * | string
| ) |  |

This function sets the system clipboard to the specified, UTF-8 encoded string. The string is copied before returning, so you don't have to retain it afterwards.

Parameters

  [in] | window | The window that will own the clipboard contents.
  [in] | string | A UTF-8 encoded string.

Note
  This function may only be called from the main thread.

See Also
  glfwGetClipboardString