Replies: 1 comment 7 replies
-
For String forClipboard = "my very long string";
ByteBuffer buffer = MemoryUtil.memUTF8(forClipboard);
try {
glfwSetClipboardString(window, buffer);
} finally {
MemoryUtil.memFree(buffer);
}
// Note: I didn't test this code, there may be minor errors. The general idea should be sound. Depending on how much you use it, it might be worth allocating a single buffer up-front and re-using it. For |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So when you do
GLFW.glfwSetClipboardString
a newMemoryStack
for that clipboard is created. That stack has the default size of 64 kB.We want to be able to copy/paste larger content. Are there any problems to look out for when setting the
org.lwjgl.system.stackSize
higher?Since this is a general setting affecting all
MemoryStack
, not necessarily only applying toglfwGet/SetClipboardString
, I don't know if this doesn't cause any negative effects if I set this to 512/1024/whatever.Beta Was this translation helpful? Give feedback.
All reactions