Mixer: Fix issue with meter module eating ctrl+left click event.
This commit is contained in:
parent
9b634cf001
commit
6d7a71636a
|
@ -31,8 +31,10 @@ test_press ( unsigned long e )
|
||||||
if ( Fl::event_text()[0] )
|
if ( Fl::event_text()[0] )
|
||||||
((char *)Fl::event_text())[0] = '\0';
|
((char *)Fl::event_text())[0] = '\0';
|
||||||
|
|
||||||
if ( ! ( e & FL_SHIFT ) )
|
const int mod_mask = FL_SHIFT | FL_ALT | FL_CTRL;
|
||||||
return Fl::test_shortcut( e ) && ! Fl::event_shift();
|
|
||||||
|
if ( ( e & mod_mask ) != ( Fl::event_state() & mod_mask ) )
|
||||||
|
return false;
|
||||||
else
|
else
|
||||||
return Fl::test_shortcut( e );
|
return Fl::test_shortcut( e );
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
#include <FL/Fl_Widget.H>
|
#include <FL/Fl_Widget.H>
|
||||||
#include <FL/Fl_Valuator.H>
|
#include <FL/Fl_Valuator.H>
|
||||||
|
#include "FL/test_press.H"
|
||||||
|
|
||||||
class Meter : public Fl_Valuator
|
class Meter : public Fl_Valuator
|
||||||
{
|
{
|
||||||
|
@ -37,7 +38,7 @@ protected:
|
||||||
{
|
{
|
||||||
if ( m == FL_ENTER || m == FL_LEAVE )
|
if ( m == FL_ENTER || m == FL_LEAVE )
|
||||||
return 1;
|
return 1;
|
||||||
else if ( m == FL_PUSH && Fl::event_button1())
|
else if ( m == FL_PUSH && test_press( FL_BUTTON1 ))
|
||||||
{
|
{
|
||||||
reset();
|
reset();
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -197,7 +197,7 @@ Meter_Indicator_Module::handle ( int m )
|
||||||
if ( Fl::event_button3() && _disable_context_menu )
|
if ( Fl::event_button3() && _disable_context_menu )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( Fl::event_button1() )
|
if ( test_press( FL_BUTTON1 ) )
|
||||||
{
|
{
|
||||||
/* don't let Module::handle eat our click */
|
/* don't let Module::handle eat our click */
|
||||||
return Fl_Group::handle( m );
|
return Fl_Group::handle( m );
|
||||||
|
|
|
@ -150,12 +150,13 @@ Meter_Module::handle ( int m )
|
||||||
{
|
{
|
||||||
case FL_PUSH:
|
case FL_PUSH:
|
||||||
{
|
{
|
||||||
|
int r = 0;
|
||||||
if ( test_press( FL_BUTTON1 ) )
|
if ( test_press( FL_BUTTON1 ) )
|
||||||
{
|
{
|
||||||
/* don't let Module::handle eat our click */
|
/* don't let Module::handle eat our click */
|
||||||
return Fl_Group::handle( m );
|
r = Fl_Group::handle( m );
|
||||||
}
|
}
|
||||||
return Module::handle( m );
|
return Module::handle( m ) || r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue