Controller order issue with SimConnect_MapInputEventToClientEvent in v3

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Locked
russdirks
Posts: 71
Joined: Thu Sep 29, 2011 1:47 am

Controller order issue with SimConnect_MapInputEventToClientEvent in v3

Post by russdirks »

There seems to be a bug introduced in v3, regarding the internal ordering of controllers, which impacts the use of SimConnect_MapInputEventToClientEvent.

The documentation for the pszInputDefinition parameter states the following:
For joysticks the input definition is in the form "joystick:n:input[:i]", where n is the joystick number (starting from 0) ...
In the past, I've always interpreted the "Joystick Number" by looking at the controller order in the USB Game Controllers dialog, and that has always worked perfectly, for FSX and P3D v1 & v2. But in P3D v3 something has changed. Depending on what order I plug the controllers in, and what USB port I plug them into, problems come up. The order of controllers in the USB Controller dialog may or may not match the order of controllers in P3D Settings / Controls dialog, which may or may not match the internal number used by SimConnect_MapInputEventToClientEvent.

This is obviously a problem, because, a) it means you have to search for the right controller number using trial and error, b) it can change if you plug the controllers in differently, and c) it's no longer consistent between different flight sim versions.

This affects my commercial addon FS Force.

I wonder if this is connected with the other reported issue in this sub-forum?
Russel Dirks
FS Force
Win10 64Bit, i5 4670K 3.4GHZ, Radeon RX 580
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: Controller order issue with SimConnect_MapInputEventToClientEvent in v3

Post by Clifton Crane »

Thanks for reporting this issue. I have opened a ticket to investigate.
Clifton Crane
Prepar3D® Software Engineer Sr.
brians
Posts: 32
Joined: Wed Feb 27, 2013 5:59 am

Re: Controller order issue with SimConnect_MapInputEventToClientEvent in v3

Post by brians »

I am using FS-Force and have seen that the USB set up whilst working fine in FSX, P3D v1 and V2, in V3 the trim control (in my case) does not follow the correct USB device (it generally assigns to my throttle control although it varies). This is a real pain and I'm sure that this issue is responsible for some of the other controller assignment issues in the forum.
A fix for this in the next update would be greatly appreciated ( by me at least).


Brian
naf125
Posts: 2
Joined: Sat Jun 13, 2015 1:35 pm

Re: Controller order issue with SimConnect_MapInputEventToClientEvent in v3

Post by naf125 »

brians wrote:I am using FS-Force and have seen that the USB set up whilst working fine in FSX, P3D v1 and V2, in V3 the trim control (in my case) does not follow the correct USB device (it generally assigns to my throttle control although it varies). This is a real pain and I'm sure that this issue is responsible for some of the other controller assignment issues in the forum.
A fix for this in the next update would be greatly appreciated ( by me at least).


Brian

Same issue here.

Peter
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: Controller order issue with SimConnect_MapInputEventToClientEvent in v3

Post by Clifton Crane »

Hello,

Do you see this issue when starting Prepar3D for the first time with all devices plugged in? For example, plug-in all devices, configure FS-Force, start Prepar3D, does the problem exist? Or is this an issue you see primarily when changing devices while Prepar3D is running and attempting to reconfigure FS-Force?

Thanks!
Clifton Crane
Prepar3D® Software Engineer Sr.
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: Controller order issue with SimConnect_MapInputEventToClientEvent in v3

Post by Clifton Crane »

Hello,

I have reproduced the issue at startup. It appears that Raw Input enumerates devices differently than Direct Input. Device ordering should now match the USB Game Controller dialog ordering. The fix will be available with the next release.
Clifton Crane
Prepar3D® Software Engineer Sr.
russdirks
Posts: 71
Joined: Thu Sep 29, 2011 1:47 am

Re: Controller order issue with SimConnect_MapInputEventToClientEvent in v3

Post by russdirks »

Sorry for not replying earlier ... for some reason I'm not getting email notifications of thread activity. Glad to see you've got a handle on the issue.
Russel Dirks
FS Force
Win10 64Bit, i5 4670K 3.4GHZ, Radeon RX 580
adiemus
Posts: 120
Joined: Fri Mar 16, 2012 4:19 am
Contact:

Re: Controller order issue with SimConnect_MapInputEventToClientEvent in v3

Post by adiemus »

Did this enumeration issue get fixed for 3.1, or did it not get found in time and will be in 3.2? I ask because we're still seeing issues with controllers being enumerated in a different order by P3D v3.1 than we get from our existing code that worked with v2 (and v1 and FSX).

FWIW, we're enumerating with DirectInput ala:

Code: Select all

di->EnumDevices(DI8DEVCLASS_GAMECTRL, CallBack, NULL, DIEDFL_ATTACHEDONLY);
Locked