From df901348da31db27c5bcdc9eb4631edd4b9cc4f4 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 12 Aug 2019 22:23:41 -0400 Subject: [PATCH] Final Wheel Support for ModButton (#1020) The ModButton wheel on windows was too slow; speed it up. While I'm in there support shift-wheel also just for completeness. Closes #1008 --- src/common/gui/CModulationSourceButton.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/common/gui/CModulationSourceButton.cpp b/src/common/gui/CModulationSourceButton.cpp index cffe5956669..a8d1072dfc4 100644 --- a/src/common/gui/CModulationSourceButton.cpp +++ b/src/common/gui/CModulationSourceButton.cpp @@ -345,7 +345,20 @@ double CModulationSourceButton::getMouseDeltaScaling(CPoint& where, const CButto bool CModulationSourceButton::onWheel(const VSTGUI::CPoint& where, const float &distance, const VSTGUI::CButtonState& buttons) { - value += distance / (double)(getWidth()); + auto rate = 1.f; + +#if WINDOWS + // This is purely empirical. The wheel for this control feels slow on windows + // but fine on a macos trackpad. I callibrated it by making sure the trackpad + // across the pad gesture on my macbook pro moved the control the same amount + // in surge mac as it does in vst3 bitwig in parallels. + rate = 10.f; +#endif + + if( buttons & kShift ) + rate *= 0.05; + + value += rate * distance / (double)(getWidth()); value = limit_range(value, 0.f, 1.f); event_is_drag = true; invalid();