Skip to content

Commit ce7bb80

Browse files
Updated to fix imgui breaking backwards comp: ocornut/imgui#4921
1 parent 05c7546 commit ce7bb80

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

example/color_node_editor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include <imnodes.h>
55
#include <imgui.h>
66

7-
#include <SDL2/SDL_keycode.h>
8-
#include <SDL2/SDL_timer.h>
7+
#include <SDL_keycode.h>
8+
#include <SDL_timer.h>
99
#include <algorithm>
1010
#include <cassert>
1111
#include <chrono>
@@ -207,7 +207,7 @@ class ColorNodeEditor
207207
{
208208
const bool open_popup = ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) &&
209209
ImNodes::IsEditorHovered() &&
210-
ImGui::IsKeyReleased(SDL_SCANCODE_A);
210+
ImGui::IsKeyReleased(ImGuiKey_A);
211211

212212
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8.f, 8.f));
213213
if (!ImGui::IsAnyItemHovered() && open_popup)
@@ -588,7 +588,7 @@ class ColorNodeEditor
588588

589589
{
590590
const int num_selected = ImNodes::NumSelectedLinks();
591-
if (num_selected > 0 && ImGui::IsKeyReleased(SDL_SCANCODE_X))
591+
if (num_selected > 0 && ImGui::IsKeyReleased(ImGuiKey_X))
592592
{
593593
static std::vector<int> selected_links;
594594
selected_links.resize(static_cast<size_t>(num_selected));
@@ -602,7 +602,7 @@ class ColorNodeEditor
602602

603603
{
604604
const int num_selected = ImNodes::NumSelectedNodes();
605-
if (num_selected > 0 && ImGui::IsKeyReleased(SDL_SCANCODE_X))
605+
if (num_selected > 0 && ImGui::IsKeyReleased(ImGuiKey_X))
606606
{
607607
static std::vector<int> selected_nodes;
608608
selected_nodes.resize(static_cast<size_t>(num_selected));

example/save_load.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SaveLoadEditor
4747
ImNodes::BeginNodeEditor();
4848

4949
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) &&
50-
ImNodes::IsEditorHovered() && ImGui::IsKeyReleased(SDL_SCANCODE_A))
50+
ImNodes::IsEditorHovered() && ImGui::IsKeyReleased(ImGuiKey_A))
5151
{
5252
const int node_id = ++current_id_;
5353
ImNodes::SetNodeScreenSpacePos(node_id, ImGui::GetMousePos());

0 commit comments

Comments
 (0)