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

x33g5p2x  于2022-01-20 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(172)

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

GLFW.glfwFocusWindow介绍

[英]Brings the specified window to front and sets input focus. The window should already be visible and not iconified.

By default, both windowed and full screen mode windows are focused when initially created. Set the #GLFW_FOCUSED hint to disable this behavior.

Also by default, windowed mode windows are focused when shown with #glfwShowWindow. Set the #GLFW_FOCUS_ON_SHOW window hint to disable this behavior.

Do not use this function to steal focus from other applications unless you are certain that is what the user wants. Focus stealing can be extremely disruptive.

For a less disruptive way of getting the user's attention, see #glfwRequestWindowAttention.

Notes:

  • This function must only be called from the main thread.
  • Wayland: It is not possible for an application to bring its windows to front, this function will always emit #GLFW_PLATFORM_ERROR.
    [中]将指定的窗口置于前面并设置输入焦点。窗口应已可见且未图标化。
    默认情况下,窗口模式和全屏模式窗口在最初创建时都会聚焦。设置#GLFW_聚焦提示以禁用此行为。
    默认情况下,窗口模式窗口在与#glfwShowWindow一起显示时会聚焦。设置#GLFW_FOCUS_ON_SHOW window提示以禁用此行为。
    不要使用此功能从其他应用程序窃取焦点,除非您确定这是用户想要的。焦点窃取可能具有极大的破坏性。
    有关引起用户注意的不太具破坏性的方法,请参见#glfwRequestWindowAttention。
    笔记:
    *只能从主线程调用此函数。
    *Wayland:应用程序不可能将其窗口置于前端,此功能将始终发出#GLFW_PLATFORM_错误。

代码示例

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

/**
 * Brings the window to front and sets input focus. The window should already be visible and not iconified.
 */
public void focusWindow() {
  GLFW.glfwFocusWindow(windowHandle);
}

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

/**
 * Brings the window to front and sets input focus. The window should already be visible and not iconified.
 */
public void focusWindow() {
  GLFW.glfwFocusWindow(windowHandle);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

org.lwjgl.glfw.GLFW.glfwFocusWindow(window);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

glfwShowWindow(window);
glfwFocusWindow(window);

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

/**
 * Brings the window to front and sets input focus. The window should already be visible and not iconified.
 */
public void focusWindow() {
  GLFW.glfwFocusWindow(windowHandle);
}

相关文章

GLFW类方法