2 Questions...... 2 awnsers
1. G1000.
I not use those stuff so i´m not a pro here.... Do you mean if you press this virtual button then the Bug is do exactly what you need ??
If Yes the logical result should be to try to controll this button..... then you need no difficult code or workaround.
Check the EventID List..... On first view all Buttons got a EventID.
For example: G1000 MFD SOFTKEY1---- 66789
EDIT: Logging Mode show me "HEADING BUG SET 66042" when i use that button. Pleae try out with parameter 0..... Maybe it work !
About LUA Macro.
Here you got a lot of ways.
Most easy is to assign the macro to a Key in FSUIPC (Registred Version) ..... then In mobiflight you just use Keypress (with that key) ...... So you Press button and mobiflight send e.g. a "A" Button..... And in FSUIPC you say : If "A" is pressed execute your macro.
This also works for Joybuttons ( Via VJOY and Mobiflight OR Via a real JoystickController like LeoBodnar external of Mobiflight)
More advanced is to bind the macro to a Offset.... So macro runs if Offset e.g. 66C0 is "1" and set the offset after running back to "0".
Here you say in Mobiflight Buttonpress should write that Offset to 1
Also Possible is the LUA MACRO Function of Mobiflight..... In Input you can use this to start/stop a Macro or script.
https://www.mobiflight.com/forum/message/10232.html