diff --git a/imgui.cpp b/imgui.cpp index a10d0a0c2..353eda54b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10078,11 +10078,12 @@ static void UpdateAliasKey(ImGuiKey key, bool v, float analog_value) // [Internal] Do not use directly static ImGuiKeyChord GetMergedModsFromKeys() { + // Bypass IsKeyDown() for the unlikely case where user used a ImGuiInputFlags_LockXXXX on those. ImGuiKeyChord mods = 0; - if (ImGui::IsKeyDown(ImGuiMod_Ctrl)) { mods |= ImGuiMod_Ctrl; } - if (ImGui::IsKeyDown(ImGuiMod_Shift)) { mods |= ImGuiMod_Shift; } - if (ImGui::IsKeyDown(ImGuiMod_Alt)) { mods |= ImGuiMod_Alt; } - if (ImGui::IsKeyDown(ImGuiMod_Super)) { mods |= ImGuiMod_Super; } + if (ImGui::GetKeyData(ImGuiMod_Ctrl)->Down) { mods |= ImGuiMod_Ctrl; } + if (ImGui::GetKeyData(ImGuiMod_Shift)->Down) { mods |= ImGuiMod_Shift; } + if (ImGui::GetKeyData(ImGuiMod_Alt)->Down) { mods |= ImGuiMod_Alt; } + if (ImGui::GetKeyData(ImGuiMod_Super)->Down) { mods |= ImGuiMod_Super; } return mods; }