1 #ifndef MSP_INPUT_INPUTHUB_H_
2 #define MSP_INPUT_INPUTHUB_H_
5 #include <sigc++/trackable.h>
6 #include <msp/graphics/mspgui_api.h>
13 The Hub device collects events from multiple input devices and presents an
14 aggregate of them. Button and axis numbers are mapped to unique values.
16 class MSPGUI_API Hub: public Device, public sigc::trackable
19 std::vector<Device *> devices;
24 /// Attaches an input device to the hub.
25 void attach(Device &dev);
27 Device *find_subdevice(DeviceType, unsigned = 0) override;
28 Device *find_subdevice(const std::string &) override;
30 std::string get_button_name(unsigned) const override;
31 std::string get_axis_name(unsigned) const override;
33 void button_press(unsigned, unsigned);
34 void button_release(unsigned, unsigned);
35 void axis_motion(unsigned, float, float, unsigned);