Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Trapping/monitoring keys and events in XML

Featured Replies

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"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Replies 36
  • Views 5k
  • Created
  • Last Reply

Top Posters In This Topic

  • Author

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

Hi Rob, can I please add this list to our site as a reference document?nick

  • Author

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

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"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

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

  • Author

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

  • 8 months later...

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.

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

Jan

 

 

 

"Beatus ille qui procul negotiis..."

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

>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)

  • Moderator

>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
  • 2 months later...
  • Commercial Member

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

  • Author

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.