Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final Wheel Support for ModButton #1020

Merged
merged 1 commit into from
Aug 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/common/gui/CModulationSourceButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down