#include "Input.hpp" #include GLFWkeyboard* InputState::FindKeyboard(std::string_view name) { assert(false); // TODO } GlfwKeyboardAttachment* InputState::ConnectKeyboard(GLFWkeyboard* keyboard) { auto attachment = new GlfwKeyboardAttachment(); glfwSetKeyboardUserPointer(keyboard, attachment); return attachment; } void InputState::DisconnectKeyboard(GLFWkeyboard* keyboard) { InputState::instance->DisconnectKeyboard(keyboard); auto attachment = static_cast(glfwGetKeyboardUserPointer(keyboard)); // Defensive: this GLFWkeyboard* will be deleted after this callback ends anyways glfwSetKeyboardUserPointer(keyboard, nullptr); delete attachment; }