]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/control.cpp
Allow event handling to be interrupted
[libs/gui.git] / source / input / control.cpp
index f3f1919d45815535561932e99c7d23b29b59b16d..18c2ffd62a1d055394e3a2df1d5929d9dd1f227a 100644 (file)
@@ -1,3 +1,4 @@
+#include <sigc++/bind_return.h>
 #include <msp/strings/lexicalcast.h>
 #include "control.h"
 #include "device.h"
@@ -54,8 +55,8 @@ void Control::capture(Device &d)
 {
        notify_callbacks();
        capture_dev = &d;
-       capture_dev->signal_button_press.connect(sigc::mem_fun(this, &Control::button_press));
-       capture_dev->signal_axis_motion.connect(sigc::mem_fun(this, &Control::axis_motion));
+       capture_dev->signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Control::button_press), false));
+       capture_dev->signal_axis_motion.connect(sigc::bind_return(sigc::mem_fun(this, &Control::axis_motion), false));
 }
 
 void Control::cancel_capture()
@@ -84,12 +85,12 @@ void Control::connect_signals()
        case NONE:
                break;
        case BUTTON:
-               src.dev->signal_button_press.connect(sigc::mem_fun(this, &Control::button_press));
-               src.dev->signal_button_release.connect(sigc::mem_fun(this, &Control::button_release));
+               src.dev->signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Control::button_press), false));
+               src.dev->signal_button_release.connect(sigc::bind_return(sigc::mem_fun(this, &Control::button_release), false));
                break;
        case AXIS_POS:
        case AXIS_NEG:
-               src.dev->signal_axis_motion.connect(sigc::mem_fun(this, &Control::axis_motion));
+               src.dev->signal_axis_motion.connect(sigc::bind_return(sigc::mem_fun(this, &Control::axis_motion), false));
                break;
        }
 }