The attached patch adds xinput support for pyglet (X windows only). It
allows one to manipulate 3D scenes with, for example, a 3Dconnection
Space Navigator[1] when it is configured as an XInput device[2] on
GNU/linux or other Xorg systems.
[1] http://www.3dconnexion.com/
[2] http://www.fedorawiki.de/index.php/SpaceNavigator (in German)
I believe that the patch supports all 6 DOF and 2 buttons of the Space
Navigator device in a way which should generalize to other XInput
devices. There is more that XInput is capable of doing than I have
implemented, simply because I do not have devices to use for these
functions.
As noted in the source code, this patch is licensed under the BSD
license, and is thus suitable for inclusion in pyglet from that
standpoint. This is, however, completely non-cross-platform, so there
are other issues from that perspective.
Anyhow, I hope this is useful or fun for someone.
-Andrew