Bindings: Difference between revisions

Jump to navigation Jump to search
1,353 bytes added ,  10 June 2011
no edit summary
(looks like property-set has been replaced with property-assign)
No edit summary
Line 9: Line 9:


== Commands ==
== Commands ==
=== dialog-close ===
Closes the active dialog.
<binding>
  <command>dialog-close</command>
</binding>
=== dialog-show ===
=== dialog-show ===
Shows a dialog, which should be present in <tt>[[$FG ROOT]]/gui/Dialogs</tt>.  
Shows a dialog, which should be present in <tt>[[$FG ROOT]]/gui/Dialogs</tt>.  
Line 32: Line 38:
   <min>0</min>
   <min>0</min>
   <max>1</max>
   <max>1</max>
</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>
  </binding>


Line 43: Line 57:
   <value type="string">OFF</value>
   <value type="string">OFF</value>
  </binding>
  </binding>
=== property-multiply ===
Multiply the value of a property by a given factor.
<binding>
  <command>property-multiply</command>
  <property>/controls/flight/aileron</property>
  <factor>0.5</factor>
  <min>-1</min>
  <max>1</max>
  <mask>all</mask>
  <wrap>true</wrap>
</binding>
*'''factor:''' the amount to multiply by.
*'''min:''' minimum value.
*'''max:''' maximum value.
*'''mask:'''
** '''integer:''' mutiply only left of the decimal point.
** '''decimal:''' multiply only the right of the decimal point.
** '''all:''' multiply the entire value.
*'''wrap:''' true if the value should be wrapped if it passes min/max. It is required to set both min and max in that case.


=== property-randomize ===
=== property-randomize ===
Line 53: Line 87:
  </binding>
  </binding>


=== property-set ===
=== property-scale ===
'''''This command appears to be deprecated since V2.0'''''
Sett the value of a property based on an axis, often used in [[joystick]] configuration files.
<del>One of the most important commands. It sets a property to a predefined value.
<code>
  <binding>
  <binding>
   <command>property-set</command>
   <command>property-scale</command>
   <property>/autopilot/settings/target-speed-kt</property>
   <property>/controls/flight/aileron</property>
   <value>0</value>
   <offset>0.001</offset>
  <factor>-1</factor>
  <power>3</power>
  </binding>
  </binding>
</code>
</del>


=== property-assign ===
* '''offset:''' the offset to shift by, before applying the factor.
One of the most important commands. It sets a property to a predefined value.
* '''factor:''' the factor to multiply by (use negative to reverse).
<binding>
* '''squared:''' if true will square the resulting value (same as power=2).
  <command>property-assign</command>
* '''power:''' the resulting value will be taken to the power of this integer value (overrides squared).
  <property>/autopilot/settings/target-speed-kt</property>
 
  <value>0</value>
Remember: <tt>((property+offset)*factor)^power=result</tt>
</binding>


=== property-swap ===
=== property-swap ===
Swaps the values of two properties.
Swaps the values of two properties, useful for radio panels.
  <binding>
  <binding>
   <command>property-swap</command>
   <command>property-swap</command>
Line 87: Line 118:
   <property>/controls/gear/gear-down</property>
   <property>/controls/gear/gear-down</property>
  </binding>
  </binding>
Or if defined it toggles between two values.
Or - if defined - it toggles between two custom values.
  <binding>
  <binding>
   <command>property-toggle</command>
   <command>property-toggle</command>
Line 94: Line 125:
   <value>3</value>
   <value>3</value>
  </binding>
  </binding>
== Related content ==
* <tt>[[$FG_ROOT]]/Docs/README.commands</tt> [https://gitorious.org/fg/fgdata/blobs/master/Docs/README.commands view online]
* [[Howto: Make a clickable panel]]

Navigation menu