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.

How to use the GPS_ENTER_BUTTON EventID?

Featured Replies

  • Moderator

I have a vintage GNS430 scripted in FS9 syntax XML that's been working fine as a 2d and VC gauge for years.Now I've need to interface 3d buttons in a VC to interact with the GNS430...Okay, I've long noted the list of key_events such as GPS_ENTER_BUTTON in the SDK, and thought this would do the trick nicely!Included in the GNS430 XML script is the section for <Keys>:

  <Keys>	...............	<On Event="GPS_ENTER_BUTTON">@ENTButton</On>	...............  </Keys>

However, all attempts so far have failed miserably... <sigh>I've created a custom entry for modeldef.xml as follows:

 <Animation name="GPS2_ENTER_BUTTON" guid="38ada83c-57b7-44ae-8b4e-379b5f915661" length="50" type="Sim" typeParam2="GPS2_ENTER_BUTTON" typeParam="AutoPlay" />   <PartInfo>	<Name>GPS2_ENTER_BUTTON</Name>	<MouseRect>	  <Cursor>Hand</Cursor>	  <TooltipText>Enter</TooltipText>	  <EventID>GPS_ENTER_BUTTON</EventID>	</MouseRect>  </PartInfo>

The tooltip displays, but clicking on the button does precisely nothing...I've tried various combinations all to no avail.

<CallbackCode>	 1 (>K:GPS_ENTER_BUTTON)</CallbackCode><CallbackCode>	 (>K:GPS_ENTER_BUTTON)</CallbackCode>

If anyone call tell me how to get this working, I'd be very, very grateful! :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Bill, I know you're trying to do this 3d VC style - here's some code from the FS9 stock GPS500. It looks like the GPS has an internal variable just to be used for enter button down -- (@g:entButtonDown) Here's the code snippets not including the actual function of the enter button. Maybe will help-- maybe not... Here goes. Roman

<!-- The actual 2 bitmap movement --><Element><Position X="398" Y="226"/><Select><Value>(@g:entButtonDown) 0 !=</Value><Case Value="0"><Image Name="gps_500_ent_out.bmp"/></Case><Case Value="1"><Image Name="gps_500_ent_in.bmp"/></Case></Select></Element><!-- The mouse command --><Area Name="ENT Button" Left="405" Top="232" Width="34" Height="21"><Click Kind="LeftSingle+Leave">(M:Event) 'LeftSingle' scmp 0 == (@g:entButtonDown) 0 == and if{ 1 (>@g:entButtonDown) @ENTButton }(M:Event) 'Leave' scmp 0 == (@g:entButtonDown) 1 == and if{ 0 (>@g:entButtonDown) }</Click><Cursor Type="Hand"/><Tooltip ID="TOOLTIPTEXT_GPS_ENTER_BUTTON"/></Area>

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Ahh, I see the problem now, disregard past...Can you use L:vars in modeldef.xml ? If so maybe try to send a boolean from the 3D button to the actual GNS430 code to activate the @ENTButton macro then reset the bool to 0. Kinda seems the same as using the stock >K:GPS_ENTER_BUTTON.. But that doesn't work :-( Roman

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

  • Author
  • Moderator
Ahh, I see the problem now, disregard past...Can you use L:vars in modeldef.xml ? If so maybe try to send a boolean from the 3D button to the actual GNS430 code to activate the @ENTButton macro then reset the bool to 0. Kinda seems the same as using the stock >K:GPS_ENTER_BUTTON.. But that doesn't work :-( Roman
Roman, the problem seems to stem from the simple fact that all of the @Macros used in the <Mouse> section are inaccessible from "outside" the <Mouse> section......in other words, even calling for @ENTButton macro from the "main gauge" section of the XML script will not work!I tried setting an (L:GPS2_ENTER_BUTTON,bool) variable from the 3d button (via embedded modeldef.xml script).In the "main gauge" section of my GNS430 I successfully detected the (L:GPS2_ENTER_BUTTON,bool) variable's value, but the call for @ENTButton macro was ignored.
<Update>	<!-- //////////////// 3D MODEL INTERFACE SCRIPTS /////////////// -->	(L:GPS2_ENTER_BUTTON,bool) if{ 1 (>@g:entButtonDown) @ENTButton 0 (>L:GPS2_ENTER_BUTTON,bool) }	(L:GPS2_DTK_BUTTON,bool) if{ @DTOButton2 0 (>L:GPS2_DTK_BUTTON,bool) }</Update>

Moving the @ENTButton macro to the "main gauge" section will not work, because then the <Mouse> section can't find the darned @Macro! and the sim will crash with a "panel.dll" error... :( BTW, the only working example I have at hand is David Brice's brilliant Iris DA42 3d model. The only difference is that he's scripted their G1000's using the FSX XML schema... Looking at the embedded XML in the model clearly shows that the XML script used is:<EventID>G1000_MFD_ENTER_BUTTON</EventID>In the MFD's script I see that the FSX XML schema allows the mouse section's @Macros to be placed in the "main gauge" area, which makes them accessible to both the <Mouse> section as well as the "main gauge" section...For much the same reason, even trying to use @g:entButtonDown variable won't do the job, because while anything in the "main gauge" section that uses the @g:entButtonDown variable will respond, anything in the <Mouse> section using the @g:entButtonDown variable will be ignored...It's as though in the FS9 XML schema that everything within the <Mouse> area runs in it's own little closed "universe" and that communications is strictly a one-way street from the "Mouse Universe" to the "Real Universe..." :( Round and round I go... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Bill, Very, very strange. I thought I'd give it a test on your first version try. I assigned the keyboard controls to have the GPS enter button work with CTRL-SHFT-E. It worked! I then made a small gauge with a click spot to have (>K:GPS_ENTER_BUTTON). That worked too! Then cleared the keyboard assignment, still worked. Between each test I swapped 2 aircraft. No idea what the problem is now, as you said round & round. Roman

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

  • Author
  • Moderator
Bill, Very, very strange. I thought I'd give it a test on your first version try. I assigned the keyboard controls to have the GPS enter button work with CTRL-SHFT-E. It worked! I then made a small gauge with a click spot to have (>K:GPS_ENTER_BUTTON). That worked too! Then cleared the keyboard assignment, still worked. Between each test I swapped 2 aircraft. No idea what the problem is now, as you said round & round. Roman
Interesting that the XML scripted gauge works, but the same command issued from embedded XML script in the model file won't... :(Actually, I've just thought of a possiblity I haven't tried yet...
<Update>	<!-- //////////////// 3D MODEL INTERFACE SCRIPTS /////////////// -->	(L:GPS2_ENTER_BUTTON,bool) if{ (>K:GPS_ENTER_BUTTON) 0 (>L:GPS2_ENTER_BUTTON,bool) }	(L:GPS2_DTK_BUTTON,bool) if{ (>K:GPS_DIRECTTO_BUTTON) 0 (>L:GPS2_DTK_BUTTON,bool) }</Update>

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Moderator

SOLUTION FOUND!!!Ding, ding ding!The "solution" has turned out to be quite simple in retrospect, but it took a very long time for this aged, weary and simple soul to find... In the XML GNS430 gauge itself, monitor for custom L:var input from the model's XML scripted buttons, then instead of trying to execute the @Macro directly, simply issue the stock K:Event required:

<Update>	<!-- //////////////// 3D MODEL INTERFACE SCRIPTS /////////////// -->	(L:GPS2_ENTER_BUTTON,bool) 1 == if{ 1 (>@g:entButtonDown) (>K:GPS_ENTER_BUTTON) 0 (>L:GPS2_ENTER_BUTTON,bool) }	(L:GPS2_DTK_BUTTON,bool) 1 == if{ (>K:GPS_DIRECTTO_BUTTON) 0 (>L:GPS2_DTK_BUTTON,bool) }</Update>

It took me awhile to realize that it was working, because I'd quite forgotten that I have a "boot routine" that requires the user to press the ENT button twice on initial startup.Since I wasn't sending the @g:entButtonDown command, the boot screen would never execute, thereby "masking" that the DTK button was being recognized, but couldn't be seen!DUH!!!So this is what the expression "hoisted on his own petard" means... :( :( :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Moderator
Bill, Glad you got this one... I see there, in other threads, that all may not be good in this project. Sorry, no help in the X format. Get 'er done..Roman
Well, as of yesterday I finally got everything working, albeit not without a great deal of pain.Certain of the <Keys> simply do not work at all, and at least two are reversed (terrain and flightplan).I ultimately wound up assigning the faces of the 3d buttons to the $VC_01 material, and adjusting the bitmap graphics to better match the hi-res textures used on the rest of the mesh.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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.