From 063b8952f9e7b1c62a786102c0e0c6b6ad3bc00e Mon Sep 17 00:00:00 2001 From: Allen Ray Date: Mon, 21 Jun 2021 08:42:27 -0400 Subject: [PATCH] Adding Clipboard get/set functions to window --- pixelgl/window.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pixelgl/window.go b/pixelgl/window.go index f237c0b..ffdc02c 100644 --- a/pixelgl/window.go +++ b/pixelgl/window.go @@ -205,6 +205,17 @@ func (w *Window) Update() { w.UpdateInput() } +// ClipboardText returns the current value of the systems clipboard. +func (w *Window) ClipboardText() string { + return w.window.GetClipboardString() +} + +// SetClipboardText passes the given string to the underlying glfw window to set the +// systems clipboard. +func (w *Window) SetClipboardText(text string) { + w.window.SetClipboardString(text) +} + // SwapBuffers swaps buffers. Call this to swap buffers without polling window events. // Note that Update invokes SwapBuffers. func (w *Window) SwapBuffers() {