namespace Msp {
namespace Input {
-Hub::Hub()
+Hub::Hub():
+ Device(UNSPECIFIED)
{
name = "Hub";
}
dev.signal_axis_motion.connect(sigc::bind_return(sigc::bind(sigc::mem_fun(this, &Hub::axis_motion), index), false));
}
+Device *Hub::find_subdevice(DeviceType t, unsigned n)
+{
+ for(vector<Device *>::const_iterator i=devices.begin(); i!=devices.end(); ++i)
+ if(Device *dev = (*i)->find_subdevice(t, 0))
+ {
+ if(!n)
+ return dev;
+ --n;
+ }
+ return 0;
+}
+
+Device *Hub::find_subdevice(const string &n)
+{
+ if(n==name)
+ return this;
+ for(vector<Device *>::const_iterator i=devices.begin(); i!=devices.end(); ++i)
+ if(Device *dev = (*i)->find_subdevice(n))
+ return dev;
+ return 0;
+}
+
std::string Hub::get_button_name(unsigned btn) const
{
unsigned dev_index = btn>>8;