zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 40f2fd8feb54a98eefc0725146b4dc668e8862df
parent 7b564cdf8fd494e7fc2b20bb75253c8e194730c3
Author: fundamental <[email protected]>
Date:   Tue, 24 Feb 2015 19:14:20 -0500

UI: Add Alternative MIDI Learn Combo

Diffstat:
Msrc/UI/Fl_Osc_Dial.cpp | 4+++-
Msrc/UI/Fl_Osc_Slider.cpp | 4+++-
Msrc/UI/Fl_Osc_VSlider.cpp | 4+++-
3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/UI/Fl_Osc_Dial.cpp b/src/UI/Fl_Osc_Dial.cpp @@ -62,7 +62,9 @@ void Fl_Osc_Dial::callback(Fl_Callback *cb, void *p) int Fl_Osc_Dial::handle(int ev) { - if(ev == FL_PUSH && Fl::event_state(FL_BUTTON2)) { + bool middle_mouse = (ev == FL_PUSH && Fl::event_state(FL_BUTTON2)); + bool ctl_click = (ev == FL_PUSH && Fl::event_state(FL_BUTTON1) && Fl::event_ctrl()); + if(middle_mouse || ctl_click) { printf("Trying to learn...\n"); osc->write("/learn", "s", (loc+ext).c_str()); return 1; diff --git a/src/UI/Fl_Osc_Slider.cpp b/src/UI/Fl_Osc_Slider.cpp @@ -74,7 +74,9 @@ void Fl_Osc_Slider::callback(Fl_Callback *cb, void *p) int Fl_Osc_Slider::handle(int ev) { - if(ev == FL_PUSH && Fl::event_state(FL_BUTTON2)) { + bool middle_mouse = (ev == FL_PUSH && Fl::event_state(FL_BUTTON2)); + bool ctl_click = (ev == FL_PUSH && Fl::event_state(FL_BUTTON1) && Fl::event_ctrl()); + if(middle_mouse || ctl_click) { printf("Trying to learn...\n"); osc->write("/learn", "s", (loc+ext).c_str()); return 1; diff --git a/src/UI/Fl_Osc_VSlider.cpp b/src/UI/Fl_Osc_VSlider.cpp @@ -65,7 +65,9 @@ void Fl_Osc_VSlider::callback(Fl_Callback *cb, void *p) int Fl_Osc_VSlider::handle(int ev) { - if(ev == FL_PUSH && Fl::event_state(FL_BUTTON2)) { + bool middle_mouse = (ev == FL_PUSH && Fl::event_state(FL_BUTTON2)); + bool ctl_click = (ev == FL_PUSH && Fl::event_state(FL_BUTTON1) && Fl::event_ctrl()); + if(middle_mouse || ctl_click) { printf("Trying to learn...\n"); osc->write("/learn", "s", (loc+ext).c_str()); return 1;