Demo: LVAR write access for any aircraft control

Using the null pointer also compiles nicely, thanks for that @The727Pilot . I’ve now uploaded the full code that handles MCDU and EFIS panel interactions onto a GitHub page accessable here:

msfs-wasm-lvar-access/lvar-access.cpp at main · markrielaart/msfs-wasm-lvar-access · GitHub.

For instance, to set the EFIS range button, trigger event ID “#0x11001” and provide input argument 0x0Z03, with Z = 0, 1, … 4 (corresponding to range selection 10, 20, …, 320 nm). In general, the argument to set EFIS buttons is 0x0abc, with a the passed argument (typically 0 for off, 1 for on, or 0 through integer number for dials with multiple set values), and ‘bc’ the index of the LVAR in the LVAR_EFIS_PANEL array.

Similarly, to emulate an MCDU button press, trigger event ID “#0x11000” and as value pass the index number (starting at 0 for Button 0, etc) for the button you want to press.

A compiled WASM is also availble at the GitHub page as 'Initial release (v0.1). Let me know if you need more help, and I am curious to learn if this also works for instance with FSUIPC and other services as I don’t use that at the moment.

Maurice