Use up and down arrows to adjust brightness.
Polarity is now the right way.
This commit is contained in:
@@ -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 );
|
||||||
|
|||||||
Reference in New Issue
Block a user