sh_read_clipboard method

Pointer<Char> sh_read_clipboard(
  1. Pointer<SelectionHook> hook
)

Read text from the system clipboard.

Returns the current clipboard contents as UTF-8, or NULL if the clipboard is empty or contains non-text data.

On Linux, this function returns NULL — clipboard read-back is not supported on Linux via this API.

The returned string is owned by the library and is valid until the next call to sh_read_clipboard from the same thread.

@param hook Valid SelectionHook instance. @return Clipboard text (library-owned), or NULL. @thread_safety Safe from any thread.

Implementation

ffi.Pointer<ffi.Char> sh_read_clipboard(ffi.Pointer<SelectionHook> hook) {
  return _sh_read_clipboard(hook);
}