AS3X Touch SimConnect Events

After sleuthing around in the .xml files I’ve managed to feret out the SimConnect events for the AS3X Touch installed in the X-Cub (and maybe some other aircraft). They will require the use of the MobiFlight WASM module to access. I have tested these in the sim and they all work.

These are the entries needed in the MobiFlight events.txt file:

// AS3X Touch
AS3X_Touch_1_Knob_Inner_L_INC#(>H:AS3X_Touch_1_Knob_Inner_L_INC)
AS3X_Touch_1_Knob_Inner_L_DEC#(>H:AS3X_Touch_1_Knob_Inner_L_DEC)
AS3X_Touch_1_Knob_Inner_R_INC#(>H:AS3X_Touch_1_Knob_Inner_R_INC)
AS3X_Touch_1_Knob_Inner_R_DEC#(>H:AS3X_Touch_1_Knob_Inner_R_DEC)
AS3X_Touch_1_Knob_Outer_L_INC#(>H:AS3X_Touch_1_Knob_Outer_L_INC)
AS3X_Touch_1_Knob_Outer_L_DEC#(>H:AS3X_Touch_1_Knob_Outer_L_DEC)
AS3X_Touch_1_Knob_Outer_R_INC#(>H:AS3X_Touch_1_Knob_Outer_R_INC)
AS3X_Touch_1_Knob_Outer_R_DEC#(>H:AS3X_Touch_1_Knob_Outer_R_DEC)
AS3X_Touch_1_NRST_Push#(>H:AS3X_Touch_1_NRST_Push)
AS3X_Touch_1_DirectTo_Push#(>H:AS3X_Touch_1_DirectTo_Push)
AS3X_Touch_1_Menu_Push#(>H:AS3X_Touch_1_Menu_Push)
AS3X_Touch_1_Back_Push#(>H:AS3X_Touch_1_Back_Push)

These are the corresponding SimConnect event names:

MobiFlight.AS3X_Touch_1_Knob_Inner_L_INC
MobiFlight.AS3X_Touch_1_Knob_Inner_L_DEC
MobiFlight.AS3X_Touch_1_Knob_Inner_R_INC
MobiFlight.AS3X_Touch_1_Knob_Inner_R_DEC
MobiFlight.AS3X_Touch_1_Knob_Outer_L_INC
MobiFlight.AS3X_Touch_1_Knob_Outer_L_DEC
MobiFlight.AS3X_Touch_1_Knob_Outer_R_INC
MobiFlight.AS3X_Touch_1_Knob_Outer_R_DEC
MobiFlight.AS3X_Touch_1_NRST_Push
MobiFlight.AS3X_Touch_1_DirectTo_Push
MobiFlight.AS3X_Touch_1_Menu_Push
MobiFlight.AS3X_Touch_1_Back_Push

4 Likes

Very helpful, thanks! I just added them to the Mobiflight database https://hubhop.mobiflight.com

Can I ask what your process was for going about finding these? I opened the AppData\Roaming\Microsoft Flight Simulator directory in VS Code and searched for AS3X_Touch_1_Knob_Inner_L_INC, for example, and no results came up. Where are the XML files located where these strings are stored?

You won’t find the strings verbatim - they are constructed on the fly by the engine from various xml macros and variables.

It was a fairly tortuous process following the chain of xml code through several different files but I had the bit between my teeth… :wink:

A very brief example:
In the file “D:\FS2020\Packages\Official\Steam\fs-base-aircraft-common\ModelBehaviorDefs\Asobo\GlassCockpit\AS3X_Touch.xml” there is the xml fragment

		<UseTemplate Name="ASOBO_AS3X_Touch_Push_Template">
			<SUFFIX>DirectTo</SUFFIX>
			<TT_DESCRIPTION_ID>@TT_Package.AS3X_PUSH_DIRECTTO_ACTION</TT_DESCRIPTION_ID>
			<TOOLTIP_TITLE>@TT_Package.AS3X_PUSH_DIRECTTO_TITLE</TOOLTIP_TITLE>
		</UseTemplate>

which is used as input to the xml fragment

<Template Name="ASOBO_AS3X_Touch_Push_Template">

in the same file. Finally the combined xml data is is used as input to the

<Template Name="ASOBO_AS3X_Push_Button_Template">

fragment in the file “D:\FS2020\Packages\Official\Steam\fs-base-aircraft-common\ModelBehaviorDefs\Asobo\GlassCockpit\AS3X.xml”
This fragment contains the following element:

					<SET_STATE_EXTERNAL>p0 sp0
						l0 0 == if{ (E:SIMULATION TIME, second) (O:_PressTime) - #LONG_CLICK_TIME# &lt; if{ (&gt;H:#HTML_KEY_SHORT#) } els{ (&gt;H:#HTML_KEY_LONG#) 0 (&gt;O:_PressTime) } }
						l0 1 == if{ (E:SIMULATION TIME, second) (&gt;O:_PressTime) p1 (&gt;O:_PressForDuration) }
					</SET_STATE_EXTERNAL>

The key bit here is (>H:#HTML_KEY_SHORT#), the #HTML_KEY_SHORT# bit is an xml macro named HTML_KEY_SHORT and the value for this macro is constructed a bit earlier in the xml fragment from data passed in from all the earlier fragments in the chain yielding the string “(>H:AS3X_Touch_1_DirectTo_Push)”.

As I said, it’s pretty tortuous…

1 Like

Holy moly. Thanks for that write-up, I really appreciate it. Don’t think I would have ever figured that out on my own. And here I thought I was guilty of writing overly-abstracted code…