I have searched through the forums and the SDK and still can’t figure this out.
How does one send B Events to the sim? I have a working WASM module for H:Events and they work perfectly fine.
Just need to know the process. Do I need to add them as data definition or anything like that?
Any help would be greatly appreciated.
Hi!
I just figured it out yesterday from SimConnect B events are not sendable through SimConnect_TransmitClientEvent_EX1 as K events are.
To to that I first retrieve all the InputEvents loaded for the aircaft with SimConnect_EnumerateInputEvents and get the hash for the one that I want to trigger. Then I send * SimConnect_SetInputEvent* with the right value and I was able to emulate the click on the BAT 1 push button in the A320N that way, event ids way was not working since they are inhibited through the preset.
1 Like
Awesome, I will give this a go!
My other issue is how do you send the “Inc, Dec, or Set”?
I’m working with the Fenix which has some new B Events for the encoders.
For the set you have to use SimConnect_SetInputEvent. I guess there is no need for inc and dec since they are just a variation of the set.
Hello
We don’t expose the Inc, Dec or other custom events at the moment.
There’s a bug report you can follow for this if you want to be notified if there’s a change on this:
EnumerateInputEvents doesn’t return _INC, _DEC, _TOGGLE, _ON, and _OFF events - Bug Reports / SimConnect - MSFS DevSupport (flightsimulator.com)
Regards,
Sylvain
I see. So what’s the “trick” that is mentioned to use it?
Currently sending set 1 or -1 seems to work somewhat but is erratic.
Also getting information from the even yields a zero every time.
I have the same issue. I have no experience in C++ so this might be wrong but here is how I set the input event:
float value = 1.0f;
SimConnect_SetInputEvent(hSimConnect, input_events_hash[ELECTRICAL_BATTERY_1], sizeof(value), &value);
But in the debug tools I see this:
I guess this is why it’s erratic but I don’t know how to solve this. Plus, it seems it works less when the simulator just started (my code was mostly working yesterday but I’m unable to switch the battery on right now)
I think the value on SimCOnnect debug is normal since it’s a pointer but the following is clearly the reason of why it’s erractic:
Execution #2 loads a value that is not what I send. I send 1 every time but the param value is changing at each call. What could be the cause?