dwilliams Posted May 1, 2015 Report Posted May 1, 2015 (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 May 4, 2015 by dwilliams
dwilliams Posted May 1, 2015 Author Report Posted May 1, 2015 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
Pete Dowson Posted May 1, 2015 Report Posted May 1, 2015 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
dwilliams Posted May 1, 2015 Author Report Posted May 1, 2015 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
dwilliams Posted May 1, 2015 Author Report Posted May 1, 2015 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now