Inputs: g.ActiveIdUsingManyKeys[] prevent routes from being claimed.

Amend fc134f5
This commit is contained in:
ocornut
2024-01-24 17:52:46 +01:00
parent 9176eedf24
commit 8491cf36ad
3 changed files with 12 additions and 2 deletions

View File

@ -8451,6 +8451,16 @@ bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiI
IMGUI_DEBUG_LOG_INPUTROUTING("SetShortcutRouting(%s, owner_id=0x%08X, flags=%04X) -> filtered as potential char input\n", GetKeyChordName(key_chord), owner_id, flags);
return false;
}
// ActiveIdUsingAllKeyboardKeys trumps all for ActiveId
if ((flags & ImGuiInputFlags_RouteGlobalHigh) == 0 && g.ActiveIdUsingAllKeyboardKeys)
{
ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
if (key == ImGuiKey_None)
key = ConvertSingleModFlagToKey(&g, (ImGuiKey)(key_chord & ImGuiMod_Mask_));
if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END)
return false;
}
}
// FIXME-SHORTCUT: A way to configure the location/focus-scope to test would render this more flexible.