impr: Allow Esc to clear editing and selected state in data inspector

(cherry picked from commit 77b9e3eac8)
This commit is contained in:
WerWolv 2025-12-07 20:58:17 +01:00
parent 59afa06bf4
commit d8e54e535b
1 changed files with 8 additions and 0 deletions

View File

@ -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);