Higher available clipboard size #769
-
So when you do We want to be able to copy/paste larger content. Are there any problems to look out for when setting the Since this is a general setting affecting all |
Beta Was this translation helpful? Give feedback.
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.
For
glfwSetClipboardString
I would suggest allocating a separate byte buffer instead, and calling that overload instead of theString
overload. For example:Depending on how much you use it, it might be worth allocating a single buffer up-front and re-using it.
For
glfwGetClipboardString
, it doesn't useMemoryStack
at all, it decodes the bytes directly into achar[]
(orbyte[]
on Java 9+) which is fed into the