Jump to content
Sign in to follow this  
Bert Pieke

F1VC.xml - 3D Cockpit Knobs and Keys - tips and tricks

Recommended Posts

I have found that some airplanes converted from F1 to RXP GTN have a problem with recognizing the Direct-To and Home buttons when clicked, even when one of the nifty translation programs for the buttons/knobs is used.  A double-click often works, but a single click does not.

After trying various things, I have now gone to the Interior Model files and trough trial and error found that making some simple edits fixes the situation.

The standard code for the Direct-To button looks like this:

Direct-To Key       

(M:Event) 'LeftSingle'  scmp 0 == if{ 0x0001FA03 (>L:F1GTNMOUSE, bool) ....

(M:Event) 'LeftRelease'  scmp 0 == if{ 0x0001FA04 (>L:F1GTNMOUSE, bool) ...       

(M:Event) 'Leave'  scmp 0 == if{ 0x0001FA04 (>L:F1GTNMOUSE, bool) ...      

(M:Event) 'LeftDrag'  scmp 0 == if{ 0x0001FA04 (>L:F1GTNMOUSE, bool) ...   

If you rename the last three F1GTNs to F2GTN.. then the single click works like a charm :happy:

I am sure that FXGTN would work just as well..

Same for the Home key!

 

Edited by RXP
  • Like 2
  • Upvote 3

Bert

Share this post


Link to post
Share on other sites

Awesome work. This has bugged me especially on my RealAir Legacy. 

Thanks,

Bruce


[CPL]  I9-9900K @5.0GHz HT ON, Maximus XI Hero, ASUS TUF RTX4080 OC, 32GB DDR4 3200 14, 1TB NVMe SSD, 500GB SSD, 1TB HDD, 40" Samsung 4K TV, Honeycomb Alpha & Bravo, Logitech Rudder Pedals, WIN11

Share this post


Link to post
Share on other sites

Yup, the Legacy is one of them, on my system also.. :happy:

Still wonder:  Why?

 


Bert

Share this post


Link to post
Share on other sites

For the Legacy, I simply use this routine:

<Gauge Name="GTN 750 buttons" Version="1.0">

<!-- Trigger GTN 750 commands -->
   
<Element>
     <Select>
      <Value>

  (L:F1GTNMOUSE, number)  129539 ==  if{
  1 (>K:GPS_DIRECTTO_BUTTON)
  0 (>L:F1GTNMOUSE, number) }

 (L:F1GTNMOUSE, number)  129537 ==  if{
  1 (>K:GPS_MENU_BUTTON)
  0 (>L:F1GTNMOUSE, number) }
          
      </Value>      
     </Select>
   </Element>
</Gauge>

 

Edited by RXP

Bert

Share this post


Link to post
Share on other sites

Bert you're a machine!

  • Like 1

| FAA ZMP |
| PPL ASEL |
| Windows 11 | MSI Z690 Tomahawk | 12700K 4.7GHz | MSI RTX 4080 | 32GB 5600 MHz DDR5 | 500GB Samsung 860 Evo SSD | 2x 2TB Samsung 970 Evo M.2 | EVGA 850W Gold | Corsair 5000X | HP G2 (VR) / LG 27" 1440p |

 

 

Share this post


Link to post
Share on other sites

And just confirmed that the following two lines can be safely deleted:

            l0 0 == l0 1 == or if{ l1 (>K:GPS_MENU_BUTTON) }
            l0 2 == l0 3 == or if{ l1 (>K:GPS_DIRECTTO_BUTTON) }          

..since they are being tested earlier.


Bert

Share this post


Link to post
Share on other sites

Hi Bert,

thank you for going the extra leg with this and for sharing with others!

I'm trying to figure out the issue at hand and this raises a few comments/questions:

 

1) This code is handling both press and release events:

            l0 0 == l0 1 == or if{ l1 (>K:GPS_MENU_BUTTON) }
            l0 2 == l0 3 == or if{ l1 (>K:GPS_DIRECTTO_BUTTON) }  

 

2) This code is handling only press events (F1) and translate them to press-and-release events (RXP):

     (L:F1GTNMOUSE, number)  129539 ==  if{
     1 (>K:GPS_DIRECTTO_BUTTON)
     0 (>L:F1GTNMOUSE, number) }

    (L:F1GTNMOUSE, number)  129537 ==  if{
    1 (>K:GPS_MENU_BUTTON)
    0 (>L:F1GTNMOUSE, number) } }

NB: you should use 0 (>K:GPS_xxxxx) because 1 is not used. (please note this won't work for GTN #2)

 

3) The issue could also be just related to the way the f1 GTN is interfacing: it expects the 3D model to write a value in a variable which it polls to trigger an action. Therefore, it can't poll quickly enough 2 changes in a row and this is a strong limitation of this implementation (say you press and release the button before it polls the variable, the f1 GTN would just see the 'release' value...) This is why we've implemented our interface using a true event-based system. No matter how fast you click the buttons, all the associated events gets routed to the RXP GTN and none is lost!

 

Q: does it means this aircraft 3D model with the other GTN is not handling 'long presses' on the HOME button for example? 

If it does, it should write the value 129540 when releasing DTO and 128538 when releasing HOME buttons in the 3D cockpit. Otherwise, this most likely explains why it requires 2 presses on the button, because the 'translation' code is capturing the press event, sends the press command, then the release event is never coming back, and the GTN waits for the key to release.

Edited by RXP

Jean-Luc | reality-xp.com
This message from Reality XP is protected by a disclaimer: reality-xp.com/aboutrealityxp/email.html

Let your voice be heard and help us make a difference for you: Vote !
Open up communications with Reality-XP (Microsoft Flight Simulator Forums)

Share this post


Link to post
Share on other sites

Hi Jean Luc,

Looking at it more closely, I believe that this "double click" issue existed with the "other" GTN as well.  Just tested with the Turbine Duke where I have not touched the Interior Model file and have the "other" GTN installed.  A long click on the Home button accomplishes nothing (in the VC). 

In the popup version, all the clicks, including the long Home click work correctly.

This is the code in the TDuke model file:

Home Key
(M:Event) 'LeftSingle'  scmp 0 == if{ 0x0001FA01 (>L:F1GTNMOUSE, bool) }        
(M:Event) 'LeftRelease'  scmp 0 == if{ 0x0001FA02 (>L:F1GTNMOUSE, bool) }        
(M:Event) 'Leave'  scmp 0 == if{ 0x0001FA02 (>L:F1GTNMOUSE, bool) }        
(M:Event) 'LeftDrag'  scmp 0 == if{ 0x0001FA02 (>L:F1GTNMOUSE, bool) }

Edited by Bert Pieke

Bert

Share this post


Link to post
Share on other sites

I have been using an earlier version of the RXP_Buttons_Knobs routine in the Legacy for a while now (thanks @ryanatcund) but it requires double clicks. Today I tried your modified version and it also requires double clicks for me, but when I double press then hold the Home button in the earlier version I get the map page, with your modified version it does not. What am I doing wrong? Why double clicks with those routines?

Also, I tried editing the interior vc MDL file with a text editor, changing all the Direct-to and Home routines as you were indicating above but no joy.  Are the interior files you're editing xml's?


[CPL]  I9-9900K @5.0GHz HT ON, Maximus XI Hero, ASUS TUF RTX4080 OC, 32GB DDR4 3200 14, 1TB NVMe SSD, 500GB SSD, 1TB HDD, 40" Samsung 4K TV, Honeycomb Alpha & Bravo, Logitech Rudder Pedals, WIN11

Share this post


Link to post
Share on other sites
3 hours ago, bbuckley said:

 

Also, I tried editing the interior vc MDL file with a text editor, changing all the Direct-to and Home routines as you were indicating above but no joy.  Are the interior files you're editing xml's?

The model files are mdl files that can only be edited with a Hex Editor, like HxD.

This is tricky business.. you cannot delete or insert characters, only replace..

Maybe someone can figure out how to do this without touching the model file..

 


Bert

Share this post


Link to post
Share on other sites
12 hours ago, Bert Pieke said:

A long click on the Home button accomplishes nothing (in the VC). 

This somewhat confirms my thoughts.

Either the aircraft model code was just copy/pasted as-is without any further consideration of what it does, and they have forgotten to code the click region to handle the mouse 'release' event,

or

I believe the double click the culprit is this:

12 hours ago, Bert Pieke said:

(M:Event) 'LeftDrag'  scmp 0 == if{ 0x0001FA02 (>L:F1GTNMOUSE, bool) }

If you ever move the mouse 1 pixel while clicking, it will 'release' the button. You might want to try clearing up this one line of code and see how it works then.

Besides, 'mouse leave' event is necessary otherwise if may never release the button in some cases (the cockpit moves underneath your mouse cursor).


Jean-Luc | reality-xp.com
This message from Reality XP is protected by a disclaimer: reality-xp.com/aboutrealityxp/email.html

Let your voice be heard and help us make a difference for you: Vote !
Open up communications with Reality-XP (Microsoft Flight Simulator Forums)

Share this post


Link to post
Share on other sites
11 hours ago, Bert Pieke said:

The model files are mdl files that can only be edited with a Hex Editor, like HxD.

This is tricky business.. you cannot delete or insert characters, only replace..

Maybe someone can figure out how to do this without touching the model file..

 

Also, the RealAir model files have four sections for the GTN buttons.. 650U1, 650U2, 750U1, 750U2..

Only the section that corresponds to your installed GTN option matters (I believe..)

  • Like 1

Bert

Share this post


Link to post
Share on other sites
3 hours ago, RXP said:

I believe the double click the culprit is this:

(M:Event) 'LeftDrag'  scmp 0 == if{ 0x0001FA02 (>L:F1GTNMOUSE, bool) }

If you ever move the mouse 1 pixel while clicking, it will 'release' the button. You might want to try clearing up this one line of code and see how it works then.

Besides, 'mouse leave' event is necessary otherwise if may never release the button in some cases (the cockpit moves underneath your mouse cursor).

BINGO! 

You nailed it.. :biggrin:

If I only disable that one line, but leave the other lines, not only does the original F1VC code work again, but the long hold for the Home button works as well!

Updated instructions to follow for adventurous "aircraft owners"..

  • Like 2

Bert

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