X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fhub.h;h=1abff37a18cc52cc10b6fa20db170f79a91c3a3b;hb=479298192e3e5b71a402f79520c90372a4c4b504;hp=8ec2fad7fcb3dd60af82a5f6dbab52c28a7571c3;hpb=1023b38fa278cea71fba3d2881e1bfde930cd025;p=libs%2Fgui.git diff --git a/source/input/hub.h b/source/input/hub.h index 8ec2fad..1abff37 100644 --- a/source/input/hub.h +++ b/source/input/hub.h @@ -1,6 +1,8 @@ #ifndef MSP_INPUT_INPUTHUB_H_ #define MSP_INPUT_INPUTHUB_H_ +#include +#include #include "device.h" namespace Msp { @@ -10,7 +12,7 @@ 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 +class Hub: public Device, public sigc::trackable { protected: std::vector devices; @@ -18,12 +20,14 @@ protected: public: Hub(); - /** Attaches an input device to the hub. Returns the index of the device - within the hub. */ - unsigned attach(Device &dev); + /// Attaches an input device to the hub. + void attach(Device &dev); - virtual std::string get_button_name(unsigned) const; - virtual std::string get_axis_name(unsigned) const; + Device *find_subdevice(DeviceType, unsigned = 0) override; + Device *find_subdevice(const std::string &) override; + + std::string get_button_name(unsigned) const override; + std::string get_axis_name(unsigned) const override; protected: void button_press(unsigned, unsigned); void button_release(unsigned, unsigned);