I’ve been playing around with the new InputEvents APIs and it’s great to finally have access to them via SimConnect. I’ve been able to enumerate all the events, send updates, receive updates, and even listen for changes.
Unfortunately while a lot was exposed there are gaps that make the current implementation challenging for real world use. Specifically, it appears that EnumerateInputEvents only returns the equivalent of the “SET” events shown in the sim’s behaviour dialog. There doesn’t seem to be a way to access _INC, _DEC, _TOGGLE, _ON, and _OFF.
For example, this is what is available for the C172’s autopilot NAV button in the sim’s behaviour dialog:
And the button itself in the SIM simply triggers (>B:AS1000_PFD_1_NAV_Mode_Toggle). The InputEvent APIs don’t enable this same simplicity via SimConnect. Instead we have to fall back to old tricks: read the current state, invert it, and write it back.
Please consider exposing more than just SET via these APIs. Thank you
(@LorbySI you’re probably interested in this as well)
Unfortunately not having this makes IEs a lot less useful. If we had this, software like MobiFlight could use our IE bindings rather than duplicating all the code from the IEs on their side for use with execute_calculator_code and friends.
A related issue is RPN code like (>B:MY_IE_SWITCH_TOGGLE) does not work in execute_calculator_code while it does in behaviour XML, so you can’t work around it that way either.
That is interesting…How do you execute RPN/calculator code via SimConnect? I am currently using the Gauge API function to do this in a WASM.
For Bvars, I am currently using the Input Event SimConnect interface. I have noticed that in MSFS2024, you don’t receive back the input event if you set it using SimConnect_SetInputEvent (and you have subscribed to it via SimConnect_SubscribeInputEvent). This worked in MSFS2020.
I’m just using the same methods we used in MobiFlight in MSFS2020, via WASM. Not using the SetInputEvent APIs at all, literally just sending the string as if it were any other RPN (e.g. a K event)