]> git.tdb.fi Git - libs/gui.git/blobdiff - source/inputhub.h
Add input hub
[libs/gui.git] / source / inputhub.h
index 1d4b465dfce5180c328a8b6d9658ddf7cf6a491b..b20fd43468fffc093d03e043bbc4d105d6fe60e3 100644 (file)
@@ -13,8 +13,28 @@ Distributed under the LGPL
 namespace Msp {
 namespace Input {
 
+/**
+The Hub device collects events from multiple input devices and presents an
+aggregate of them.  Button and axis numbers are mapped to unique values.
+*/
 class Hub: public Device
 {
+protected:
+       std::vector<Device *> devices;
+
+public:
+       /**
+       Attaches an input device to the hub.
+
+       @param   dev  Device to attach
+
+       @return  Index of the device within the hub
+       */
+       unsigned attach(Device &dev);
+protected:
+       void button_press(unsigned, unsigned);
+       void button_release(unsigned, unsigned);
+       void axis_motion(unsigned, float, float, unsigned);
 };
 
 } // namespace Input