InputText: replaced some uses of SetKeyOwner() + IsKeyPressed() with Shortcut()

Which makes it easier to hook/disable those keys from outside if needed.
This commit is contained in:
ocornut
2022-11-16 15:55:10 +01:00
parent 81160fee56
commit 83cee9e091
4 changed files with 19 additions and 22 deletions

View File

@ -8035,13 +8035,13 @@ ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord)
return routing_data;
}
// Add
ImGuiKeyRoutingIndex idx = (ImGuiKeyRoutingIndex)rt->Entries.Size;
// Add to linked-list
ImGuiKeyRoutingIndex routing_data_idx = (ImGuiKeyRoutingIndex)rt->Entries.Size;
rt->Entries.push_back(ImGuiKeyRoutingData());
routing_data = &rt->Entries[idx];
routing_data = &rt->Entries[routing_data_idx];
routing_data->Mods = (ImU16)mods;
routing_data->NextEntryIndex = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; // Setup linked list
rt->Index[key - ImGuiKey_NamedKey_BEGIN] = idx;
rt->Index[key - ImGuiKey_NamedKey_BEGIN] = routing_data_idx;
return routing_data;
}