diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp index 1d2bb060..9d902d2b 100644 --- a/imgui_node_editor.cpp +++ b/imgui_node_editor.cpp @@ -166,6 +166,16 @@ void ed::Log(const char* fmt, ...) # endif } +namespace ImGui +{ + ImGuiKey GetKeyIndex(ImGuiKey key) + { + ImGuiContext& g = *GImGui; + IM_ASSERT(IsNamedKey(key)); + const ImGuiKeyData* key_data = GetKeyData(key); + return (ImGuiKey)(key_data - g.IO.KeysData); + } +} //------------------------------------------------------------------------------ static bool IsGroup(const ed::Node* node)