Board index FlightGear Development New features

New mice.xml and keyboard.xml for mouse and keyboard users

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

New mice.xml and keyboard.xml for mouse and keyboard users

Postby Merik » Thu Jan 27, 2011 10:43 pm

Introduction

If you don't have a joystick and use mouse and keyboard to fly (like me), here is a new version of mouse and keyboard setting files, which helps you have a better flight experience.

Warning
Please make sure you keep a backup of your original mice.xml and keyboard.xml files. I suggest you keep a copy of them with a different name (such as mice.original.xml and keyboard.original.xml). You can find these files in $FG_ROOT folder (in Windows, it is C:\Program Files\FlightGear\data\ or a similar path).

Benefits of using these files
These are the features of the new mice.xml:

  • It doesn't have three modes! In fact, I found the third mode (view only) unnecessary because you can look around in mode 1 by holding the right mouse button
  • When in mode 0, you can click on panel objects
  • Pressing right mouse button takes you to mode 1
  • Pressing middle mouse button takes you back to mode 0
  • When in mode 1, you can control the ailerons and elevator as usual. You don't see the unnecessary cross-hair mouse cursor though :)
  • Additionally, if you hold left mouse button, you can control the rudder and the elevator. It means, when you're landing, you can hold the left mouse button down and control both the rudder (to align with the runway) and the elevator (to control your speed and do the final flare).
  • When in mode 1, mouse wheel will allow you to adjust rudder. This way, you can control rudder, elevator and ailerons all at the same time using the mouse! (Thank you suto for suggesting that).
  • When in mode 1, holding the left mouse button and moving mouse wheel will allow you to adjust elevator trim. This is a feature I really missed for a long time until I learned how to fix it myself.
  • When in mode 1, you can hold the right mouse button and move the mouse to look around. Once you release the right button, you'll be looking forward again!
  • Additionally, once you release the right button, you're zoom level is not reset! This was a problem with the mice.xml I linked in the beginning of this post.

These are the features of the keyboard.xml:

  • The left and right arrows control the rudder if you hold CTRL key.
  • The 0 button resets the rudder. Since mouse users (unlike joystick users) have no direct way to make sure they've returned their rudder to neutral position when they want to, they can try to return it to [i]almost[i]-neutral position and then hit 0 (on the numeric section or the top digits row) to make the rudders completely neutral
  • Pressing CTRL+5 resets the elevator trim to neutral position
  • Pressing F4 shows the GPS dialog

There are also two features suitable for C172P users (credit goes to Farmboy and Chrison):
  • Pressing F2 will move the view point to the center and zoom in, so you can read the compass easily
  • Pressing F3 will move the view point and zoom in so you can modify the directional gyro easily
  • Pressing F1 will move you back to the original place (pilot view)

Codes

Finally, here are the codes:

mice.xml
Code: Select all
<?xml version="1.0"?>
<PropertyList>
 <mouse n="0">
  <mode-count type="int">2</mode-count>
  <mode archive="y" type="int">0</mode>
  <mode n="0">
   <cursor>inherit</cursor>
   <constrained type="bool">false</constrained>
   <pass-through type="bool">true</pass-through>
   <button n="2">
    <binding>
     <command>property-assign</command>
     <property>/devices/status/mice/mouse[0]/mode</property>
     <value type="int">1</value>
    </binding>
   </button>
  </mode>
  <mode n="1">
   <cursor>none</cursor>
   <constrained type="bool">true</constrained>
   <pass-through type="bool">true</pass-through>
   <button n="1">
    <binding>
     <command>property-assign</command>
     <property>/devices/status/mice/mouse[0]/mode</property>
     <value type="int">0</value>
    </binding>
   </button>
   <button n="2">
    <binding>
     <command>nasal</command>
     <script>
      view.resetViewDir();
     </script>
    </binding>
    <binding>
     <condition>
      <property>/devices/status/mice/mouse[0]/button[1]</property>
     </condition>
     <command>nasal</command>
     <script>
      view.resetViewPos();
     </script>
    </binding>
   </button>
   <!-- Mouse left/right motion. -->
   <x-axis>
    <!-- No buttons pressed: control ailerons -->
    <binding>
     <condition>
      <and>
       <not>
        <property>/devices/status/mice/mouse[0]/button[0]</property>
       </not>
       <not>
        <property>/devices/status/mice/mouse[0]/button[1]</property>
       </not>
       <not>
        <property>/devices/status/mice/mouse[0]/button[2]</property>
       </not>
      </and>
     </condition>
     <command>property-adjust</command>
     <property>/controls/flight/aileron</property>
     <factor type="double">2.0</factor>
     <min type="double">-1.0</min>
     <max type="double">1.0</max>
     <wrap type="bool">false</wrap>
    </binding>
    <!-- Right button pressed: rotate the view left or right -->
    <binding>
     <condition>
      <and>
       <property>/devices/status/mice/mouse[0]/button[2]</property>
       <not>
        <property>/devices/status/mice/mouse[0]/button[0]</property>
       </not>
      </and>
     </condition>
     <command>property-adjust</command>
     <property>/sim/current-view/heading-offset-deg</property>
     <factor type="double">-360</factor>
     <min type="double">0</min>
     <max type="double">360</max>
     <wrap type="bool">true</wrap>
    </binding>
   </x-axis>
   <!-- Mouse up/down motion -->
   <y-axis>
    <!-- No buttons pressed: control elevator -->
    <binding>
     <condition>
      <and>
       <not>
        <property>/devices/status/mice/mouse[0]/button[0]</property>
       </not>
       <not>
        <property>/devices/status/mice/mouse[0]/button[1]</property>
       </not>
       <not>
        <property>/devices/status/mice/mouse[0]/button[2]</property>
       </not>
      </and>
     </condition>
     <command>property-adjust</command>
     <property>/controls/flight/elevator</property>
     <factor type="double">-2.0</factor>
     <min type="double">-1.0</min>
     <max type="double">1.0</max>
     <wrap type="bool">false</wrap>
    </binding>
    <!-- Left button pressed: also control elevator -->
    <binding>
     <condition>
      <and>
       <property>/devices/status/mice/mouse[0]/button[0]</property>
       <not>
        <property>/devices/status/mice/mouse[0]/button[1]</property>
       </not>
      </and>
     </condition>
     <command>property-adjust</command>
     <property>/controls/flight/elevator</property>
     <factor type="double">-2.0</factor>
     <min type="double">-1.0</min>
     <max type="double">1.0</max>
     <wrap type="bool">false</wrap>
    </binding>
    <!-- Right button pressed: tilt the view up and down -->
    <binding>
     <condition>
      <and>
       <property>/devices/status/mice/mouse[0]/button[2]</property>
       <not>
        <property>/devices/status/mice/mouse[0]/button[0]</property>
       </not>
      </and>
     </condition>
     <command>property-adjust</command>
     <property>/sim/current-view/pitch-offset-deg</property>
     <factor type="double">-180</factor>
     <min type="double">-90</min>
     <max type="double">90</max>
     <wrap type="bool">false</wrap>
    </binding>
   </y-axis>
   <!-- Mouse wheel controls rudder -->
   <!-- Mouse wheel AND left button controls elevator trim -->
   <button n="3">
    <binding>
    <condition>
      <not>
       <property>/devices/status/mice/mouse[0]/button[0]</property>
       </not>
     </condition>
     <command>property-adjust</command>
     <property>/controls/flight/rudder</property>
     <step type="double">-0.025</step>
    </binding>
   <binding>
    <condition>
      <and>
       <property>/devices/status/mice/mouse[0]/button[0]</property>
       </and>
     </condition>
     <command>property-adjust</command>
     <property>/controls/flight/elevator-trim</property>
     <step type="double">0.025</step>
    </binding>
   </button>
   <button n="4">
    <binding>
    <condition>
      <not>
       <property>/devices/status/mice/mouse[0]/button[0]</property>
       </not>
     </condition>
     <command>property-adjust</command>
     <property>/controls/flight/rudder</property>
     <step type="double">0.025</step>
    </binding>
   <binding>
    <condition>
      <and>
       <property>/devices/status/mice/mouse[0]/button[0]</property>
       </and>
     </condition>
     <command>property-adjust</command>
     <property>/controls/flight/elevator-trim</property>
     <step type="double">-0.025</step>
    </binding>
   </button>
  </mode>
 </mouse>
</PropertyList>


keyboard.xml
Code: Select all
<?xml version="1.0"?>
<PropertyList>
<nasal>
  <script>
     # /devices/status/keyboard/event/modifier/ and /devices/status/keyboard/
     # don't only have one BOOL child per modifier, but also contain the
     # modifier bitmap themselves, using these bit values:
     var mod = { shift: 1, ctrl: 2, alt: 4, meta: 8, super: 16, hyper: 32 };

     var modifiers = props.globals.getNode("/devices/status/keyboard");
     var shift = props.globals.getNode("/devices/status/keyboard/shift");
     var ctrl = props.globals.getNode("/devices/status/keyboard/ctrl");
     var alt = props.globals.getNode("/devices/status/keyboard/alt");

     var space_release = func nil;
     var space = func(state, mod) {
        if (!state) {
           space_release();
           return space_release = func nil;
        }
        if (mod == 0 or mod == 1) {
           controls.ptt(mod + 1);
           space_release = func controls.ptt(0);
        }
     }

     ## uncomment this line to get keycode reports printed to the terminal window
     #setlistener("devices/status/keyboard/event", func(n) debug.dump(n.getValues()));
  </script>
</nasal>

<key n="1">
  <name>Ctrl-A</name>
  <desc>Toggle autopilot altitude lock</desc>
  <binding>
   <command>nasal</command>
   <script>
    var node = props.globals.getNode("/autopilot/locks/altitude", 1);
    if ( node.getValue() == "altitude-hold" ) {
      node.setValue( "" );
    } else {
      node.setValue( "altitude-hold" );
    }
   </script>
  </binding>
</key>

<key n="2">
  <name>Ctrl-B</name>
  <desc>Toggle speedbrake</desc>
  <binding>
   <command>property-toggle</command>
   <property>/controls/flight/speedbrake</property>
  </binding>
</key>

<key n="3">
  <name>Ctrl-C</name>
  <desc>Toggle clickable panel hotspots</desc>
  <binding>
   <command>property-toggle</command>
   <property>/sim/panel-hotspots</property>
  </binding>
</key>

<key n="7">
  <name>Ctrl-G</name>
  <desc>Toggle autopilot glide slope lock</desc>
  <binding>
   <command>nasal</command>
   <script>
    var node = props.globals.getNode("/autopilot/locks/altitude", 1);
    if ( node.getValue() == "gs1-hold" ) {
      node.setValue( "" );
    } else {
      node.setValue( "gs1-hold" );
    }
   </script>
  </binding>
</key>

<key n="8">
  <name>Ctrl-H</name>
  <desc>Toggle autopilot heading lock</desc>
  <binding>
   <command>nasal</command>
   <script>
    var node = props.globals.getNode("/autopilot/locks/heading", 1);
    if ( node.getValue() == "dg-heading-hold" ) {
      node.setValue( "" );
    } else {
      node.setValue( "dg-heading-hold" );
    }
   </script>
  </binding>
</key>

<key n="10"> <!-- OSG -->
  <name>Enter</name>
  <!--<desc>Reset evelator trim</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-assign</command>
   <property>/controls/flight/elevator-trim</property>
   <value>0</value>
  </binding>-->
</key>

<key n="13"> <!-- PLIB -->
  <name>Enter</name>
  <!--<desc>Reset elevator trim</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-assign</command>
   <property>/controls/flight/elevator-trim</property>
   <value>0</value>
  </binding>-->
</key>

<key n="14">
  <name>Ctrl-N</name>
  <desc>Toggle autopilot nav1 lock</desc>
  <binding>
   <command>nasal</command>
   <script>
    var node = props.globals.getNode("/autopilot/locks/heading", 1);
    if ( node.getValue() == "nav1-hold" ) {
      node.setValue( "" );
    } else {
      node.setValue( "nav1-hold" );
    }
   </script>
  </binding>
</key>

<key n="16">
  <name>Ctrl-P</name>
  <desc>Toggle pitch hold</desc>
  <binding>
   <command>nasal</command>
   <script>
    var node = props.globals.getNode("/autopilot/locks/altitude", 1);
    if ( node.getValue() == "pitch-hold" ) {
      node.setValue( "" );
    } else {
      node.setValue( "pitch-hold" );
      var pitch = props.globals.getNode("/autopilot/settings/target-pitch-deg", 1);
      pitch.setValue( getprop("/orientation/pitch-deg") );
    }
   </script>
  </binding>
</key>

<key n="18">
  <name>Ctrl-R</name>
  <desc>Activate the instant replay system</desc>
  <binding>
   <command>replay</command>
  </binding>
</key>

<key n="19">
  <name>Ctrl-S</name>
  <desc>Toggle auto-throttle lock</desc>
  <binding>
   <command>nasal</command>
   <script>
    var node = props.globals.getNode("/autopilot/locks/speed", 1);
    if ( node.getValue() == "speed-with-throttle" ) {
      node.setValue( "" );
    } else {
      node.setValue( "speed-with-throttle" );
    }
   </script>
  </binding>
</key>

<key n="20">
  <name>Ctrl-T</name>
  <desc>Toggle autopilot terrain lock</desc>
  <binding>
   <command>nasal</command>
   <script>
    var node = props.globals.getNode("/autopilot/locks/altitude", 1);
    if ( node.getValue() == "agl-hold" ) {
      node.setValue( "" );
    } else {
      node.setValue( "agl-hold" );
      var agl = props.globals.getNode("/autopilot/settings/target-agl-ft", 1);
      agl.setValue( getprop("/position/altitude-agl-ft") );
    }
   </script>
  </binding>
</key>

<key n="21">
  <name>Ctrl-U</name>
  <desc>[Cheat] Add 1000ft of emergency altitude</desc>
  <binding>
   <command>property-adjust</command>
   <property>/position/altitude-ft</property>
   <step type="double">1000.0</step>
  </binding>
  <binding>
   <command>property-assign</command>
   <property>/sim/startup/onground</property>
   <value type="bool">false</value>
  </binding>
</key>

<key n="22">
  <name>Ctrl-V</name>
  <desc>Select initial view (view 0)</desc>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/view-number</property>
   <value>0</value>
  </binding>
</key>

<key n="23">
  <name>Ctrl-W</name>
  <desc>Toggle autopilot wing leveler</desc>
  <binding>
   <command>nasal</command>
   <script>
    var node = props.globals.getNode("/autopilot/locks/heading", 1);
    if ( node.getValue() == "wing-leveler" ) {
      node.setValue( "" );
    } else {
      node.setValue( "wing-leveler" );
    }
   </script>
  </binding>
</key>

<key n="24">
  <name>Ctrl-X</name>
  <desc>Reset zoom to default</desc>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/field-of-view</property>
   <property>/sim/view/config/default-field-of-view-deg</property>
  </binding>
</key>

<key n="27">
  <name>ESC</name>
  <desc>Prompt and quit FlightGear</desc>
  <binding>
   <command>dialog-show</command>
   <dialog-name>exit</dialog-name>
  </binding>
  <mod-shift>
   <desc>Reset FlightGear</desc>
   <binding>
   <command>reset</command>
   </binding>
  </mod-shift>
</key>

<key n="32">
  <name>SPACE</name>
  <desc>PTT - Push To Talk (via VoIP)</desc>
  <binding>
   <command>nasal</command>
   <script>space(1, modifiers.getValue())</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>space(0, modifiers.getValue())</script>
   </binding>
  </mod-up>
  <mod-shift>
   <binding>
   <command>nasal</command>
   <script>space(1, modifiers.getValue())</script>
   </binding>
   <mod-up>
   <binding>
    <command>nasal</command>
    <script>space(0, modifiers.getValue())</script>
   </binding>
   </mod-up>
  </mod-shift>
</key>

<key n="33">
  <name>!</name>
  <desc>Select first engine</desc>
  <binding>
   <command>nasal</command>
   <script>controls.selectEngine(0)</script>
  </binding>
</key>

<key n="35">
  <name>#</name>
  <desc>Select third engine</desc>
  <binding>
   <command>nasal</command>
   <script>controls.selectEngine(2)</script>
  </binding>
</key>

<key n="36">
  <name>$</name>
  <desc>Select fourth engine</desc>
  <binding>
   <command>nasal</command>
   <script>controls.selectEngine(3)</script>
  </binding>
</key>

<key n="39">
  <name>'</name>
  <desc>Display a dialog relevant to the tuned in ATC service (if any)</desc>
  <binding>
   <command>ATC-dialog</command>
  </binding>
</key>

<key n="43">
  <name>+</name>
  <desc>Let ATC/instructor repeat last message</desc>
  <binding>
   <command>nasal</command>
   <script>screen.msg_repeat()</script>
  </binding>
</key>

<key n="44">
  <name>,</name>
  <desc>Left brake</desc>
  <binding>
   <command>nasal</command>
   <script>controls.applyBrakes(1, -1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.applyBrakes(0, -1)</script>
   </binding>
  </mod-up>
</key>

<key n="45">
  <name>-</name>
  <repeatable type="bool">false</repeatable>
  <desc>Chat Menu</desc>
  <binding>
    <command>dialog-show</command>
    <dialog-name>chat-menu</dialog-name>
  </binding>
</key>

<key n="46">
  <name>.</name>
  <desc>Right brake</desc>
  <binding>
   <command>nasal</command>
   <script>controls.applyBrakes(1, 1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.applyBrakes(0, 1)</script>
   </binding>
  </mod-up>
</key>

<key n="47">
  <name>/</name>
  <desc>Open property browser</desc>
  <binding>
   <condition>
   <not>
    <property>/sim/input/property-key-handler</property>
   </not>
   </condition>
   <command>nasal</command>
   <script>gui.property_browser()</script>
  </binding>
  <binding>
   <condition>
   <property>/sim/input/property-key-handler</property>
   </condition>
   <command>nasal</command>
   <script>prop_key_handler.start()</script>
  </binding>
</key>

<key n="48">
  <name>0</name>
  <desc>Reset rudder</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-assign</command>
   <property>/controls/flight/rudder</property>
   <value>0</value>
  </binding>
</key>

<key n="49">
  <name>1</name>
  <desc>Decrease elevator trim</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/elevator-trim</property>
   <step type="double">-0.001</step>
  </binding>
  <mod-shift>
   <desc>Look back left</desc>
   <binding>
    <command>property-assign</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <property>/sim/view/config/back-left-direction-deg</property>
   </binding>
  </mod-shift>
</key>

<key n="50">
  <name>2</name>
  <desc>Increase elevator or autopilot altitude</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>
    controls.incElevator(-0.05, 100)
   </script>
  </binding>
  <mod-shift>
   <desc>Look back</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>
</key>

<key n="51">
  <name>3</name>
  <desc>Decrease throttle or autopilot autothrottle</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>
    controls.incThrottle(-0.01, -1.0)
   </script>
  </binding>
  <mod-shift>
   <desc>Look back right</desc>
   <binding>
   <command>property-assign</command>
   <property>/sim/current-view/goal-heading-offset-deg</property>
   <property>/sim/view/config/back-right-direction-deg</property>
   </binding>
  </mod-shift>
</key>

<key n="52">
  <name>4</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)
   </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>
</key>

<key n="53">
  <name>5</name>
  <desc>Center aileron, elevator, and rudder</desc>
  <binding>
   <command>nasal</command>
   <script>controls.centerFlightControls()</script>
  </binding>
  <mod-ctrl>
   <desc>Center elevator trim</desc>
   <binding>
    <command>property-assign</command>
    <property>/controls/flight/elevator-trim</property>
    <value>0</value>
   </binding>
  </mod-ctrl>
</key>

<key n="54">
  <name>6</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)
   </script>
  </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>
</key>

<key n="55">
  <name>7</name>
  <desc>Increase elevator trim</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/elevator-trim</property>
   <step type="double">0.001</step>
  </binding>
  <mod-shift>
   <desc>Look front left</desc>
   <binding>
   <command>property-assign</command>
   <property>/sim/current-view/goal-heading-offset-deg</property>
   <property>/sim/view/config/front-left-direction-deg</property>
   </binding>
  </mod-shift>
</key>

<key n="56">
  <name>8</name>
  <desc>Decrease elevator or autopilot altitude</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>
    controls.incElevator(0.05, -100)
   </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>
</key>

<key n="57">
  <name>9</name>
  <desc>Increase throttle or autopilot autothrottle</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
  <command>nasal</command>
   <script>
    controls.incThrottle(0.01, 1.0)
   </script>
  </binding>
  <mod-shift>
   <desc>Look front right</desc>
   <binding>
   <command>property-assign</command>
   <property>/sim/current-view/goal-heading-offset-deg</property>
   <property>/sim/view/config/front-right-direction-deg</property>
   </binding>
  </mod-shift>
</key>

<key n="58">
  <name>:</name>
  <desc>Start multikey command</desc>
  <binding>
   <command>nasal</command>
   <script>multikey.start()</script>
  </binding>
</key>

<key n="63">
  <name>?</name>
  <desc>Show help dialog</desc>
  <binding>
   <command>nasal</command>
   <script>gui.showHelpDialog("/sim/help", 1)</script>
  </binding>
</key>

<key n="64">
  <name>@</name>
  <desc>Select second engine</desc>
  <binding>
   <command>nasal</command>
   <script>controls.selectEngine(1)</script>
  </binding>
</key>

<key n="65">
  <name>A</name>
  <desc>Decrease speed-up</desc>
  <binding>
   <command>property-adjust</command>
   <property>/sim/speed-up</property>
   <min>1</min>
   <step type="double">-1</step>
  </binding>
</key>

<key n="66">
  <name>B</name>
  <desc>Toggle parking brake on or off</desc>
  <binding>
   <command>nasal</command>
   <script>controls.applyParkingBrake(1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.applyParkingBrake(0)</script>
   </binding>
  </mod-up>
</key>

<key n="71">
  <name>G</name>
  <desc>Gear down</desc>
  <binding>
   <command>nasal</command>
   <script>controls.gearDown(1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.gearDown(0)</script>
   </binding>
  </mod-up>
</key>

<key n="72">
  <name>H</name>
  <desc>Cycle HUD Brightness</desc>
  <binding>
   <command>nasal</command>
   <script>aircraft.HUD.cycle_brightness()</script>
  </binding>
</key>

<key n="73">
  <name>I</name>
  <desc>Switch to and toggle alternative HUD types</desc>
  <binding>
   <command>nasal</command>
   <script>aircraft.HUD.cycle_type()</script>
  </binding>
</key>

<key n="77">
  <name>M</name>
  <desc>Mixture leaner</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.adjMixture(-1)</script>
  </binding>
</key>

<key n="78">
  <name>N</name>
  <desc>Propeller Coarser</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.adjPropeller(-1)</script>
  </binding>
</key>

<key n="80">
  <name>P</name>
  <desc>Toggle panel</desc>
  <binding>
   <command>property-toggle</command>
   <property>/sim/panel/visibility</property>
  </binding>
</key>

<key n="83">
  <name>S</name>
  <desc>Swap panels</desc>
  <binding>
   <condition>
    <not>
    <property>/sim/allow-toggle-cockpit</property>
    </not>
   </condition>
   <command>property-swap</command>
   <property>/sim/panel/path</property>
   <property>/sim/panel_2/path</property>
  </binding>
  <binding>
   <condition>
    <not>
    <property>/sim/allow-toggle-cockpit</property>
    </not>
   </condition>
   <command>panel-load</command>
  </binding>
</key>

<key n="84">
  <name>T</name>
  <desc>Decrease warp delta</desc>
  <binding>
   <command>property-adjust</command>
   <property>/sim/time/warp-delta</property>
   <step type="int">-30</step>
  </binding>
</key>

<key n="86">
  <name>V</name>
  <desc>Scroll in reverse through views</desc>
  <binding>
   <command>nasal</command>
   <script>view.stepView(-1)</script>
  </binding>
</key>

<key n="87">
  <name>W</name>
  <desc>Decrease warp</desc>
  <binding>
   <command>property-adjust</command>
   <property>/sim/time/warp</property>
   <step type="int">-60</step>
  </binding>
</key>

<key n="88">
  <name>X</name>
  <desc>Increase field of view</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>view.increase()</script>
  </binding>
</key>

<key n="90">
  <name>Z</name>
  <desc>Decrease Visibility</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>decrease-visibility</command>
  </binding>
</key>

<key n="91">
  <name>[</name>
  <desc>Decrease flaps</desc>
  <binding>
   <command>nasal</command>
   <script>controls.flapsDown(-1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.flapsDown(0)</script>
   </binding>
  </mod-up>
</key>

<key n="93">
  <name>]</name>
  <desc>Increase flaps</desc>
  <binding>
   <command>nasal</command>
   <script>controls.flapsDown(1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.flapsDown(0)</script>
   </binding>
  </mod-up>
</key>

<key n="95">
  <name>_</name>
  <repeatable type="bool">false</repeatable>
  <desc>Compose Chat</desc>
  <binding>
   <command>nasal</command>
   <script>multiplayer.compose_message()</script>
  </binding>
</key>

<key n="97">
  <name>a</name>
  <desc>Increase speed-up</desc>
  <binding>
   <command>property-adjust</command>
   <property>/sim/speed-up</property>
   <min>1</min>
   <step type="double">1</step>
  </binding>
</key>

<key n="98">
  <name>b</name>
  <desc>Apply all brakes</desc>
  <binding>
   <command>nasal</command>
   <script>controls.applyBrakes(1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.applyBrakes(0)</script>
   </binding>
  </mod-up>
</key>

<key n="99">
  <name>c</name>
  <desc>Toggle 3D/2D cockpit</desc>
  <binding>
   <command>nasal</command>
   <script>
   if(getprop("/sim/allow-toggle-cockpit")) {
      setprop("/sim/current-view/internal", !getprop("/sim/current-view/internal"));
      setprop("/sim/view/internal", getprop("/sim/current-view/internal"));
      setprop("/sim/virtual-cockpit", !getprop("/sim/virtual-cockpit"));
      if(getprop("/sim/current-view/internal")) {
        setprop("/sim/current-view/heading-offset-deg", getprop("/sim/current-view/config/heading-offset-deg"));
        setprop("/sim/current-view/pitch-offset-deg", getprop("/sim/current-view/config/pitch-offset-deg"));
      } else {
        setprop("/sim/current-view/heading-offset-deg", 0);
        setprop("/sim/current-view/pitch-offset-deg", 0);
      }
   }
   </script>
  </binding>
</key>

<key n="103">
  <name>g</name>
  <desc>Gear Up</desc>
  <binding>
   <command>nasal</command>
   <script>controls.gearDown(-1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.gearDown(0)</script>
   </binding>
  </mod-up>
</key>

<key n="104">
  <name>h</name>
  <desc>HUD Master Switch</desc>
  <binding>
   <command>nasal</command>
   <script>aircraft.HUD.cycle_color()</script>
  </binding>
</key>

<key n="105">
  <name>i</name>
  <desc>Normal HUD</desc>
  <binding>
   <command>nasal</command>
   <script>aircraft.HUD.normal_type()</script>
  </binding>
</key>

<key n="106">
  <name>j</name>
  <desc>Decrease spoilers</desc>
  <binding>
   <command>nasal</command>
   <script>controls.stepSpoilers(-1)</script>
  </binding>
</key>

<key n="107">
  <name>k</name>
  <desc>Increase spoilers</desc>
  <binding>
   <command>nasal</command>
   <script>controls.stepSpoilers(1)</script>
  </binding>
</key>

<key n="108">
  <name>l</name>
  <desc>Toggle tail-wheel lock</desc>
  <binding>
   <command>property-toggle</command>
   <property>/controls/gear/tailwheel-lock</property>
  </binding>
</key>

<key n="109">
  <name>m</name>
  <desc>Mixture richer</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.adjMixture(1)</script>
  </binding>
</key>

<key n="110">
  <name>n</name>
  <desc>Propeller Finer</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.adjPropeller(1)</script>
  </binding>
</key>

<key n="112">
  <name>p</name>
  <desc>Toggle the pause state of the sim</desc>
  <binding>
   <command>property-toggle</command>
   <property>/sim/freeze/master</property>
  </binding>
  <binding>
   <command>property-toggle</command>
   <property>/sim/freeze/clock</property>
  </binding>
  <binding>
   <condition>
    <property>/sim/freeze/replay-state</property>
   </condition>
   <command>property-assign</command>
   <property>/sim/freeze/replay-state</property>
   <value type="int">0</value>
  </binding>
</key>

<key n="115">
  <name>s</name>
  <desc>Fire Starter on Selected Engine(s)</desc>
  <binding>
   <command>nasal</command>
   <script>controls.startEngine(1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.startEngine(0)</script>
   </binding>
  </mod-up>
</key>

<nasal>
  <script>
   var t_id = 0;
  </script>
</nasal>

<key n="116">
  <name>t</name>
  <desc>Increase warp delta</desc>
  <binding>
   <command>property-adjust</command>
   <property>/sim/time/warp-delta</property>
   <step type="int">30</step>
  </binding>
  <binding>
   <command>nasal</command>
   <script>
   (func(x) {
      settimer(func {
         x == t_id or return;
         gui.popupTip("resetting warp");
         setprop("/sim/time/warp-delta", 0);
      }, 1, 1)
   })(t_id += 1)
   </script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>t_id += 1</script>
   </binding>
  </mod-up>
</key>

<key n="118">
  <name>v</name>
  <desc>Scroll through views</desc>
  <binding>
   <command>nasal</command>
   <script>view.stepView(1)</script>
  </binding>
</key>

<key n="119">
  <name>w</name>
  <desc>Increase warp</desc>
  <binding>
   <command>property-adjust</command>
   <property>/sim/time/warp</property>
   <step type="int">60</step>
  </binding>
</key>

<key n="120">
  <name>x</name>
  <desc>Decrease field of view</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>view.decrease()</script>
  </binding>
</key>

<key n="122">
  <name>z</name>
  <desc>Increase Visibility</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>increase-visibility</command>
  </binding>
</key>

<key n="123">
  <name>{</name>
  <desc>Decrease Magneto on Selected Engine</desc>
  <binding>
   <command>nasal</command>
   <script>controls.stepMagnetos(-1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.stepMagnetos(0)</script>
   </binding>
  </mod-up>
</key>

<key n="125">
  <name>}</name>
  <desc>Increase Magneto on Selected Engine</desc>
  <binding>
   <command>nasal</command>
   <script>controls.stepMagnetos(1)</script>
  </binding>
  <mod-up>
   <binding>
   <command>nasal</command>
   <script>controls.stepMagnetos(0)</script>
   </binding>
  </mod-up>
</key>

<key n="126">
  <name>~</name>
  <desc>Select all engines</desc>
  <binding>
   <command>nasal</command>
   <script>controls.selectAllEngines()</script>
  </binding>
</key>

<key n="257">
  <name>F1</name>
  <mod-shift>
   <desc>Load flight</desc>
   <binding>
   <command>load</command>
   </binding>
  </mod-shift>
</key>

<key n="258">
  <mod-shift>
   <desc>Save flight</desc>
   <binding>
   <command>save</command>
   <write-all>false</write-all>
   </binding>
  </mod-shift>
</key>

<key n="259">
  <name>F3</name>
  <desc>Capture screen</desc>
  <binding>
   <command>nasal</command>
   <script>
    var success = fgcommand("screen-capture");
    var path = getprop("/sim/paths/screenshot-last");
    if (success)
       gui.popupTip("Screenshot written to '" ~ path ~ "'");
    else
       gui.popupTip("Error writing screenshot '" ~ path ~ "'");
   </script>
  </binding>
  <mod-shift>
   <desc>Load panel</desc>
   <binding>
   <command>panel-load</command>
   </binding>
  </mod-shift>
</key>

<key n="261">
  <name>F5</name>
  <repeatable type="bool">true</repeatable>
  <mod-shift>
   <desc>Scroll panel down</desc>
   <binding>
   <command>property-adjust</command>
   <property>/sim/panel/y-offset</property>
   <step type="int">-5</step>
   </binding>
  </mod-shift>
</key>

<key n="262">
  <name>F6</name>
  <desc>Toggle Autopilot Heading Mode</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>
   var prop = "/autopilot/locks/heading";
   var curr = getprop(prop);
   if(curr == "true-heading-hold") { setprop(prop, ""); }
   else { setprop(prop, "true-heading-hold"); }
   </script>
  </binding>
  <mod-shift>
   <desc>Scroll panel up</desc>
   <binding>
   <command>property-adjust</command>
   <property>/sim/panel/y-offset</property>
   <step type="int">5</step>
   </binding>
  </mod-shift>
</key>

<key n="263">
  <name>F7</name>
  <repeatable type="bool">true</repeatable>
  <mod-shift>
   <desc>Scroll panel left</desc>
   <binding>
   <command>property-adjust</command>
   <property>/sim/panel/x-offset</property>
   <step type="int">-5</step>
   </binding>
  </mod-shift>
</key>

<key n="264">
  <name>F8</name>
  <desc></desc>
  <repeatable type="bool">true</repeatable>
  <mod-shift>
   <desc>Scroll panel right</desc>
   <binding>
   <command>property-adjust</command>
   <property>/sim/panel/x-offset</property>
   <step type="int">5</step>
   </binding>
  </mod-shift>
</key>

<key n="266">
  <name>F10</name>
  <desc>Toggle menubar</desc>
  <binding>
   <command>property-toggle</command>
   <property>/sim/menubar/visibility</property>
  </binding>
  <mod-shift>
   <desc>Switch to next GUI style</desc>
   <binding>
   <command>nasal</command>
   <script>gui.nextStyle()</script>
   </binding>
  </mod-shift>
</key>

<key n="267">
  <name>F11</name>
  <desc>Pop up autopilot dialog</desc>
  <binding>
   <command>dialog-show</command>
   <dialog-name>autopilot</dialog-name>
  </binding>
</key>

<key n="268">
  <name>F12</name>
  <desc>Pop up radio settings dialog</desc>
  <binding>
   <command>dialog-show</command>
   <dialog-name>radios</dialog-name>
  </binding>
</key>

<key n="269">
  <name>Enter</name>
  <!--<desc>Reset elevator trim</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-assign</command>
   <property>/controls/flight/elevator-trim</property>
   <value>0</value>
  </binding>-->
</key>

<key n="309">
  <name>Keypad 5</name>
  <desc>Center aileron, elevator, and rudder</desc>
  <binding>
   <command>nasal</command>
   <script>controls.centerFlightControls()</script>
  </binding>
</key>

<key n="356">
  <name>Left</name>
  <desc>Move aileron left (or adjust AP heading.)</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/aileron</property>
   <step type="double">-0.05</step>
  </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-ctrl>
   <desc>Move aileron rudder</desc>
   <binding>
   <command>property-adjust</command>
   <property>/controls/flight/rudder</property>
   <step type="double">-0.05</step>
   </binding>
  </mod-ctrl>
</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)
   </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>
</key>

<key n="358">
  <name>Right</name>
  <desc>Move aileron right (or adjust AP heading.)</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/aileron</property>
   <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-ctrl>
   <desc>Move aileron rudder</desc>
   <binding>
   <command>property-adjust</command>
   <property>/controls/flight/rudder</property>
   <step type="double">0.05</step>
   </binding>
  </mod-ctrl>
</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)
   </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>
</key>

<key n="360">
  <name>PageUp</name>
  <desc>Increase throttle or autopilot autothrottle</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>
    controls.incThrottle(0.01, 1.0)
   </script>
  </binding>
  <mod-shift>
   <desc>Look front right</desc>
   <binding>
   <command>property-assign</command>
   <property>/sim/current-view/goal-heading-offset-deg</property>
   <property>/sim/view/config/front-right-direction-deg</property>
   </binding>
  </mod-shift>
</key>

<key n="361">
  <name>PageDown</name>
  <desc>Decrease throttle or autopilot autothrottle</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>
    controls.incThrottle(-0.01, -1.0)
   </script>
  </binding>
  <mod-shift>
   <desc>Look back right</desc>
   <binding>
   <command>property-assign</command>
   <property>/sim/current-view/goal-heading-offset-deg</property>
   <property>/sim/view/config/back-right-direction-deg</property>
   </binding>
  </mod-shift>
</key>

<key n="362">
  <name>Home</name>
  <desc>Increase elevator trim</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/elevator-trim</property>
   <step type="double">0.001</step>
  </binding>
  <mod-shift>
   <desc>Look front left</desc>
   <binding>
   <command>property-assign</command>
   <property>/sim/current-view/goal-heading-offset-deg</property>
   <property>/sim/view/config/front-left-direction-deg</property>
   </binding>
  </mod-shift>
</key>

<key n="363">
  <name>End</name>
  <desc>Decrease elevator trim</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/elevator-trim</property>
   <step type="double">-0.001</step>
  </binding>
  <mod-shift>
   <desc>Look back left</desc>
   <binding>
   <command>property-assign</command>
   <property>/sim/current-view/goal-heading-offset-deg</property>
   <property>/sim/view/config/back-left-direction-deg</property>
   </binding>
  </mod-shift>
</key>

<key n="364">
  <name>Insert</name>
  <desc>Reset rudder</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-assign</command>
   <property>/controls/flight/rudder</property>
   <value>0</value>
  </binding>
</key>

<key n="257">
  <name>F1</name>
  <desc>Move Pilot to original place</desc>
  <repeatable>false</repeatable>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/x-offset-m</property>
   <value type="double">-.21</value>
  </binding>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/y-offset-m</property>
   <value type="double">.235</value>
  </binding>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/field-of-view</property>
   <value type="double">66</value>
  </binding>
</key>
<key n="258">
  <name>F2</name>
  <desc>Zoom on compass</desc>
  <repeatable>false</repeatable>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/x-offset-m</property>
   <value type="double">0</value>
  </binding>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/y-offset-m</property>
   <value type="double">.235</value>
  </binding>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/field-of-view</property>
   <value type="double">33</value>
  </binding>
</key>
<key n="259">
  <name>F3</name>
  <desc>Zoom on directional gyro</desc>
  <repeatable>false</repeatable>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/x-offset-m</property>
   <value type="double">-.21</value>
  </binding>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/y-offset-m</property>
   <value type="double">.10</value>
  </binding>
  <binding>
   <command>property-assign</command>
   <property>/sim/current-view/field-of-view</property>
   <value type="double">40</value>
  </binding>
</key>
<key n="260">
  <name>F4</name>
  <desc>Pop up GPS dialog</desc>
  <binding>
   <command>dialog-show</command>
   <dialog-name>gps</dialog-name>
  </binding>
</key>
</PropertyList>
Last edited by Merik on Tue Oct 11, 2011 11:51 pm, edited 11 times in total.
I'm using FlightGear Git version on a Win 7 machine with an onboard ATI graphic card and 3 GB of RAM.

These are the link I've found useful: Types of AirspeedE6B emulatorAirspaces explained with examples
Merik
 
Posts: 191
Joined: Thu Jan 21, 2010 11:14 am

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby Merik » Sat Jan 29, 2011 10:08 pm

I forgot to say that I'll be happy to receive advice on how to further improve the mouse and keyboard settings.
I'm using FlightGear Git version on a Win 7 machine with an onboard ATI graphic card and 3 GB of RAM.

These are the link I've found useful: Types of AirspeedE6B emulatorAirspaces explained with examples
Merik
 
Posts: 191
Joined: Thu Jan 21, 2010 11:14 am

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby suto » Mon Jan 31, 2011 7:58 pm

Hi, I did not use whole codes for mouse and keyboard but tried few things I was not thinking about before. I also do not need mode 2 :) as I am using mouse setup of Zexe. I appreciate option to center rudder - now, I will use another key (f) for it. I also added option to center ailerons with elevator for myself (F) - I dont know if this is useful :) but will be trying out.

Dont know about using rudder with elevator with left mouse button. I am only beginner but seems more difficult for flying - though better for landing for sure. By coincidence I have now also rudder on mouse wheel so using two "mouse buttons" for rudder (one with elevator) is now for me ideal :mrgreen:. However elevator trim for mouse wheel seems to be more appropriate. :) But it is still in mode 0.


Edit:
Dont know if this is a good advice but I think that rudder could be on mouse wheel. In this case you can control rudder and ailerons independently and in the same time during flight. In addition it has almost same precision as left mouse button. Maybe lower but is more controllable I think. Elevator trim can be in mode 0 or controled by keyboard - depends on what is more important to use together with ailerons and elevator. Controlling airplane by rudder and elevator in the same time by scrolling mouse wheel could be difficult in flight though. However if rudder is on the mouse wheel, it can be controlled in the same time with elevator while landing. :)
suto
 
Posts: 19
Joined: Sat Nov 20, 2010 2:35 am
Location: SR
Version: 2

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby Merik » Sat Feb 19, 2011 11:09 pm

Suto,

Your idea about rudders is also good. I updated the codes above to reflect this change.

Thanks
I'm using FlightGear Git version on a Win 7 machine with an onboard ATI graphic card and 3 GB of RAM.

These are the link I've found useful: Types of AirspeedE6B emulatorAirspaces explained with examples
Merik
 
Posts: 191
Joined: Thu Jan 21, 2010 11:14 am

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby suto » Sun Feb 27, 2011 12:04 am

Good idea about elevator trim with left mouse button and mouse wheel in mode 1. I am using it. :)
As I see keybord used to zoom instruments it seems to be useful to adjust keyboard.xml for other particular aircrafts if needed. I am not sure about the code though - first two numbers for example for F3, seems to me are for "axes" used from c172p.xml file in models folder and third for "zoom". :oops: I will try it for other airplanes too sometime.
suto
 
Posts: 19
Joined: Sat Nov 20, 2010 2:35 am
Location: SR
Version: 2

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby jack » Sun Feb 27, 2011 1:56 am

Has anybody tried to get this in GIT? :)
For Military Aircraft, Scenery, and more, visit http://alphashangar.co.nr/

'Retired' from FlightGear as of July 2011. You can contact me via my website if you'd like to pick up any old projects.
User avatar
jack
Retired
 
Posts: 1440
Joined: Tue Mar 02, 2010 11:26 pm
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby Merik » Sun Feb 27, 2011 4:03 pm

Jack, I don't know how to do that. I think the mice.xml deserves to be in git, because it is the first time mouse configuration allows full control of ailerons+elevator+rudder+trimmer all at once.
I'm using FlightGear Git version on a Win 7 machine with an onboard ATI graphic card and 3 GB of RAM.

These are the link I've found useful: Types of AirspeedE6B emulatorAirspaces explained with examples
Merik
 
Posts: 191
Joined: Thu Jan 21, 2010 11:14 am

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby Merik » Sun Mar 06, 2011 7:53 pm

I just updated both files, adding new features and cleaning up unnecessary parts.
I'm using FlightGear Git version on a Win 7 machine with an onboard ATI graphic card and 3 GB of RAM.

These are the link I've found useful: Types of AirspeedE6B emulatorAirspaces explained with examples
Merik
 
Posts: 191
Joined: Thu Jan 21, 2010 11:14 am

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby Zexe » Sat Aug 06, 2011 1:20 am

I like the ideas you have Merik, the things you have done are things that I did not know could be done due to my lack of knowledge of xml. I have one question, how do you adjust throttle using your mouse? Has that function been taken out if pressing MMB is now return to mode 0?

-Zexe
Zexe
AIRPORTS: CYYJ, KHAF, RJTT, KEYW
PLANES: m33, grob115, pa22, Goose, MD-81, Velocity-XL, Rallye, F-5E Tiger II, Bocian,
User avatar
Zexe
 
Posts: 190
Joined: Thu May 21, 2009 7:12 am

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby Merik » Wed Aug 17, 2011 5:11 pm

The answer is positive: The function has been taken out. The reason is in my knowledge, mouse simulates the yoke and rudder: things pilot is constantly in touch with, and use to navigate the aircraft. Throttle is handled by a separate means in all aircraft, so it should be controlled separately in our simulation too.

In other words, when you fly manually, you use mouse 99% of the time (and the pilot uses yoke and rudder pedals 99% of the time in a similar situation). When you fly manually, you modify throttle not so often (same applied to the pilot), so it is okay to reach for a separate means (keyboard for you, throttle handle for the pilot) to adjust throttle on those occasions.
I'm using FlightGear Git version on a Win 7 machine with an onboard ATI graphic card and 3 GB of RAM.

These are the link I've found useful: Types of AirspeedE6B emulatorAirspaces explained with examples
Merik
 
Posts: 191
Joined: Thu Jan 21, 2010 11:14 am

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby sim » Tue Oct 11, 2011 8:00 pm

Long time since I flew using mouse but one advantage seemed to be you didn't need to trim flight controls. Found I could set the plane on a staight and level course flying manually (without Auto-Pilot) and go make a cup of coffee without the plane crashing during my absence. Not so easy to do that on my joystick!
Seems to me some entrepreneur could develop a flightgear mouse using the great work you guys have done. A mouse that does indeed have a separate throttle plus a left/right analogue control for independant rudder. May well knock spots off joysticks and give the joystick makers something to think about! :roll: ....sim
User avatar
sim
 
Posts: 1439
Joined: Tue Jun 30, 2009 2:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby Merik » Tue Oct 11, 2011 11:49 pm

With the mice.xml file above, you can trim the elevator easily by holding down the left mouse button and turning the mouse wheel.

I don't have a joystick, but I know that some of them (like this one) support for trimming the elevator (or at least, because of having several buttons and axes, you can modify the joystick.xml file to get the effect).

In general, to have a more realistic flight experience, you should use the elevator trim. More than that, you should use the autopilot (which does the trimming for you). Even more, you should never leave the cockpit! ;)
I'm using FlightGear Git version on a Win 7 machine with an onboard ATI graphic card and 3 GB of RAM.

These are the link I've found useful: Types of AirspeedE6B emulatorAirspaces explained with examples
Merik
 
Posts: 191
Joined: Thu Jan 21, 2010 11:14 am

Re: New mice.xml and keyboard.xml for mouse and keyboard use

Postby sim » Wed Oct 12, 2011 10:40 am

But Merik, when flying by mouse, trim is affected by simply moving the mouse! So if for example you need to trim nose-up and trim requires a little left aileron simply moving the mouse back and slightly left until the plane flies straight and level works just fine. The plane effectively is "trimmed" and remains so as long as the mouse is left in that position!
The reason the mouse holds straight and level flight better than a joystick is because the centering springs the joystick has to centralise controls are absent on a mouse. Trim tabs essential on the joystick are redundant on the mouse as it will hold the main ailerons and elevator control with bias upward or to the left without using the trim tabs as no spring forces the mouse to centralise.
If you want realism use a stick. If you want a system that maintains straight and level flight without having to continually tweak trim settings then the mouse wins hands down. :lol:
User avatar
sim
 
Posts: 1439
Joined: Tue Jun 30, 2009 2:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450


Return to New features

Who is online

Users browsing this forum: No registered users and 2 guests