| 1497 | |
| 1498 | #ifdef LF_GLFW |
| 1499 | void glfw_key_callback(GLFWwindow* window, int32_t key, int scancode, int action, int mods) { |
| 1500 | (void)window; |
| 1501 | (void)mods; |
| 1502 | (void)scancode; |
| 1503 | // Changing the the keys array to resamble the state of the keyboard |
| 1504 | if(action != GLFW_RELEASE) { |
| 1505 | if(!state.input.keyboard.keys[key]) |
| 1506 | state.input.keyboard.keys[key] = true; |
| 1507 | } else { |
| 1508 | state.input.keyboard.keys[key] = false; |
| 1509 | } |
| 1510 | state.input.keyboard.keys_changed[key] = (action != GLFW_REPEAT); |
| 1511 | |
| 1512 | // Calling user defined callbacks |
| 1513 | for(uint32_t i = 0; i < state.input.key_cb_count; i++) { |
| 1514 | state.input.key_cbs[i](window, key, scancode, action, mods); |
| 1515 | } |
| 1516 | |
| 1517 | // Populating the key event |
| 1518 | state.key_ev.happened = true; |
| 1519 | state.key_ev.pressed = action != GLFW_RELEASE; |
| 1520 | state.key_ev.keycode = key; |
| 1521 | } |
| 1522 | void glfw_mouse_button_callback(GLFWwindow* window, int32_t button, int action, int mods) { |
| 1523 | (void)window; |
| 1524 | (void)mods; |
nothing calls this directly
no outgoing calls
no test coverage detected