X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fcontrol.cpp;h=50601013acacc985ab256c018693a7f4dc6317ae;hb=c430f2d7498e9c2daa515ee9aba3a95257e5e999;hp=565d5c3242a35fc968e1efc60443f8f131c66b4a;hpb=821cea8627597a5458c1cb02c0652384bb3431a4;p=libs%2Fgui.git diff --git a/source/input/control.cpp b/source/input/control.cpp index 565d5c3..5060101 100644 --- a/source/input/control.cpp +++ b/source/input/control.cpp @@ -1,8 +1,10 @@ -#include +#include #include #include "control.h" #include "device.h" +using namespace std; + namespace Msp { namespace Input { @@ -29,7 +31,7 @@ std::string ControlSource::str() const else if(type==NONE) return "None"; - return lexical_cast(index); + return lexical_cast(index); } @@ -49,12 +51,15 @@ Control::Control(Device &d, ControlSrcType t, unsigned i): connect_signals(); } +Control::~Control() +{ } + 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() @@ -83,15 +88,13 @@ 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; - default: - throw Exception("Invalid source in Control"); } }