X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fcontrol.cpp;h=6ff80883f8d39d8df19892b9fd2cf114aac7cc4a;hb=c9626e6953c16efc66575eff80c4c0de2f739041;hp=0519d8fe42117a1f7304a3daa30fbefbce787f6d;hpb=b453da0696b24cc02a7fcf5127afcd7baef9c801;p=libs%2Fgui.git diff --git a/source/input/control.cpp b/source/input/control.cpp index 0519d8f..6ff8088 100644 --- a/source/input/control.cpp +++ b/source/input/control.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspgbase -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #include #include "control.h" @@ -29,8 +22,10 @@ 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==AXIS_POS) + return dev->get_axis_name(index)+" +"; + else if(type==AXIS_NEG) + return dev->get_axis_name(index)+" -"; else if(type==NONE) return "None"; @@ -54,24 +49,6 @@ Control::Control(Device &d, ControlSrcType t, unsigned i): connect_signals(); } -Control::Control(const Control &c): - trackable(c), - src(c.src), - capture_dev(0) -{ - connect_signals(); -} - -Control &Control::operator=(const Control &c) -{ - notify_callbacks(); - src=c.src; - capture_dev=0; - connect_signals(); - - return *this; -} - void Control::capture(Device &d) { notify_callbacks(); @@ -146,9 +123,9 @@ void Control::axis_motion(unsigned i, float v, float r) if(capture_dev) { ControlSrcType type=NONE; - if(v<-src.dev->get_axis_threshold()) + if(v<-0.9) type=AXIS_NEG; - else if(v>src.dev->get_axis_threshold()) + else if(v>0.9) type=AXIS_POS; if(type!=NONE)