X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fdevice.h;h=be708e2636a2ae88010c5d9ba79a31b0abf2835b;hb=75a3f0fd4152a71aefec72cb053846646071af03;hp=b42ed3fde4991feb8d87b05258831585db57efec;hpb=f01fa56a13100ed04c94c9d8b17fbdcf0f0a8bad;p=libs%2Fgui.git diff --git a/source/input/device.h b/source/input/device.h index b42ed3f..be708e2 100644 --- a/source/input/device.h +++ b/source/input/device.h @@ -17,6 +17,16 @@ public: }; +enum DeviceType +{ + UNSPECIFIED, + KEYBOARD, + MOUSE, + TOUCH_SURFACE, + GAME_CONTROLLER +}; + + /** Base class for input devices. Input devices have two types of controls: buttons and axes. Buttons are either on or off. Axes have a floating point @@ -47,14 +57,16 @@ public: sigc::signal::accumulated signal_axis_motion; protected: + DeviceType type; std::string name; std::vector buttons; std::vector axes; - Device(); + Device(DeviceType); public: virtual ~Device(); + DeviceType get_type() const { return type; } const std::string &get_name() const { return name; } bool get_button_state(unsigned) const; float get_axis_value(unsigned) const;