X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finputhub.h;h=b20fd43468fffc093d03e043bbc4d105d6fe60e3;hb=4d297f94791ef51e574c1345e8dcc5a15aee2149;hp=1d4b465dfce5180c328a8b6d9658ddf7cf6a491b;hpb=d39a783c839c08be8ac36a040f4f8b2ee0da8d56;p=libs%2Fgui.git diff --git a/source/inputhub.h b/source/inputhub.h index 1d4b465..b20fd43 100644 --- a/source/inputhub.h +++ b/source/inputhub.h @@ -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 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