Bindings

From FlightGear wiki
Revision as of 23:43, 12 March 2011 by Scotth1 (talk | contribs) (looks like property-set has been replaced with property-assign)
Jump to navigation Jump to search

Bindings define what happens when a user:

You can assign multiple bindings to one object/button/key.

All give codes are examples, found on various places in the FlightGear package.

Commands

dialog-show

Shows a dialog, which should be present in $FG ROOT/gui/Dialogs.

<binding>
 <command>dialog-show</command>
 <dialog-name>location-in-air</dialog-name>
</binding>
  • dialog-name: the name of the dialog, as designated in its .xml file.

nasal

Nasal is frequently used for complicated systems.

<binding>
 <command>nasal</command>
 <script>b777.afds.input(0,1);</script>
</binding>

property-adjust

Increases or decreases a property's value with a given step. Maximum and minimum values are optional.

<binding>
 <command>property-adjust</command>
 <property>/controls/lighting/panel-norm</property>
 <step>-0.05</step>
 <min>0</min>
 <max>1</max>
</binding>

property-cycle

Cycles between a list of values and assigns one to a property. The value-list can vary in length.

<binding>
 <command>property-cycle</command>
 <property>/autopilot/autobrake/setting</property>
 <value type="string">ARM</value>
 <value type="string">DISARM</value>
 <value type="string">OFF</value>
</binding>

property-randomize

Assigns a random value (between min and max) to a property.

<binding>
 <command>property-randomize</command>
 <property>/orientation/pitch-deg</property>
 <min>0</min>
 <max>360</max>
</binding>

property-set

This command appears to be deprecated since V2.0 One of the most important commands. It sets a property to a predefined value.

<binding>
 <command>property-set</command>
 <property>/autopilot/settings/target-speed-kt</property>
 <value>0</value>
</binding>

property-assign

One of the most important commands. It sets a property to a predefined value.

<binding>
 <command>property-assign</command>
 <property>/autopilot/settings/target-speed-kt</property>
 <value>0</value>
</binding>

property-swap

Swaps the values of two properties.

<binding>
 <command>property-swap</command>
 <property>/instrumentation/comm/frequencies/selected-mhz</property>
 <property>/instrumentation/comm/frequencies/standby-mhz</property>
</binding>

property-toggle

Toggles the value of a property on each click, between true (1) and false (0).

<binding>
 <command>property-toggle</command>
 <property>/controls/gear/gear-down</property>
</binding>

Or if defined it toggles between two values.

<binding>
 <command>property-toggle</command>
 <property>/controls/gear/gear-down</property>
 <value>2</value>
 <value>3</value>
</binding>