From: Ulrich Eckhardt Date: Mon, 15 Dec 2025 13:41:37 +0100 Subject: allows using the mousewheel to increase/decrease the volume Last-Update: 2010-08-07 Bug-Debian: https://bugs.debian.org/592075 --- src/Fl_AM.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Fl_AM.cxx b/src/Fl_AM.cxx index ca92008..843b6be 100644 --- a/src/Fl_AM.cxx +++ b/src/Fl_AM.cxx @@ -384,6 +384,28 @@ public: } int handle(int e) { + switch(e) { + case FL_MOUSEWHEEL: + { + if(!Fl::event_inside(this)) + break; + Fl_AMGroup* g = (Fl_AMGroup*) this->parent(); + mixer_focus_elem = g->elem_id; + double new_value = increment(value(), Fl::event_dy()); + if (this==g->volumeL || g->lock->value()) { + g->volumeL->value(new_value); + mixer_volume_hard[MIXER_CHN_LEFT] = new_value; + } + if (this==g->volumeR || g->lock->value()) { + g->volumeR->value(new_value); + mixer_volume_hard[MIXER_CHN_RIGHT] = new_value; + } + gui_update(); + return 1; + } + default: + break; + } return Fl_Slider::handle(e); } };