And now comes the attachment... Sorry.

Vassilii
Index: ../data/Input/Joysticks/CH/pro-yoke-usb.xml
===================================================================
RCS file: /var/cvs/FlightGear-0.9/data/Input/Joysticks/CH/pro-yoke-usb.xml,v
retrieving revision 1.19
diff -u -p -r1.19 pro-yoke-usb.xml
--- ../data/Input/Joysticks/CH/pro-yoke-usb.xml 22 Jun 2005 13:08:02 -0000      
1.19
+++ ../data/Input/Joysticks/CH/pro-yoke-usb.xml 14 Dec 2005 20:17:06 -0000
@@ -4,6 +4,33 @@
 
  <name>CH PRODUCTS CH FLIGHT SIM YOKE USB </name>
  <name>CH FLIGHT SIM YOKE USB </name>
+ <nasal>
+  <script><![CDATA[
+       view_mod = 0;
+       reset_view = func {
+         setprop("/sim/current-view/field-of-view", 
+               getprop("/sim/view/config/default-field-of-view-deg"));
+         view_mod = 0;
+       }
+       if (props.globals.getNode("/rotors") != nil) {
+               disable_pref = 
+                       
props.globals.getNode("/input/joysticks/disable-cyclic-yoke");
+               if (disable_pref != nil and disable_pref.getBoolValue()) {
+                        grove = props.globals.getNode(this);
+                        
+                        grove.getNode("axis[0]").removeChildren("binding");
+                        grove.getNode("axis[1]").removeChildren("binding");
+               }
+               else {
+                       print ("Forcing cyclic control with your yoke. Change 
by adding\n"
+                       ~ "\t<disable-cyclic-yoke 
type=\"bool\">true</disable-cyclic-yoke>"
+                       ~ "\nto your joysticks.xml (the buttons/collective 
control will still work then!)\n");
+               }
+       }
+  ]]>
+  </script>
+ </nasal>
+
 
  <axis n="0">
   <desc>Aileron</desc>
@@ -110,7 +137,7 @@
    <binding>
     <command>property-adjust</command>
     <property>/sim/current-view/goal-pitch-offset-deg</property>
-    <step type="double">2.0</step>
+    <step type="double">-2.0</step>
    </binding>
   </low>
   <high>
@@ -118,29 +145,25 @@
    <binding>
     <command>property-adjust</command>
     <property>/sim/current-view/goal-pitch-offset-deg</property>
-    <step type="double">-2.0</step>
+    <step type="double">2.0</step>
    </binding>
   </high>
  </axis>
 
  <button n="0">
-<desc>Fire Starter on Selected Engine(s)</desc>
+  <repeatable>false</repeatable>
+  <desc>Scroll in reverse through views.</desc>
   <binding>
    <command>nasal</command>
-   <script>controls.startEngine()</script>
+   <script>view.stepView(-1)</script>
   </binding>
-  <mod-up>
-   <binding>
-    <command>nasal</command>
-    <script>props.setAll("/controls/engines/engine", "starter", 0)</script>
-   </binding>
-  </mod-up> 
  </button>
 
 <button n="1">
   <repeatable>false</repeatable>
   <binding>
-   <command>view-cycle</command>
+   <command>nasal</command>
+   <script>view.stepView(1)</script>
   </binding>
  </button>
 
@@ -221,31 +244,46 @@
  </button>
 
  <button n="8">
-  <repeatable>true</repeatable>
-   <binding>
-    <command>property-adjust</command>
-    <property>/controls/engines/engine[0]/boost</property>
-    <step type="double">+0.01</step>
-   </binding>
+  <desc>Decrease field of view.</desc>
+  <repeatable type="bool">false</repeatable>
+  <binding>
+   <command>nasal</command>
+   <script><![CDATA[
+     view.decrease(); 
+     if(view_mod>0) { reset_view(); } else { view_mod = -1; }
+   ]]>
+   </script>
+  </binding>
+  <mod-up>
    <binding>
-    <command>property-adjust</command>
-    <property>/controls/engines/engine[1]/boost</property>
-    <step type="double">+0.01</step>
+    <command>nasal</command>
+    <script><![CDATA[
+      if (view_mod<0) { view_mod += 1;} 
+    ]]></script>
    </binding>
+  </mod-up>
  </button>
 
  <button n="9">
-  <repeatable>true</repeatable>
-   <binding>
-    <command>property-adjust</command>
-    <property>/controls/engines/engine[0]/boost</property>
-    <step type="double">-0.01</step>
-   </binding>
+  <desc>Increase field of view.</desc>
+  <repeatable type="bool">false</repeatable>
+  <binding>
+   <command>nasal</command>
+   <script><![CDATA[ 
+        view.increase(); 
+       if(view_mod<0) { reset_view(); } else { view_mod = 1; }
+   ]]>
+   </script>
+  </binding>
+  <mod-up>
    <binding>
-    <command>property-adjust</command>
-    <property>/controls/engines/engine[1]/boost</property>
-    <step type="double">-0.01</step>
+    <command>nasal</command>
+    <script><![CDATA[ 
+       if (view_mod>0) { view_mod -= 1;} 
+    ]]>
+    </script>
    </binding>
+  </mod-up>
  </button>
 
   <button n="10">
Index: ../data/joysticks.xml
===================================================================
RCS file: /var/cvs/FlightGear-0.9/data/joysticks.xml,v
retrieving revision 1.34
diff -u -p -r1.34 joysticks.xml
--- ../data/joysticks.xml       24 Nov 2005 13:04:31 -0000      1.34
+++ ../data/joysticks.xml       14 Dec 2005 20:17:59 -0000
@@ -20,6 +20,7 @@
 
        <js n="0" include="Input/Joysticks/Local/joystick_0.xml"/>
 -->
+       <disable-cyclic-yoke type="bool">false<disable-cyclic-yoke>
 
        <js-named/> <!-- dummy to keep SimGear happy -->
 </PropertyList>
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to