Board index FlightGear Support Hardware

Help with xml

Joysticks, pedals, monitors.

Help with xml

Postby Pancho » Sun Jul 05, 2020 4:48 pm

I'm trying to add a keyboard function to one of the buttons on the T16000M.
This is the keyboard code:
<key n="268">
<name>F12</name>
<desc>Pop up radio settings dialog</desc>
<binding>
<command>dialog-show</command>
<dialog-name>radios</dialog-name>
</binding>
</key>

This is what I have so far on the xml file, How do I add the "dialog-name"
<button n="15">
<desc type="string">Pop up radio setting dialog</desc>
<repeatable>false</repeatable>
<binding>
<command type="string">nasal</command>
<script type="string">dialog-show</script>
......
</binding>
</button>

Thank you
Pancho
 
Posts: 21
Joined: Sun Jul 05, 2020 1:49 pm
Version: 2020.1.1
OS: Ubuntu 20.04 LTS 64-

Re: Help with xml

Postby D-ECHO » Sun Jul 05, 2020 5:21 pm

<command>nasal</command> and <command>dialog-show</command> are two different things - one lets you execute a nasal script, while dialog-show, well, shows a dialog. If you want the joystick binding to show the radio dialog, simply paste the <binding></binding> part from the keyboard code into the <button>

[EDIT] For further information, see this wiki article: http://wiki.flightgear.org/Bindings
D-ECHO
 
Posts: 2453
Joined: Sat May 09, 2015 1:31 pm

Re: Help with xml

Postby Pancho » Sun Jul 05, 2020 8:19 pm

Thank you
But for some reason, the Menu Bar or the key F12 bring up the right dialog for the B777, and the T16000M button brings up one for a different aircraft
Pancho
 
Posts: 21
Joined: Sun Jul 05, 2020 1:49 pm
Version: 2020.1.1
OS: Ubuntu 20.04 LTS 64-

Re: Help with xml

Postby Pancho » Mon Jul 06, 2020 12:07 pm

It looks like there's is more than one radio dialog xml files, the default one and the one for the specific aircraft, and I don't know how to specify on the T16000M button, which one I want.
Pancho
 
Posts: 21
Joined: Sun Jul 05, 2020 1:49 pm
Version: 2020.1.1
OS: Ubuntu 20.04 LTS 64-

Re: Help with xml

Postby Pancho » Tue Jul 07, 2020 7:39 pm

Problem solved, this is the code to add to xml for the T16000M joystick, I have tested it on B777 and B787-8

<button n="15">
<desc type="string">Pop up radio setting dialog</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>dialogs.Radio.open()</script>
</binding>
</button>
Pancho
 
Posts: 21
Joined: Sun Jul 05, 2020 1:49 pm
Version: 2020.1.1
OS: Ubuntu 20.04 LTS 64-

Re: Help with xml

Postby barta » Sun Jul 12, 2020 4:31 am

TIP: You can use dialogs.Radio.toggle() so you can close it from the same button.
"When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return."
- Leonardo da Vinci
barta
 
Posts: 36
Joined: Thu Mar 05, 2009 1:24 am
Location: On the air, preferrably


Return to Hardware

Who is online

Users browsing this forum: No registered users and 3 guests