Use up and down arrows to adjust brightness.

Polarity is now the right way.
This commit is contained in:
2026-06-17 13:29:37 -04:00
parent 9fca970fc5
commit 0330d212e6
+22
View File
@@ -46,6 +46,28 @@ class MouseWheelSlider : public Fl_Value_Slider
} }
break; break;
case FL_KEYBOARD:
{
const auto key= Fl::event_key();
if( key != FL_Down and key != FL_Up )
{
return this->Fl_Value_Slider::handle( event );
}
const int polarity= Fl::event_key() == FL_Down ? +1 : -1;
const int newVal= value() + polarity * step();
if( newVal >= maximum()
and newVal <= minimum() )
{
value( newVal );
}
do_callback();
return 1;
}
break;
default: default:
{ {
return this->Fl_Value_Slider::handle( event ); return this->Fl_Value_Slider::handle( event );