X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcontrol.cpp;h=823202d3e11544ea2c45d1c0a54c8ce807f85d6a;hb=77d8b98374ab07be0d14c9c88502c6a803041040;hp=ef1170cc84b66b42bb8ac0659e97adf1a8f978b6;hpb=61eeb96535d1575ca0cf698d833c0ddfc7ae0f50;p=libs%2Fgui.git diff --git a/source/control.cpp b/source/control.cpp index ef1170c..823202d 100644 --- a/source/control.cpp +++ b/source/control.cpp @@ -6,6 +6,7 @@ Distributed under the LGPL */ #include +#include #include "control.h" #include "inputdevice.h" @@ -24,6 +25,18 @@ ControlSource::ControlSource(Device &d, ControlSrcType t, unsigned i): index(i) { } +std::string ControlSource::str() const +{ + if(type==BUTTON) + return dev->get_button_name(index); + else if(type==AXIS_POS || type==AXIS_NEG) + return dev->get_axis_name(index); + else if(type==NONE) + return "None"; + + return lexical_cast(index); +} + Control::Control(): capture_dev(0)