[Plib-devel] Re: WIN32 USB joystick name problem - possible fix [was: Joystick documentation proble
Brought to you by:
sjbaker
|
From: Julian F. <jul...@bt...> - 2002-09-07 15:36:40
|
Sebastian Ude wrote (to flightgear-devel): > > I found the following code in the MSDN database: ... > What do you think about it ? Bingo! Thank you for finding this. It works under CygWin, so I hope it will work under all versions of Windows, both under CygWin and natively (MSVC). I believe there are combinations of Windows version and joystick type for which the existing method works. A big question for people to investigate is: does this new method report the same name? For my joystick it gives "Saitek Cyborg 3D Stick USB" which isn't the same as the (Linux?) name in $FG_BASE/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml: <name>SAITEK CYBORG 3D USB</name> but it is easy to add both names. Maybe my joystick is a slightly different model, or maybe this is still not _the_ name obtained from the hardware. This difference is a little worrying, but it is still infinitely better than the plain default driver name that we were getting. I was thinking about putting it into the new js.cxx, but I suppose we should keep that clean for a few months (until the next release) to give people time to update their old apps to include the new library. So I'll dump it into js.h for now. Patch attached. Perhaps you would check it in so that people can try it out and decide whether it's good enough. I corrected the max-name-length handling in the example code that you sent (from Microsoft?), but otherwise left it as it is. - Julian |