From b71d787f695c779e571865d5214d4da8d50aa7c5 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 15 Jul 2021 13:38:53 +0200 Subject: [PATCH] ImGui keyboard input fields are now locale-sensitive --- src/imgui/imgui_widgets.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/imgui/imgui_widgets.cpp b/src/imgui/imgui_widgets.cpp index 46d2174fe..2258f61b5 100644 --- a/src/imgui/imgui_widgets.cpp +++ b/src/imgui/imgui_widgets.cpp @@ -40,6 +40,8 @@ Index of this file: #endif #include "imgui_internal.h" +#include + // System includes #include // toupper #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier @@ -3804,7 +3806,7 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f // The standard mandate that programs starts in the "C" locale where the decimal point is '.'. // We don't really intend to provide widespread support for it, but out of empathy for people stuck with using odd API, we support the bare minimum aka overriding the decimal point. // Change the default decimal_point with: - // ImGui::GetCurrentContext()->PlatformLocaleDecimalPoint = *localeconv()->decimal_point; + ImGui::GetCurrentContext()->PlatformLocaleDecimalPoint = *localeconv()->decimal_point; ImGuiContext& g = *GImGui; const unsigned c_decimal_point = (unsigned int)g.PlatformLocaleDecimalPoint;