本文整理了Java中org.lwjgl.glfw.GLFW.glfwSetCharCallback()
方法的一些代码示例,展示了GLFW.glfwSetCharCallback()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GLFW.glfwSetCharCallback()
方法的具体详情如下:
包路径:org.lwjgl.glfw.GLFW
类名称:GLFW
方法名:glfwSetCharCallback
[英]Sets the character callback of the specified window, which is called when a Unicode character is input.
The character callback is intended for Unicode text input. As it deals with characters, it is keyboard layout dependent, whereas #glfwSetKeyCallback is not. Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was pressed or released, see the key callback instead.
The character callback behaves as system text input normally does and will not be called if modifier keys are held down that would prevent normal text input on that platform, for example a Super (Command) key on macOS or Alt key on Windows. There is #glfwSetCharModsCallback that receives these events.
This function must only be called from the main thread.
[中]设置指定窗口的字符回调,在输入Unicode字符时调用该窗口。
字符回调用于Unicode文本输入。当它处理字符时,它依赖于键盘布局,而#glfwSetKeyCallback则不是。字符不以1:1映射到物理键,因为键可能产生零个、一个或多个字符。如果您想知道是否按下或释放了特定的物理键,请参阅键回调。
字符回调的行为与系统文本输入的正常行为相同,如果按下修改键(例如macOS上的超级(命令)键或Windows上的Alt键),则不会调用该回调。有#glfwSetCharModsCallback接收这些事件。
只能从主线程调用此函数。
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
glfwSetCharCallback(context.getWindowHandle(), charCallback = new GLFWCharCallback() {
@Override
public void invoke(final long window, final int codepoint) {
代码示例来源:origin: libgdx/libgdx
public void windowHandleChanged(long windowHandle) {
resetPollingStates();
GLFW.glfwSetKeyCallback(window.getWindowHandle(), keyCallback);
GLFW.glfwSetCharCallback(window.getWindowHandle(), charCallback);
GLFW.glfwSetScrollCallback(window.getWindowHandle(), scrollCallback);
GLFW.glfwSetCursorPosCallback(window.getWindowHandle(), cursorPosCallback);
GLFW.glfwSetMouseButtonCallback(window.getWindowHandle(), mouseButtonCallback);
}
代码示例来源:origin: libgdx/libgdx
public void windowHandleChanged(long windowHandle) {
resetPollingStates();
GLFW.glfwSetKeyCallback(window.getWindowHandle(), keyCallback);
GLFW.glfwSetCharCallback(window.getWindowHandle(), charCallback);
GLFW.glfwSetScrollCallback(window.getWindowHandle(), scrollCallback);
GLFW.glfwSetCursorPosCallback(window.getWindowHandle(), cursorPosCallback);
GLFW.glfwSetMouseButtonCallback(window.getWindowHandle(), mouseButtonCallback);
}
代码示例来源:origin: org.lwjgl.osgi/org.lwjgl.glfw
/** See {@link GLFW#glfwSetCharCallback SetCharCallback}. */
public GLFWCharCallback set(long window) {
glfwSetCharCallback(window, this);
return this;
}
代码示例来源:origin: playn/playn
public GLFWInput(LWJGLPlatform plat, long window) {
super(plat);
this.plat = plat;
this.window = window;
glfwSetCharCallback(window, charCallback);
glfwSetKeyCallback(window, keyCallback);
glfwSetMouseButtonCallback(window, mouseBtnCallback);
glfwSetCursorPosCallback(window, cursorPosCallback);
glfwSetScrollCallback(window, scrollCallback);
}
代码示例来源:origin: org.jmonkeyengine/jme3-lwjgl3
glfwSetCharCallback(context.getWindowHandle(), charCallback = new GLFWCharCallback() {
代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl3
public void windowHandleChanged(long windowHandle) {
resetPollingStates();
GLFW.glfwSetKeyCallback(window.getWindowHandle(), keyCallback);
GLFW.glfwSetCharCallback(window.getWindowHandle(), charCallback);
GLFW.glfwSetScrollCallback(window.getWindowHandle(), scrollCallback);
GLFW.glfwSetCursorPosCallback(window.getWindowHandle(), cursorPosCallback);
GLFW.glfwSetMouseButtonCallback(window.getWindowHandle(), mouseButtonCallback);
}
代码示例来源:origin: sriharshachilakapati/SilenceEngine
glfwSetCharCallback(handle, glfwCharCallback);
glfwSetCharModsCallback(handle, glfwCharModsCallback);
glfwSetCursorEnterCallback(handle, glfwCursorEnterCallback);
代码示例来源:origin: SpinyOwl/legui
/**
* Used to bind callbacks to OpenGL window. This method could be called only from main thread (Main OpenGL thread).
*
* @param window window to bind.
* @param keeper callback keeper with callbacks.
*/
static void registerCallbacks(long window, CallbackKeeper keeper) {
glfwSetCharCallback(window, keeper.getChainCharCallback());
glfwSetDropCallback(window, keeper.getChainDropCallback());
glfwSetKeyCallback(window, keeper.getChainKeyCallback());
glfwSetScrollCallback(window, keeper.getChainScrollCallback());
glfwSetCharModsCallback(window, keeper.getChainCharModsCallback());
glfwSetCursorEnterCallback(window, keeper.getChainCursorEnterCallback());
glfwSetFramebufferSizeCallback(window, keeper.getChainFramebufferSizeCallback());
glfwSetMouseButtonCallback(window, keeper.getChainMouseButtonCallback());
glfwSetCursorPosCallback(window, keeper.getChainCursorPosCallback());
glfwSetWindowCloseCallback(window, keeper.getChainWindowCloseCallback());
glfwSetWindowFocusCallback(window, keeper.getChainWindowFocusCallback());
glfwSetWindowIconifyCallback(window, keeper.getChainWindowIconifyCallback());
glfwSetWindowPosCallback(window, keeper.getChainWindowPosCallback());
glfwSetWindowRefreshCallback(window, keeper.getChainWindowRefreshCallback());
glfwSetWindowSizeCallback(window, keeper.getChainWindowSizeCallback());
}
内容来源于网络,如有侵权,请联系作者删除!