From 78daed7879d3ff785bc5c4f70dbc7fc6b961bd94 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 11 Oct 2023 21:50:23 +0200 Subject: [PATCH] Implemented #1205 --- core/src/gui/main_window.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 93e90469..8c90ebd6 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -574,10 +574,22 @@ void MainWindow::draw() { // Handle scrollwheel int wheel = ImGui::GetIO().MouseWheel; if (wheel != 0 && (gui::waterfall.mouseInFFT || gui::waterfall.mouseInWaterfall)) { + // Select factor depending on modifier keys + double interval; + if (ImGui::IsKeyDown(ImGuiKey_LeftShift)) { + interval = vfo->snapInterval * 10.0; + } + else if (ImGui::IsKeyDown(ImGuiKey_LeftAlt)) { + interval = vfo->snapInterval * 0.1; + } + else { + interval = vfo->snapInterval; + } + double nfreq; if (vfo != NULL) { - nfreq = gui::waterfall.getCenterFrequency() + vfo->generalOffset + (vfo->snapInterval * wheel); - nfreq = roundl(nfreq / vfo->snapInterval) * vfo->snapInterval; + nfreq = gui::waterfall.getCenterFrequency() + vfo->generalOffset + (interval * wheel); + nfreq = roundl(nfreq / interval) * interval; } else { nfreq = gui::waterfall.getCenterFrequency() - (gui::waterfall.getViewBandwidth() * wheel / 20.0);