Notifies shared code of a physical key event
| 259 | // Notifies shared code of a physical key event |
| 260 | // |
| 261 | void _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 |
no test coverage detected