Shortcuts in hierarchy panel cannot be pressed when any widget is focused

This commit is contained in:
Sri Sham Haran 2023-02-04 01:20:01 +08:00
parent e88447bcf0
commit b89be05ceb
1 changed files with 22 additions and 20 deletions

View File

@ -96,6 +96,8 @@ namespace SHADE
} }
ImGui::SeparatorEx(ImGuiSeparatorFlags_Horizontal); ImGui::SeparatorEx(ImGuiSeparatorFlags_Horizontal);
if (!ImGui::IsAnyItemFocused())
{
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_A)) if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_A))
{ {
SelectAllEntities(); SelectAllEntities();
@ -119,7 +121,7 @@ namespace SHADE
{ {
DeleteSelectedEntities(); DeleteSelectedEntities();
} }
}
} }
if(ImGui::IsWindowHovered() && !ImGui::IsAnyItemHovered() && ImGui::IsMouseReleased(ImGuiMouseButton_Left)) if(ImGui::IsWindowHovered() && !ImGui::IsAnyItemHovered() && ImGui::IsMouseReleased(ImGuiMouseButton_Left))
{ {