X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fgtkmm2ext%2Fbinding_proxy.cc;h=bf21c19bce983532aa575dd18bd57a814b581bd5;hb=61e851da0841190b5f45944a0aa5395cae07a269;hp=c56ab8598246e96115b0ae20a25a575d9089a0da;hpb=5cf1f7f3b28abd36f9390014016def94f4e1468d;p=ardour.git diff --git a/libs/gtkmm2ext/binding_proxy.cc b/libs/gtkmm2ext/binding_proxy.cc index c56ab85982..bf21c19bce 100644 --- a/libs/gtkmm2ext/binding_proxy.cc +++ b/libs/gtkmm2ext/binding_proxy.cc @@ -31,20 +31,17 @@ using namespace Gtkmm2ext; using namespace std; using namespace PBD; +guint BindingProxy::bind_button = 2; +guint BindingProxy::bind_statemask = Gdk::CONTROL_MASK; + BindingProxy::BindingProxy (boost::shared_ptr c) : prompter (0), - controllable (c), - bind_button (2), - bind_statemask (Gdk::CONTROL_MASK) - + controllable (c) { } BindingProxy::BindingProxy () - : prompter (0), - bind_button (2), - bind_statemask (Gdk::CONTROL_MASK) - + : prompter (0) { } @@ -69,17 +66,17 @@ BindingProxy::set_bind_button_state (guint button, guint statemask) bind_statemask = statemask; } -void -BindingProxy::get_bind_button_state (guint &button, guint &statemask) +bool +BindingProxy::is_bind_action (GdkEventButton *ev) { - button = bind_button; - statemask = bind_statemask; + return ( (ev->state & bind_statemask) && ev->button == bind_button ); } + bool BindingProxy::button_press_handler (GdkEventButton *ev) { - if (controllable && (ev->state & bind_statemask) && ev->button == bind_button) { + if ( controllable && is_bind_action(ev) ) { if (Controllable::StartLearning (controllable.get())) { string prompt = _("operate controller now"); if (prompter == 0) {