Jump to content
Sign in to follow this  
rcbarend

Trapping/monitoring keys and events in XML

Recommended Posts

Rob, didn't try, but maybe we can use the vieuw events:....(>K:NEXT_VIEW)(>K:PREV_VIEW)....etc.Something like:"toggle invisible window with code"Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Hi Jan,The problem is not to keep a transparant window (containing the gauge with the key trap) open, but forcing that window open in any other view then 2D Cockpit view, opens the window "undocked" . Which means that you get a nasty Windows "border" around the transparant window (if you are flying in Windowed, not FullScreen mode)Now if this window is Undocked, you can normally "dock" it again via a mouse clicks. But unfortunately there's not event to dock/undock windows :-(.So your suggestion doesn't help I'm afraid..At least not if you use FS2004 in WIndowed mode.Cheers, Rob

Share this post


Link to post
Share on other sites

Hi Nick,Which list do you mean ?All the info I wrote here is also what I wrote on your forum, and which you alreay included in your new #3 tutorial ..Cheers, Rob

Share this post


Link to post
Share on other sites

Rob,I tested this one and it works, only full screen.Panel, ID-400, always visible.400 (>K:PANEL_ID_OPEN)400 (>K:PANEL_ID_OPEN)Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Hi Rob, sorry, I was not very explicit. The attached list to your message #22976 which shows the numbering against keys,nick

Share this post


Link to post
Share on other sites

Hi Nick,Oh, I see :-)OK by me, but please give Pete Dowson credit for it (the info comes from his userguide).Cheers, Rob

Share this post


Link to post
Share on other sites
Guest pwdodds

I want to disable Ctrl-E autostart engines and am guessing that the code will be something like the following. However, you can rightly guess that it doesn't work! Any ideas from anyone please.Peter //i.e. if Crtl-E is pressed, do nothing.

Share this post


Link to post
Share on other sites

Hi,This one works:(>K:ABORT) Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites
Guest pwdodds

Jan - Excellent many thanks.With so little documentation about the black art of XML gauge options. You must spend WEEKS at it!Oh - and how do you explain the statement in a XML tutorial (not FS) "There are no if-else statements in XML". Is "Gauge XML" a special language?Peter

Share this post


Link to post
Share on other sites
Guest pwdodds

>Hi,>>This one works:>>>>(>K:ABORT)> > >>Jan>>"Beatus ille qui procul negotiis..."Actually it doesn't quite. It only traps the second Crtl-E keypress. At least my code does.Peter (> K:ENGINE_AUTO_SHUTDOWN)

Share this post


Link to post
Share on other sites

>Oh - and how do you explain the statement in a XML tutorial>(not FS) "There are no if-else statements in XML". Is "Gauge>XML" a special language?Properly speaking, "gauge XML" isn't a language at all. Any gauge "programmed in XML" must be parsed and translated into executable code by a special engine written in C, which in turn outputs machine code (assembly language instructions). This parsing of the XML is done once, then held in memory for faster execution.The nice folks at ACES (MS Game Studio) created this special sub-set of XML specifically to make including code in a compiled .mdl file possible. It was originally introduced as a means to drive the virtual cockpit gauges in the CFS series, and eventually spilled over into the FS series as well, beginning with FS2002 with 2d gauges, then in FS2004 was expanded to include the original CFS usage of using it for embedded .mdl animation code.FSX will continue to see XML expanded and will (reputedly) include a WYSIWYG integrated design environment, which would be a real boon for everyone... ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

OK, old topic, but in looking up some of these old threads to answer another question, I realized there was still some old code I never managed to get working:The problem is that in "trapping" the keypress "1" in this case, code within gets executed twice, and I can't figure out why:(L:Test, enum) ++ (>L:Test, enum)The value of (L:Test, enum) will be + 2 every time you press the "1" key (or ANY key assigned). I even tried introducing a delay loop into the event, but it wouldn't stop the event from firing twice, so it's not a delay issue as far as I can tell. Has anyone else run into this, or have a solution?--Jon

Share this post


Link to post
Share on other sites

Hi Jon,There's nothing wrong with that code (I just tested it, and it just increments L:Test by one for each keypress; as expected).The only thing I can imagine, that you have this code present in more than one gauge, or that there are other places where you increment this L:Test var.Cheers, Rob

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...