MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / _glfwInputKey

Function _glfwInputKey

extern/glfw/src/input.c:261–287  ·  view source on GitHub ↗

Notifies shared code of a physical key event

Source from the content-addressed store, hash-verified

259// Notifies shared code of a physical key event
260//
261void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods)
262{
263 if (key >= 0 && key <= GLFW_KEY_LAST)
264 {
265 GLFWbool repeated = GLFW_FALSE;
266
267 if (action == GLFW_RELEASE && window->keys[key] == GLFW_RELEASE)
268 return;
269
270 if (action == GLFW_PRESS && window->keys[key] == GLFW_PRESS)
271 repeated = GLFW_TRUE;
272
273 if (action == GLFW_RELEASE && window->stickyKeys)
274 window->keys[key] = _GLFW_STICK;
275 else
276 window->keys[key] = (char) action;
277
278 if (repeated)
279 action = GLFW_REPEAT;
280 }
281
282 if (!window->lockKeyMods)
283 mods &= ~(GLFW_MOD_CAPS_LOCK | GLFW_MOD_NUM_LOCK);
284
285 if (window->callbacks.key)
286 window->callbacks.key((GLFWwindow*) window, key, scancode, action, mods);
287}
288
289// Notifies shared code of a Unicode codepoint input event
290// The 'plain' parameter determines whether to emit a regular character event

Callers 6

processEventFunction · 0.85
_glfwInputWindowFocusFunction · 0.85
keyboardHandleKeyFunction · 0.85
windowProcFunction · 0.85
_glfwPlatformPollEventsFunction · 0.85
handleEventsFunction · 0.85

Calls 1

keyMethod · 0.45

Tested by

no test coverage detected