From 6b2e03c5b1bc4f99dbd86d10e5fd12af9e3fe1c2 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 22 Jun 2023 22:02:31 +0200 Subject: [PATCH] GetKeyName(): Fixed assert with ImGuiMod_XXX values when IMGUI_DISABLE_OBSOLETE_KEYIO is set. --- docs/CHANGELOG.txt | 1 + imgui.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index ad77b8e7..076b3e83 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -73,6 +73,7 @@ Other changes: where user may not be callinga constructor manually. (#5856) - Modals: In the case of nested modal, made sure that focused or appearing windows are moved below the lowest blocking modal (rather than the highest one). (#4317) +- GetKeyName(): Fixed assert with ImGuiMod_XXX values when IMGUI_DISABLE_OBSOLETE_KEYIO is set. - Debug Tools: Added 'io.ConfigDebugIniSettings' option to save .ini data with extra comments. Currently mainly for inspecting Docking .ini data, but makes saving slower. - Demo: Added more developed "Widgets->Tooltips" section. (#1485) diff --git a/imgui.cpp b/imgui.cpp index 8cd4485f..2349389b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7911,7 +7911,7 @@ const char* ImGui::GetKeyName(ImGuiKey key) { ImGuiContext& g = *GImGui; #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO - IM_ASSERT((IsNamedKey(key) || key == ImGuiKey_None) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code."); + IM_ASSERT((IsNamedKeyOrModKey(key) || key == ImGuiKey_None) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code."); #else if (IsLegacyKey(key)) {