Java Code Examples for org.lwjgl.glfw.GLFW#glfwSetKeyCallback()
The following examples show how to use
org.lwjgl.glfw.GLFW#glfwSetKeyCallback() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Window.java From mars-sim with GNU General Public License v3.0 | 5 votes |
private void createCallbacks() { sizeCallback = new GLFWWindowSizeCallback() { public void invoke(long window, int w, int h) { width = w; height = h; isResized = true; } }; GLFW.glfwSetKeyCallback(window, input.getKeyboardCallback()); GLFW.glfwSetCursorPosCallback(window, input.getMouseMoveCallback()); GLFW.glfwSetMouseButtonCallback(window, input.getMouseButtonsCallback()); GLFW.glfwSetScrollCallback(window, input.getMouseScrollCallback()); GLFW.glfwSetWindowSizeCallback(window, sizeCallback); }
Example 2
Source File: GLFWContextCreator.java From settlers-remake with MIT License | 5 votes |
private void registerCallbacks() { GLFW.glfwSetKeyCallback(glfw_wnd, key_callback); GLFW.glfwSetMouseButtonCallback(glfw_wnd, mouse_callback); GLFW.glfwSetScrollCallback(glfw_wnd, scroll_callback); GLFW.glfwSetCursorEnterCallback(glfw_wnd, cursorenter_callback); GLFW.glfwSetCursorPosCallback(glfw_wnd, cursorpos_callback); GLFW.glfwSetWindowSizeCallback(glfw_wnd, size_callback); }
Example 3
Source File: Lwjgl3Mini2DxInput.java From mini2Dx with Apache License 2.0 | 5 votes |
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); }
Example 4
Source File: KeyListener.java From BoundingBoxOutlineReloaded with MIT License | 4 votes |
public static void init() { mainWindowHandle = minecraft.mainWindow.getHandle(); GLFW.glfwSetKeyCallback(mainWindowHandle, KeyListener::onKeyEvent); }