Board index FlightGear Support Hardware

New rascal bindings

Joysticks, pedals, monitors.

New rascal bindings

Postby Philosopher » Fri Oct 05, 2012 5:05 pm

A couple months ago, I decided that the normal function of the arrow keys slewing/interpolating the controls was rather unwieldy, so I decided to create my own bindings. I modeled them after the RealFlight trial version bindings, a program I had used a long time ago. Instead of slewing, it just set the controls to full when an arrow was held, e.g. holding right arrow would set the aileron to full right and mod-up would center aileron. They work great, as full aileron doesn't correspond to much of a roll rate on the Rascal. Now on the Zlin and Extra, it's a greater challenge :D. Also note that 0 is throttle "cut", 1-9 is increasing throttle, and q & w are rudder left and right, respectively. "Flat" turns with rudder and aileron are actually possible, just as long as you keep tapping the aileron. It might be easier for me on my nice Mac keyboard, waffle-thin keys, you know?

To use: simply copy-and-paste into the file "$FG_ROOT/Aircraft/Rascal/Rascal-keyboard.xml", overwriting the previous contents. I don't see a keyboard include in the Rascal110-YASIM-set.xml for some reason, I guess I've always used the JSBsim one which does have a keyboard include :?: I can't use Flightgear right now, I will check it out as soon as I can. Anyways, here's the file, tell me if you like it:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<PropertyList>

  <key n="9">
    <name>Ctrl-I</name>
    <desc>Show configuration dialog</desc>
    <binding>
      <command>nasal</command>
      <script>rascal.dialog.toggle()</script>
    </binding>
  </key>

 <key n="113">
  <name>q</name>
  <desc>Rudder left</desc>
    <binding>
      <command>nasal</command>
      <script>
        setprop("/controls/flight/rudder", -1)
      </script>
    </binding>
    <mod-up>
      <binding>
        <command>nasal</command>
        <script>
          setprop("/controls/flight/rudder", 0)
        </script>
      </binding>
    </mod-up>
 </key>

 <key n="119">
  <name>w</name>
  <desc>Rudder right</desc>
    <binding>
      <command>nasal</command>
      <script>
        setprop("/controls/flight/rudder", 1)
      </script>
    </binding>
    <mod-up>
      <binding>
        <command>nasal</command>
        <script>
          setprop("/controls/flight/rudder", 0)
        </script>
      </binding>
    </mod-up>
 </key>

  <key n="83">
    <name>S</name>
    <desc>Toggle smoke</desc>
    <binding>
      <command>property-toggle</command>
      <property>sim/multiplay/generic/int[0]</property>
    </binding>
  </key>

  <key n="356">
    <name>Left</name>
    <desc>Move aileron left (or adjust AP heading.)</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
      <command>nasal</command>
      <script>
        #controls.incAileron(-0.05, -1.0)
        setprop("/controls/flight/aileron", -1)
      </script>
    </binding>
    <mod-shift>
      <desc>Look left</desc>
      <binding>
        <command>property-assign</command>
        <property>/sim/current-view/goal-heading-offset-deg</property>
        <property>/sim/view/config/left-direction-deg</property>
      </binding>
    </mod-shift>
    <mod-up>
      <binding>
        <command>nasal</command>
        <script>
          setprop("/controls/flight/aileron", 0)
        </script>
      </binding>
    </mod-up>
 </key>

 <key n="357">
  <name>Up</name>
  <desc>Increase elevator or autopilot altitude</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>
     #controls.incElevator(0.05, -100)
     setprop("/controls/flight/elevator", 1)
   </script>
  </binding>
  <mod-shift>
   <desc>Look forward</desc>
   <binding>
    <command>property-assign</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <property>/sim/view/config/front-direction-deg</property>
   </binding>
  </mod-shift>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>
      setprop("/controls/flight/elevator", 0)
    </script>
   </binding>
  </mod-up>
 </key>

 <key n="358">
  <name>Right</name>
  <desc>Move aileron right (or adjust AP heading.)</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>
     #controls.incAileron(0.05, 1.0)
     setprop("/controls/flight/aileron", 1)
   </script>
   <step type="double">0.05</step>
  </binding>
  <mod-shift>
   <desc>Look right</desc>
   <binding>
    <command>property-assign</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <property>/sim/view/config/right-direction-deg</property>
   </binding>
  </mod-shift>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>
      setprop("/controls/flight/aileron", 0)
    </script>
   </binding>
  </mod-up>
 </key>

 <key n="359">
  <name>Down</name>
  <desc>Decrease elevator or autopilot altitude</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>
     #controls.incElevator(-0.05, 100)
     setprop("/controls/flight/elevator", -1)
   </script>
  </binding>
  <mod-shift>
   <desc>Look backwards</desc>
   <binding>
    <command>property-assign</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <property>/sim/view/config/back-direction-deg</property>
   </binding>
  </mod-shift>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>
      setprop("/controls/flight/elevator", 0)
    </script>
   </binding>
  </mod-up>
 </key>

 <key n="48">
  <name>0</name>
  <desc>Cut Throttle</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <value>0</value>
  </binding>
 </key>

 <key n="49">
  <name>1</name>
  <desc>Set Throttle to 0.1</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <value>0.1</value>
  </binding>
 </key>

 <key n="50">
  <name>2</name>
  <desc>Set Throttle to 0.2</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <property>/controls/engines/engine[1]/throttle</property>
   <value>0.2</value>
  </binding>
 </key>

 <key n="51">
  <name>3</name>
  <desc>Set Throttle to 0.3</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <value>0.3</value>
  </binding>
 </key>

 <key n="52">
  <name>4</name>
  <desc>Set Throttle to 0.5</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <value>0.5</value>
  </binding>
 </key>

 <key n="53">
  <name>5</name>
  <desc>Set Throttle to 0.6</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <value>0.6</value>
  </binding>
 </key>

 <key n="54">
  <name>6</name>
  <desc>Set Throttle to 0.7</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <value>0.7</value>
  </binding>
 </key>

 <key n="55">
  <name>7</name>
  <desc>Set Throttle to 0.8</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <value>0.8</value>
  </binding>
 </key>

 <key n="56">
  <name>8</name>
  <desc>Set Throttle to 0.9</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <value>0.9</value>
  </binding>
 </key>

 <key n="57">
  <name>9</name>
  <desc>Set Throttle to 1</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/engines/engine/throttle</property>
   <value>1</value>
  </binding>
 </key>

</PropertyList>


EDIT and P.S. @Mods: I'm not sure if this is supposed to go here with joystick bindings or in Development/Aircraft. Feel free to move as you see fit.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Return to Hardware

Who is online

Users browsing this forum: No registered users and 1 guest