Skip to content

Commit 451c1ea

Browse files
committed
Revert "- Fixup ImGui::GetKeyIndex usage"
This reverts commit 3b1441e.
1 parent 8ee25d0 commit 451c1ea

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

libs/node_editor/imgui_node_editor.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4391,16 +4391,15 @@ ed::EditorAction::AcceptResult ed::ShortcutAction::Accept(const Control& control
43914391
Action candidateAction = None;
43924392

43934393
auto& io = ImGui::GetIO();
4394-
// FIX(zig-gamedev): ImGui::GetKeyIndex was removed from imgui since imgui-node-editor v0.9.3 was released.
4395-
if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_X))
4394+
if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_X)))
43964395
candidateAction = Cut;
4397-
if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_C))
4396+
if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_C)))
43984397
candidateAction = Copy;
4399-
if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_V))
4398+
if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_V)))
44004399
candidateAction = Paste;
44014400
if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(GetKeyIndexForD()))
44024401
candidateAction = Duplicate;
4403-
if (!io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_Space))
4402+
if (!io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space)))
44044403
candidateAction = CreateNode;
44054404

44064405
if (candidateAction != None)
@@ -4954,8 +4953,7 @@ ed::EditorAction::AcceptResult ed::DeleteItemsAction::Accept(const Control& cont
49544953
return False;
49554954

49564955
auto& io = ImGui::GetIO();
4957-
// FIX(zig-gamedev): ImGui::GetKeyIndex was removed from imgui since imgui-node-editor v0.9.3 was released.
4958-
if (Editor->CanAcceptUserInput() && ImGui::IsKeyPressed(ImGuiKey_Delete) && Editor->AreShortcutsEnabled())
4956+
if (Editor->CanAcceptUserInput() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Delete)) && Editor->AreShortcutsEnabled())
49594957
{
49604958
auto& selection = Editor->GetSelectedObjects();
49614959
if (!selection.empty())

0 commit comments

Comments
 (0)