Skip to content

Commit

Permalink
only handle delete key is window is focused
Browse files Browse the repository at this point in the history
  • Loading branch information
sphaero authored and rokups committed Nov 23, 2021
1 parent 5815253 commit 26c6dbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void ShowDemoWindow(bool*)
// Node rendering is done. This call will render node background based on size of content inside node.
ImNodes::Ez::EndNode();

if (node->Selected && ImGui::IsKeyPressedMap(ImGuiKey_Delete))
if (node->Selected && ImGui::IsKeyPressedMap(ImGuiKey_Delete) && ImGui::IsWindowFocused())
{
// Deletion order is critical: first we delete connections to us
for (auto& connection : node->Connections)
Expand Down

0 comments on commit 26c6dbc

Please sign in to comment.