Jump to content
The simFlight Network Forums

Recommended Posts

Posted (edited)

I want to execute  this "pfd NavKnob pressed" macro from the default G1000 gauge file with a key press. Here is an XML excerpt from the gauge file:

 

<MouseArea id="Push">

<FloatPosition>20.000,58.000</FloatPosition>

<Size>50,25</Size>

<CursorType>Hand</CursorType>

<MouseClick id="MouseClick">

    <Script>1 (>@g:pfd NavKnob pressed, bool) (L:SelectedNav2) 1 == if{ 0 } els{ 1 } (>L:SelectedNav2) </Script>

    <ClickType>LeftSingle</ClickType>

</MouseClick>

</MouseArea>

 

I think I read how to create my own macros, but how do you map to one that is already in the default gauge file?

 

Thanks - I know it's a newbie question. The end goal is to execute this via serial com.

 

-Dave

Edited by dwilliams
Posted

OK, to suggest an answer to my own question, I expect I can make an FSUIPC mouse macro and assign it to a key without having to know what is in the gauge XML. But can I map directly to that g:pfd NavKnob pressed thing some way without having to make a macro?

 

Or am I trying to hard to do something simple?

 

-Dave

Posted

OK, to suggest an answer to my own question, I expect I can make an FSUIPC mouse macro and assign it to a key without having to know what is in the gauge XML.

 

Mouse macros only work with gauges written to the standard Microsoft C/C++ gauges SDK.  They can't be used with XML gauges.

 

However, it may well work fine using the relevant local variable (L:Var) -- it looks like L:SelectedNav2 has something to do with it. Check using the FSUIPC assignable control to log L:Vars, or use the Lua plug-in provided to monitor them.

 

Pete

Posted

Thanks, Pete. It does look like the LVAR gets toggled with the mouse press, so setting it directly should work. I'll let you know...

 

First, I have to buy the full-up FSUIPC - my "project" for the day.

 

Cheers,

 

Dave

Posted

Bought the program, installed it, got the list of LVARs, made a macro, assigned it to a key --- works like a charm!  Thanks, Pete.

 

Now to learn the com stuff.

 

-Dave

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.