1 #include <sigc++/bind.h>
7 unsigned Hub::attach(Device &dev)
9 unsigned index=devices.size();
10 devices.push_back(&dev);
11 dev.signal_button_press.connect(sigc::bind(sigc::mem_fun(this, &Hub::button_press), index));
12 dev.signal_button_release.connect(sigc::bind(sigc::mem_fun(this, &Hub::button_release), index));
13 dev.signal_axis_motion.connect(sigc::bind(sigc::mem_fun(this, &Hub::axis_motion), index));
17 void Hub::button_press(unsigned btn, unsigned index)
19 set_button_state(index<<8 | btn&0xFF, true, true);
22 void Hub::button_release(unsigned btn, unsigned index)
24 set_button_state(index<<8 | btn&0xFF, false, true);
27 void Hub::axis_motion(unsigned axis, float value, float, unsigned index)
29 set_axis_value(index<<8 | axis&0xFF, value, true);