Board index FlightGear Support Hardware

Keyboard XML Controls  Topic is solved

Joysticks, pedals, monitors.

Keyboard XML Controls

Postby specksavers » Wed Jul 31, 2013 12:39 pm

Hi,
I fly the C172 and I wanted to change some of my keyboard controls. Could someone give me the code to make the key 'q' turn on/off the taxi lights and the 'w' key turn on/off the the landing lights. Please let me know where to place the XML code.

Thanks,
George.
European Air Force - Head of the Air Defence Operations Component.
User avatar
specksavers
 
Posts: 135
Joined: Thu Dec 13, 2012 10:27 pm
Callsign: EAF023
Version: 2.10
OS: Mac OS X

Re: Keyboard XML Controls  

Postby macnab » Thu Aug 01, 2013 5:38 am

OK. With my c172p, switching on the Taxi Light has no visible effect. That being said, here is the code that you need.

Code: Select all
  <key n="113">
  <name>q</name>
  <desc>Toggle Taxi Light</desc>
  <repeatable type="bool">false</repeatable>
  <binding>
    <command>nasal</command>
    <script>setprop("/controls/lighting/taxi-light", !getprop("/controls/lighting/taxi-light"))</script>
  </binding>
  </key>

  <key n="119">
  <name>w</name>
  <desc>Toggle Landing Lights</desc>
  <repeatable type="bool">false</repeatable>
  <binding>
    <command>nasal</command>
    <script>setprop("/controls/lighting/landing-lights", !getprop("/controls/lighting/landing-lights"))</script>
  </binding>
  </key>


Now you want them only for the c172.
Go to the folder where flightgear is installed. Then to data/Aircraft/c172p.
Copy the file c172p-set.xml file to a safe location where you can retrieve it if things go wrong.
Then, still in data/Aircraft/c172p, open the c172p-set.xml file with a text editor.
Scroll right to the bottom. You will see
Code: Select all
      </key> 
    </keyboard>
  </input>

</PropertyList>


You are going to paste the code below the </key> and before the </keyboard>, so click with the mouse at the start of the </keyboard> line.
Then com back here, and at the top of the bl;ock of the needed code, click on SELECT ALL, and press ctrl-c to copy it..
Go back to the xml file and paste the code using ctrl-v.
Save the file.
Test. Not forgetting that there doesn't seem to be a taxi light.

If it doesn't work, go to your "saved" version of the c172p-set.xml file and copy it over the file you have just modified. Then at least you are back where you started. Then come back here and let us know what went wrong.

If it does work, come back to this thread, and click on the green tick-mark at the top right of this post, so that everyone (including other people who find it useful) will know that it works.
macnab
 
Posts: 885
Joined: Tue Aug 02, 2011 8:20 am
Location: Johannesburg, South Africa
Callsign: ZS-ILH
Version: Git
OS: Win7Pro 64bit SP1

Re: Keyboard XML Controls

Postby specksavers » Thu Aug 01, 2013 11:32 am

Thats perfect, everything works great.
Have a great summer,
George.
European Air Force - Head of the Air Defence Operations Component.
User avatar
specksavers
 
Posts: 135
Joined: Thu Dec 13, 2012 10:27 pm
Callsign: EAF023
Version: 2.10
OS: Mac OS X


Return to Hardware

Who is online

Users browsing this forum: No registered users and 3 guests