The Input Mixer

The second version of the Remote Input Manager, introduced in mid-2002, implemented input distribution by sharing devices rather than proxies, as done in the original version [Ols92]. This refactoring has changed the class hierarchy for device drivers. Previously, classes such as gadget::Digital and gadget::Position derived from gadget::Input, and device drivers used multiple inheritance to derive from one or more of gadget::Analog, gadget::Digital, etc.

With the introduction of gadget::InputMixer<S, T>, device drivers now derive from this single template class. More information will be given in Chapter 5, Writing Device Drivers, but as an example, consider a driver for a positional device. In VR Juggler 1.0 and in early versions of Gadgeteer, such a driver class would have derived from gadget::Position. Now, it would derive from gadget::InputMixer<gadget::Input, gadget::Position>. Use of gadget::InputMixer<S, T> is required if a device is to be used with the Remote Input Manager. If the old class hierarchy is used (which is still allowed), the device cannot be shared between computers.

Note

As of this writing, the Input Mixer is not expected to be a long-term solution. A future version of Gadgeteer may do away with gadget::InputMixer<S, T>, and as such, driver authors should be aware of potential API changes in the future.