From d8e54e535b6e0c0cf12c54dee3ce6f4533dd1ae0 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 7 Dec 2025 20:58:17 +0100 Subject: [PATCH] impr: Allow Esc to clear editing and selected state in data inspector (cherry picked from commit 77b9e3eac86c8c9eadeb7093092b7146bc2ef693) --- .../builtin/source/content/views/view_data_inspector.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/builtin/source/content/views/view_data_inspector.cpp b/plugins/builtin/source/content/views/view_data_inspector.cpp index 683479184..7822e00fc 100644 --- a/plugins/builtin/source/content/views/view_data_inspector.cpp +++ b/plugins/builtin/source/content/views/view_data_inspector.cpp @@ -433,6 +433,10 @@ namespace hex::plugin::builtin { ImGui::SameLine(); + if (ImGui::IsKeyPressed(ImGuiKey_Escape)) { + m_selectedEntryName.reset(); + } + // Handle copying the value to the clipboard when clicking the row if (ImGui::Selectable("##InspectorLine", m_selectedEntryName == entry.unlocalizedName, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap)) { m_selectedEntryName = entry.unlocalizedName; @@ -469,6 +473,10 @@ namespace hex::plugin::builtin { return; } + if (ImGui::IsKeyPressed(ImGuiKey_Escape)) { + entry.editing = false; + } + // Handle editing mode ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); ImGui::SetNextItemWidth(-1);