From 682aab8b23c2227e2266220ac2d7a41fbf51eff2 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 26 Jun 2024 19:13:42 +0200 Subject: [PATCH] feat: Allow faster hex editor scrolling by holding down CTRL or SHIFT + CTRL --- plugins/ui/source/ui/hex_editor.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/ui/source/ui/hex_editor.cpp b/plugins/ui/source/ui/hex_editor.cpp index 3136e3199..6f759e907 100644 --- a/plugins/ui/source/ui/hex_editor.cpp +++ b/plugins/ui/source/ui/hex_editor.cpp @@ -187,7 +187,15 @@ namespace hex::ui { this->drawMinimap(characterSize); if (ImGui::IsWindowHovered()) { - m_scrollPosition += ImS64(ImGui::GetIO().MouseWheel * -5); + float scrollMultiplier; + if (ImGui::GetIO().KeyCtrl && ImGui::GetIO().KeyShift) + scrollMultiplier = m_visibleRowCount * 10.0F; + else if (ImGui::GetIO().KeyCtrl) + scrollMultiplier = m_visibleRowCount; + else + scrollMultiplier = 5; + + m_scrollPosition += ImS64(ImGui::GetIO().MouseWheel * -scrollMultiplier); } if (m_scrollPosition < 0)