]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/device.h
Add a type enumeration for devices
[libs/gui.git] / source / input / device.h
index b42ed3fde4991feb8d87b05258831585db57efec..be708e2636a2ae88010c5d9ba79a31b0abf2835b 100644 (file)
@@ -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<bool, unsigned, float, float>::accumulated<EventAccumulator> signal_axis_motion;
 
 protected:
+       DeviceType type;
        std::string name;
        std::vector<char> buttons;
        std::vector<float> 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;