Cockpitbuilders.com

Main => Builders Discussions => Topic started by: Stinger2k2 on February 27, 2019, 09:55:26 AM

Title: XML to Lua ??
Post by: Stinger2k2 on February 27, 2019, 09:55:26 AM
Hi Guys and thanks for looking,
I have found the following XML code in a gauge.cab which operates
a keypad on a Garmin GCU477.(The code is only for the letter A, there
is more covering the rest of the alphabet)

I didn't find anything on a FSUIPC/LINDA trace so somehow I am
looking to use this code but operate it from a hardware button.

My question is this....Can I use part of this code directly as a Lua script?
If not, what do I need to do to have it operated from a joystick button?

I am fairly conversant in Lua and have many other buttons operating other
functions.

Here's the code....

<MouseArea id="Letter A">
      <FloatPosition>16.000,151.000</FloatPosition>
      <Size>45,30</Size>
      <CursorType>Hand</CursorType>
      <MouseClick id="MouseClick">
         <Script>65 chr (&gt;@c:IcaoSearchEnterChar) 1 (>L:BUFFER_BTN_FMC,number)</Script>
         <ClickType>LeftSingle</ClickType>
         <ClickRepeat>True</ClickRepeat>
      </MouseClick>
   </MouseArea>
Title: Re: XML to Lua ??
Post by: Trevor Hale on February 28, 2019, 10:09:11 AM
That looks to me like "KEY press to TO MOUSE function code"

The function of assigning a key press to a mouse location for clicking is easy to do with FSUIPC.
I am guessing the gauge your talking about has a button your supposed to use your mouse on to control the gauge.  If you try pressing the letter A on your keyboard I am guessing it will also control the gauge.
With that being said, I see no issues why you couldn't have the joystick button send keypress "A" when the joystick button is pressed..  Again this would be done in FSUIPC.
Trev