Hacks

How to change key bindings

Thought there's no fancy key binding tools available on Mac yet, it doesn't mean you cannot change the key bindings yourself.

Editing keyboard configuration file

FlightGear has a keyboard configuration file at /Applications/FlightGear.app/Contents/Resources/data/keyboard.xml. Don't forget to backup the file before you get started.

The basic structure of a key binding

 1: <key n="1">
 2: <name>Ctrl-A</name>
 3:  <desc>Toggle autopilot altitude lock.</desc>
 4:  <binding>
 5:  <command>nasal</command>
 6:  <script>
 7:    node = props.globals.getNode("/autopilot/locks/altitude", 1);
 8:    if ( node.getValue() == "altitude-hold" ) {
 9:      node.setValue( "" );
10:    } else {
11:      node.setValue( "altitude-hold" );
12:    }
13:  </script>
14: </binding>
15: </key>

1. index
2. name of key in format of '[Modifier-]<key>' (e.g. Ctrl-A, a, G, ESC) - Key name is case sensitive
3. description
4-14. command that is bound to a key - DO NOT EDIT

Modifiers

There are two modifiers described in xml file.

  1. <mod-up>
    mod-up describes a command when a key is released.
  2. <mod-shift>
    mod-shift describes a command when a shift is pressed

2 Responses to “Hacks”

  1. Guy W. Cole Says:
    Does anyone want to post a copy of their key bindings file? I'm looking for a Powerbook key set up, but I'm sure others would like some mac-configured presets as well.
  2. Tat Says:
    Hi Guy, Great! Somebody does want that. Why don' you send me the file. I'll post it here.

Leave a comment

Please DO NOT post a crash log here. it's hard to read and is not worth reading for most of users. Email it to me directly with some additional information including exact FlightFear version, machine spec, and what was you doing when it went crash. Thank you.
Begin the comment with //pukiwiki if you want to write a comment in PukiWiki format.

You must be logged in to post a comment.