Version: 1.3.23.0
Frequency: Consistently
Severity: High
Context: Triggering native InputEvents via stand alone SimConnect client
Bug description:
At some point in the beta I became aware that triggering InputEvents via SimConnect stopped working in many cases. Customers tell me that this is especially bad in legacy aircraft that they ported over to FS24.
Calling on their BVar cousins does instead work and yield the expected action.
Repro steps:
Example: IE:AS1000_PFD_1_COM_SWAP in the G1000 V1 is non-functional. One has to resort to
1·(>B:AS1000_PFD_1_COM_Swap_Push)·1·(>B:AS1000_PFD_1_COM_Swap_Release)·
Hello @LorbySI
There seems to be an issue with the enumeration and handling of parameters.
How many are you providing when you do a SetInputEvent on AS1000_PFD_1_COM_SWAP?
Regards,
Sylvain
With SimConnect “SetInputEvent” I can only provide one parameter. The SDK documentation says Float or String, but I only use float IEs.
SetInputEvent takes a PVOID and a size, you are expected to pack all parameters listed by EnumerateInputEventParams into a buffer.
For example, if the enumerate params function returns “;char[256];FLOAT64”, you are expected to do the following:
#pragma pack (1)
struct data
{
char value_str[256];
double value_f64;
};
#pragma pack (0)
data my_data;
strcpy_s(my_data.value_str, "a string parameter");
my_data.value_f64 = 12.3;
SimConnect_SetInputEvent(_instance.get_handle(), input.hash, sizeof(my_data), &my_data);
That said, there is a bug in MSFS 2024, where the wrong list of params is returned and they’re not processed correctly.
In the case of AS1000_PFD_1_COM_SWAP
, it takes 2 double parameters:
- Push (1) or Release (0)
- Duration in case of a push
But the the enumeration function returns 3, and you have to provide 3 with the 1st param duplicated for it to work.
A fix is being worked on for this.
Regards,
Sylvain
Hello Sylvain,
that seems very complicated. My app processes all potential InputEvents, not only this one. I would have to create the structures dynamically (in C#) for this to work.
Has this been changed compared to MSFS 2020? The process of using IEs and making them available to the end user was very simple. Now it seems next to impossible to accomplish with some IEs, when there is a dynamic logic like this in play.
Best regards
Oliver