3 This file is part of libmspgbase
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GBASE_BINARYCONTROL_H_
9 #define MSP_GBASE_BINARYCONTROL_H_
17 A control with two possible states. Button state is mapped directly. An axis
18 is considered to be active when its value is within 10% of the end of the axis.
20 class BinaryControl: public Control
23 sigc::signal<void> signal_press;
24 sigc::signal<void> signal_release;
32 BinaryControl(const ControlSource &);
33 BinaryControl(Device &, ControlSrcType, unsigned);
36 Sets the threshold between states for axis sources. No effect on button
39 void set_threshold(float);
41 bool get_state() const { return state; }
44 virtual void on_press();
45 virtual void on_release();
46 virtual void on_motion(float, float);