mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -05:00
impr: Allow Esc to clear editing and selected state in data inspector
(cherry picked from commit 77b9e3eac8)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user