EnumerateInputEvents doesn't return _INC, _DEC, _TOGGLE, _ON, and _OFF events

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:

image

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 :slight_smile:

(@LorbySI you’re probably interested in this as well)

4 Likes

Hello @neile

This is by design for this first iteration but extending this API to support all events is something we discuss.
This has been added to our backlog.

Regards,
Sylvain

1 Like

Any news on this? By any chance would this work in FS2024?

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.

Update: It appears you can directly call Bvars from RPN via SimConnect WASM in MSFS2024!!! I’ve been able to successfully do things like this:

1 (>B:ENGINE_STARTER_1_Set)
1 (>B:FUEL_FUEL_PUSH_RUNSTOP_1_COVER_OPEN)
1 (>B:FUEL_RUNSTOP_1_RUN)
1 (>B:FUEL_FUEL_PUSH_RUNSTOP_1_COVER_CLOSE)

2 Likes

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.

1 Like

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)

Ok - then its the same, using the gauge API function in the WASM to execute the calc. code.