MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / key_callback

Function key_callback

framework/platform/glfw_window.cpp:204–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void key_callback(GLFWwindow *window, int key, int /*scancode*/, int action, int /*mods*/)
205{
206 KeyCode key_code = translate_key_code(key);
207 KeyAction key_action = translate_key_action(action);
208
209 if (auto platform = reinterpret_cast<Platform *>(glfwGetWindowUserPointer(window)))
210 {
211 platform->input_event(KeyInputEvent{key_code, key_action});
212 }
213}
214
215inline MouseButton translate_mouse_button(int button)
216{

Callers

nothing calls this directly

Calls 3

translate_key_codeFunction · 0.70
translate_key_actionFunction · 0.70
input_eventMethod · 0.45

Tested by

no test coverage detected