org.lwjgl.glfw.GLFW.glfwGetClipboardString()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(191)

本文整理了Java中org.lwjgl.glfw.GLFW.glfwGetClipboardString()方法的一些代码示例,展示了GLFW.glfwGetClipboardString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GLFW.glfwGetClipboardString()方法的具体详情如下:
包路径:org.lwjgl.glfw.GLFW
类名称:GLFW
方法名:glfwGetClipboardString

GLFW.glfwGetClipboardString介绍

[英]Returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string. If the clipboard is empty or if its contents cannot be converted, NULL is returned and a #GLFW_FORMAT_UNAVAILABLE error is generated.

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to #glfwGetClipboardString or #glfwSetClipboardString, or until the library is terminated.

Note
  • This function must only be called from the main thread.
  • The returned string is allocated and freed by GLFW. You should not free it yourself.
  • The returned string is valid only until the next call to #glfwGetClipboardString or #glfwSetClipboardString.
    [中]如果系统剪贴板包含UTF-8编码字符串或可转换为UTF-8编码字符串,则返回系统剪贴板的内容。如果剪贴板为空或其内容无法转换,则返回NULL并生成#GLFW_FORMAT_UNAVAILABLE错误。
    返回的字符串由GLFW分配和释放。你不应该自己把它放出来。在下一次调用#glfwGetClipboardString或#glfwSetClipboardString之前,或者在库终止之前,它一直有效。
    #####注
    *只能从主线程调用此函数。
    *返回的字符串由GLFW分配和释放。你不应该自己把它放出来。
    *返回的字符串仅在下次调用#glfwGetClipboardString或#glfwSetClipboardString之前有效。

代码示例

代码示例来源:origin: libgdx/libgdx

@Override
public String getContents () {		
  return GLFW.glfwGetClipboardString(((Lwjgl3Graphics)Gdx.graphics).getWindow().getWindowHandle());
}

代码示例来源:origin: libgdx/libgdx

@Override
public String getContents () {		
  return GLFW.glfwGetClipboardString(((Lwjgl3Graphics)Gdx.graphics).getWindow().getWindowHandle());
}

代码示例来源:origin: SpinyOwl/legui

/**
 * Used to get string from clipboard.
 *
 * @return string from clipboard.
 */
@Override
public String getClipboardString() {
  return GLFW.glfwGetClipboardString(-1);
}

代码示例来源:origin: sriharshachilakapati/SilenceEngine

public String getClipboardString()
{
  return glfwGetClipboardString(handle);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl3

@Override
public String getContents () {		
  return GLFW.glfwGetClipboardString(((Lwjgl3Graphics)Gdx.graphics).getWindow().getWindowHandle());
}

相关文章

GLFW类方法