August 23, 200916 yr HelloI have two joysticks attached to my system and would like to map an event (lets assume "gear down") to one of its buttons.Now, i know that there are several possibilities for that: for a "simple" event like this "gear down" you can simply map this button of the target joystick within the option menu of the FSX itself. for a more sophisticated event (not available in the option menu of the FSX) you could use the FSUIPC. BUT, i would like to use SimConnect and the appropriate "MapInputEventToClientEvent" call (to programme my own plugin).The problem is, which joystick (0,1,...) is my target joystick?For the "MapInputEventToClientEvent" you have to define the event like "joystick:x:y" (where x is the number of the joystick and y the appropriate button).The question is:How can i determine the acctual number of my target Joystick (or even to provide a drop-down in order to select the target joystick)?(i use FSX Acceleration and Visual C# Studio 2008, but i think its more a general kind of question)Thanks for any hintRegards,Aurel
August 26, 200916 yr After some googling i found that directX with its directInput supports some methods to enumerate joysticks.Does the FSX also use directInput ? (i think so)But the even more important question is, does the joystick number used within SimConnect correspond with an id or number provided by directInput?Thanks for any hintRegards,Aurel
October 15, 200916 yr After some googling i found that directX with its directInput supports some methods to enumerate joysticks.Does the FSX also use directInput ? (i think so)But the even more important question is, does the joystick number used within SimConnect correspond with an id or number provided by directInput?Thanks for any hintRegards,AurelI'll offer my experience, although probably not the answer you seek.FSX uses DirectInput for its input. With regards to the enumeration, it is based on the operating system registration stack where each device has a manufacturer ID and a unique GUID to identify the device. The order of the device cannot easily be changed in Windows unless there's a trick I'm not aware of. There were some utilities out there (I believe posted on the Logitech Wingman forums years ago) to play with the order in the registry as well as calibration values stored by Windows. This may be a moot point now with the new drivers and programmable joysticks that don't use the default calibration screens, and the programs may not even work on current releases of Windows. I have found that the directX order is consistent when one removes and then re-adds the same device (the list will return to the original setup). What is also happening is any new device can change the sequence depending on its manufacturer ID, so it's possible the new device will show up in the middle of a previous sequence. I have a Saitek device that does just that. Then, there are virtual devices (such as those created by CH Products) where the stack gets changed totally based on the profile loaded - this combines physical devices or splits them up (so, for example, a throttle quad can be seen by windows as several devices or just one based on how I program the throttle). I recently upgraded my operating system and my list of devices changed sequence so it's also tied to the operating system. Bottom line, you can't rely on a known sequence because there are too many things that an end user can do to change it. It's probably best to design whatever you need in Simconnect to handle a possible change in the sequence. I would store the device number mapped by the user in a configuration file instead of hardcoding it.As far as the sequence matching what you see in Simconnect, that should be the same although I've not tested thoroughly - one caveat, it will look for joystick axes, so non-joystick devices appearing before the first joystick may offset that sequence. That should be easy to verify with a simple test.Not sure if this is of much help,
Create an account or sign in to comment