Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Clipboard

OPENRNDR programs can access the clipboard. Currently only text snippets can be read from and written to the clipboard.

Setting the clipboard content
fun main() = application {
    program {
        clipboard.contents = "this is the new clipboard content"
    }
}
Getting the clipboard content

Note that clipboard.contents is optional and its value can be null. The clipboard contents are reported null in case the clipboard contents are non-text or the clipboard is empty.

fun main() = application {
    program {
        clipboard.contents?.let {
            println("the clipboard contents: $it")
        }
    }
}

edit on GitHub