3 This file is part of libmspgbase
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GBASE_INPUTDEVICE_H_
9 #define MSP_GBASE_INPUTDEVICE_H_
13 #include <sigc++/signal.h>
19 Base class for input devices. Input devices have two types of controls:
20 buttons and axes. Buttons are either on or off. Axes have a floating-point
21 value, with range depending on the device.
26 sigc::signal<void, unsigned> signal_button_press;
27 sigc::signal<void, unsigned> signal_button_release;
28 sigc::signal<void, unsigned, float, float> signal_axis_motion;
32 std::vector<char> buttons;
33 std::vector<float> axes;
40 const std::string &get_name() const { return name; }
41 bool get_button_state(unsigned) const;
42 float get_axis_value(unsigned) const;
43 float get_axis_threshold() const { return axis_threshold; }
45 virtual std::string get_button_name(unsigned) const;
46 virtual std::string get_axis_name(unsigned) const;
48 void set_button_state(unsigned, bool, bool);
49 void set_axis_value(unsigned, float, bool);