Board index FlightGear Support Hardware

Joystick xml codes Library project - open for contributions  Topic is solved

Joysticks, pedals, monitors.

Re: Joystick xml codes Library project - open for contributi

Postby FCar » Sun May 29, 2016 11:28 am

Saitek Switch Panel Event XML file:

Code: Select all
<PropertyList>

  <name>Saitek Pro Flight Switch Panel</name>
  <name>HOLTEK Saitek Pro Flight Switch Panel</name>
  <debug-events type="bool">true</debug-events>

  <event>
    <name>button-0</name>
    <desc>Battery master</desc>
    <binding>
      <command>property-assign</command>
      <property>/controls/switches/master-bat</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/switches/master-bat</property>
        <value>false</value>
      </binding>
    </mod-up>
  </event>

  <event>
    <name>button-1</name>
    <desc>Alternator master</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/master-alt</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/switches/master-alt</property>
        <value>false</value>
      </binding>
    </mod-up>
  </event>

  <event>
    <name>button-2</name>
    <desc>Avionics master</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/master-avionics</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/switches/master-avionics</property>
        <value>false</value>
      </binding>
    </mod-up>
  </event>

  <event>
    <name>button-5</name>
    <desc>Pitot heat</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/anti-ice/pitot-heat</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/anti-ice/pitot-heat</property>
        <value>false</value>
      </binding>
    </mod-up>
  </event>

  <event>
    <name>button-7</name>
    <desc>Instruments light</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/instruments-norm</property>
      <value>1.0</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/instruments-norm</property>
        <value>0.0</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-8</name>
    <desc>Beacon</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/beacon</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/beacon</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-9</name>
    <desc>Navigation lights</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/nav-lights</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/nav-lights</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-266</name>
    <desc>Strobe</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/strobe</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/strobe</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-267</name>
    <desc>Taxi light</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/taxi-light</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/taxi-light</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-268</name>
    <desc>Landing lights</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/landing-lights</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/landing-lights</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-side</name>
    <desc>Gear</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>
  </event>

  <event>
    <name>button-269</name>
    <desc>Magnetos off</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/magnetos</property>
      <value>0</value>
    </binding>
  </event>

  <event>
    <name>button-270</name>
    <desc>Magnetos right</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/magnetos</property>
      <value>1</value>
    </binding>
  </event>

  <event>
    <name>button-271</name>
    <desc>Magnetos right</desc>
    <binding>
      <command>property-assign</command>
      <property>/controls/switches/magnetos</property>
      <value>2</value>
    </binding>
  </event>

  <event>
    <name>button-left</name>
    <desc>Magnetos both</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/magnetos</property>
      <value>3</value>
    </binding>
  </event>

  <event>
    <name>button-right</name>
    <desc>Starter</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/starter</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/switches/starter</property>
        <value>false</value>
      </binding>
    </mod-up>
   </event>


</PropertyList>
FCar
 
Posts: 2
Joined: Sun May 29, 2016 10:24 am

Re: Joystick xml codes Library project - open for contributi

Postby FCar » Sun Jul 17, 2016 8:28 am

In case you cannot recognize the panel at flightgear startup, please check the permissions on the device. Depending on your linux distribution, you may need to add your user to a specific group. In Ubuntu this group is input.
FCar
 
Posts: 2
Joined: Sun May 29, 2016 10:24 am

Re: Joystick xml codes Library project - open for contributi

Postby DF_Hammack » Sat Aug 13, 2016 11:57 am

-- Saitek Cyborg 3-D Rumble Force --

This thread needs to be turned into a sticky. I JUST found it after nearly abandoning FlightGear as unusable. I was helped by a reader who does not post and wishes to remain anonymous, but he saw my plight and PM'ed me. He got me started down the road to creating my joystick configuration. I was not happy with FlightGear, because it just did not respond in a realistic manner. Honestly, the standard joystick code needs to be re-written to tame sticks to the newer, faster computers, but the reality is this has been a problem from the start. I first tried FlightGear back in 2000, and for this reason I never paid serious attention to FG. Now, with my joystick tamed down, it flies better than X-Plane. Plus, being able to tailor the joystick (to each plane, if you feel like it) makes Flight gear infinitely more configurable than X-Plane!

All of that said, I will share my Joystick file here. It is for the Saitek Cyborg 3D Rumble Force. It is a work in progress, but at this point it controls aileron and elevator trim from the Hat switch, rudder trim from buttons 2 & 5, HUD control on button 3, gear toggle is on button 4 (gear won't retract if there is weight on them), with flaps on 6 & 7, and gear up & down on 8 & 9 (this is a hold over - these two buttons will be re-purposed). The Trigger is a shifter. With the trigger depressed, the Hat controls Look About, button 3 toggles HUD color, and button 4 pauses the sim. I have plans for shifted functions for buttons 6 thru 9. My stick is noisy so there is a wide dead band, axis control (except for the Throttle) is logarithmic for more realism, and sensitivity is tamed to a manageable, more realistic level. The Twist axis is not active (this does not realistically simulate rudder control, auto-coordination is better).
Code: Select all
<?xml version="1.0"?>

<PropertyList>

<name type="string">Saitek Cyborg 3D Rumble Force</name>

<!-- Mod 1 - Script defining Multifunctionality -->
<data>
  <modeTrig type="bool">false</modeTrig>
</data>
  <nasal>
   <script>
            <![CDATA[
            var self = cmdarg().getParent();
            var data = self.getNode("data");
            var modeTrig = data.getNode("modeTrig");
            var trace = func(str) {
            # Uncomment the line below to trace button presses.
            # print("Cyborg xml Model: " ~ model ~ str);
          }
          #
         ]]>
   </script>
  </nasal>
<!-- End Mod 1-->


<axis>
   <!-- Axis 0. Roll left/right -->
    <dead-band type="double">0.15</dead-band>
    <desc type="string">Aileron</desc>
    <binding>
      <command type="string">property-scale</command>
      <property type="string">/controls/flight/aileron</property>
      <factor type="double">0.55</factor>
      <offset type="double">0</offset>
      <power type="int">3</power>
    </binding>
  </axis>

  <axis n="1">
     <!-- Analog axis 1. Pitch back/forward -->
    <dead-band type="double">0.15</dead-band>
    <desc type="string">Elevator</desc>
    <binding>
      <command type="string">property-scale</command>
      <property type="string">/controls/flight/elevator</property>
      <factor type="double">-0.55</factor>
      <offset type="double">0</offset>
      <power type="int">3</power>
    </binding>
  </axis>

  <axis n="2">
       <!--Analog axis 2. Throttle -->
    <desc type="string">Throttle</desc>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.throttleAxis();</script>
    </binding>
  </axis>

<!-- Mod 1 - Multifuctionality with the Trigger as the Shift -->
   <!-- Trigger Button -->
   <button n="0">
      <name>Trigger</name>
      <desc>Trigger mode '+Trg';  +Shift: trigger</desc>
      <binding>
         <command>nasal</command>
         <script>
            trace("Trig Bttn bit 0 press");
            modeTrig.setIntValue(1);
         </script>
      </binding>
      <mod-up>
         <binding>
            <command>nasal</command>
            <script>
              trace("Trig Bttn bit 0 release");
               modeTrig.setIntValue(0);
               controls.trigger(0);
            </script>
         </binding>
      </mod-up>
   </button>

   <!-- Axis 4. Hat left/right - Aileron Trim; +Trig, Lateral View-->
   <axis n="4">
      <desc>Aileron Trim; +Trg: Pan View</desc>
      <low>
         <repeatable type="bool">true</repeatable>
      <interval-sec type="double">0.1</interval-sec>
         <binding>
        <command>nasal</command>
           <script>
         <![CDATA[
            if (! modeTrig.getBoolValue()) {
              setprop("controls/flight/aileron-trim",
                (getprop("controls/flight/aileron-trim") -0.0015));
            } else {
              setprop("/sim/current-view/heading-offset-deg",
                (getprop("/sim/current-view/heading-offset-deg") + 4.000));
            } 
          ]]>
           </script>
         </binding>
      </low>
      <high>
         <repeatable type="bool">true</repeatable>
      <interval-sec type="double">0.1</interval-sec>
         <binding>
        <command>nasal</command>
           <script>
          <![CDATA[
            if (! modeTrig.getBoolValue()) {
              setprop("controls/flight/aileron-trim",
                (getprop("controls/flight/aileron-trim") +0.0015));
            } else {
              setprop("/sim/current-view/heading-offset-deg",
                (getprop("/sim/current-view/heading-offset-deg") - 4.000));
            } 
          ]]>
           </script>
         </binding>
      </high>
   </axis>

   <!-- Axis 5. Hat up/down - Elevator Trim; +Trig, Vertical View-->
   <axis n="5">
      <desc>Elevator Trim; +Trg: Tilt view</desc>
      <low>
         <repeatable type="bool">true</repeatable>
      <interval-sec type="double">0.1</interval-sec>
         <binding>
        <command>nasal</command>
           <script>
          <![CDATA[
            if (! modeTrig.getBoolValue()) {
              setprop("controls/flight/elevator-trim",
                (getprop("controls/flight/elevator-trim") +0.002));
            } else {
              setprop("/sim/current-view/pitch-offset-deg",
                (getprop("/sim/current-view/pitch-offset-deg") - 1.500));
            } 
          ]]>
           </script>
         </binding>
      </low>
      <high>
         <repeatable type="bool">true</repeatable>
      <interval-sec type="double">0.1</interval-sec>
         <binding>
        <command>nasal</command>
           <script>
          <![CDATA[
            if (! modeTrig.getBoolValue()) {
              setprop("controls/flight/elevator-trim",
                (getprop("controls/flight/elevator-trim") -0.002));
            } else {
              setprop("/sim/current-view/pitch-offset-deg",
               (getprop("/sim/current-view/pitch-offset-deg") + 1.500));
            } 
          ]]>
           </script>
         </binding>
      </high>
   </axis>
<!-- End Mod 1-->

  <button n="1">
    <desc type="string">Rudder Trim Left</desc>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.rudderTrim(-1);</script>
    </binding>
    <repeatable type="double">1</repeatable>
  </button>

<!-- Mod 3 - Landing Gear Toggle; +Trigger, Pauses Sim -->

  <button n="3">
  <name>Button #4</name>
    <desc>Togg Landing Gear; +Trg: Pause </desc>
    <repeatable>false</repeatable>
    <binding>
      <command>nasal</command>
      <script>
      if (modeTrig.getBoolValue()) {
            trace("Trig Button #4 bit 1 press");
        if (getprop("sim/freeze/master") == 0 ) {
          setprop("sim/freeze/master", 1);
        } else {
          setprop("sim/freeze/master", 0);
        }   
        if (getprop("sim/freeze/clock") == 0 ) {
          setprop("sim/freeze/clock", 1);
        } else {
          setprop("sim/freeze/clock", 0);
        }   
         } else {
            trace("     Button #4 bit 1 press");
        controls.gearToggle()
      } 
      </script> 
    </binding>
  </button> 
<!-- End Mod 3 -->
 
<!-- Mod 2 - Assign HUD control to Joystick; +Trigger, Toggles HUD color -->
   <button n="2">
      <name>Button #3</name>
      <desc>HUD Toggle; +Trg HUD Type</desc>
      <binding>
         <command>nasal</command>
         <script>
            trace("Button #3 Bit 2 press ");
        if (modeTrig.getBoolValue()) {
          aircraft.HUD.cycle_color();
          } else {
              aircraft.HUD.cycle_type();
        }
         </script>
         </binding>
   </button>
<!-- End Mod 2 -->

  <button n="4">
    <desc type="string">Rudder Trim Right</desc>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.rudderTrim(1);</script>
    </binding>
    <repeatable type="double">1</repeatable>
  </button>

  <button n="5">
    <desc type="string">Flaps Up</desc>
    <repeatable type="string">false</repeatable>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.flapsDown(-1);</script>
    </binding>
    <mod-up>
      <binding>
        <command type="string">nasal</command>
        <script type="string">controls.flapsDown(0);</script>
      </binding>
    </mod-up>
  </button>

  <button n="6">
    <desc type="string">Flaps Down</desc>
    <repeatable type="string">false</repeatable>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.flapsDown(1);</script>
    </binding>
    <mod-up>
      <binding>
        <command type="string">nasal</command>
        <script type="string">controls.flapsDown(0);</script>
      </binding>
    </mod-up>
  </button>

  <button n="7">
    <desc type="string">Gear Down</desc>
    <repeatable type="string">false</repeatable>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.gearDown(1);</script>
    </binding>
    <mod-up>
      <binding>
        <command type="string">nasal</command>
        <script type="string">controls.gearDown(0);</script>
      </binding>
    </mod-up>
  </button>

  <button n="8">
    <desc type="string">Gear Up</desc>
    <repeatable type="string">false</repeatable>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.gearDown(-1);</script>
    </binding>
    <mod-up>
      <binding>
        <command type="string">nasal</command>
        <script type="string">controls.gearDown(0);</script>
      </binding>
    </mod-up>
  </button>

</PropertyList>

As I said, this is a work in progress. When I get this file doing what I really want it to do, I will post it again. Then I will start to work re-mapping the keyboard as a joystick complement, not a primary flight control. I hope you enjoy this, and find it useful :)
DF_Hammack
 
Posts: 34
Joined: Fri Aug 05, 2016 10:57 pm
Location: Camden, SC, USA
Callsign: SilverSplash
Version: 2017.2.1
OS: Xubuntu 17.10

Re: Joystick xml codes Library project - open for contributi

Postby BEL ISAAK » Fri Aug 26, 2016 7:02 am

FCar wrote in Sun May 29, 2016 11:28 am:Saitek Switch Panel Event XML file:

Code: Select all
<PropertyList>

  <name>Saitek Pro Flight Switch Panel</name>
  <name>HOLTEK Saitek Pro Flight Switch Panel</name>
  <debug-events type="bool">true</debug-events>

  <event>
    <name>button-0</name>
    <desc>Battery master</desc>
    <binding>
      <command>property-assign</command>
      <property>/controls/switches/master-bat</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/switches/master-bat</property>
        <value>false</value>
      </binding>
    </mod-up>
  </event>

  <event>
    <name>button-1</name>
    <desc>Alternator master</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/master-alt</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/switches/master-alt</property>
        <value>false</value>
      </binding>
    </mod-up>
  </event>

  <event>
    <name>button-2</name>
    <desc>Avionics master</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/master-avionics</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/switches/master-avionics</property>
        <value>false</value>
      </binding>
    </mod-up>
  </event>

  <event>
    <name>button-5</name>
    <desc>Pitot heat</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/anti-ice/pitot-heat</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/anti-ice/pitot-heat</property>
        <value>false</value>
      </binding>
    </mod-up>
  </event>

  <event>
    <name>button-7</name>
    <desc>Instruments light</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/instruments-norm</property>
      <value>1.0</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/instruments-norm</property>
        <value>0.0</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-8</name>
    <desc>Beacon</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/beacon</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/beacon</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-9</name>
    <desc>Navigation lights</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/nav-lights</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/nav-lights</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-266</name>
    <desc>Strobe</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/strobe</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/strobe</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-267</name>
    <desc>Taxi light</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/taxi-light</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/taxi-light</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-268</name>
    <desc>Landing lights</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/lighting/landing-lights</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/lighting/landing-lights</property>
        <value>false</value>
      </binding>
   </mod-up>
  </event>

  <event>
    <name>button-side</name>
    <desc>Gear</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>
  </event>

  <event>
    <name>button-269</name>
    <desc>Magnetos off</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/magnetos</property>
      <value>0</value>
    </binding>
  </event>

  <event>
    <name>button-270</name>
    <desc>Magnetos right</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/magnetos</property>
      <value>1</value>
    </binding>
  </event>

  <event>
    <name>button-271</name>
    <desc>Magnetos right</desc>
    <binding>
      <command>property-assign</command>
      <property>/controls/switches/magnetos</property>
      <value>2</value>
    </binding>
  </event>

  <event>
    <name>button-left</name>
    <desc>Magnetos both</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/magnetos</property>
      <value>3</value>
    </binding>
  </event>

  <event>
    <name>button-right</name>
    <desc>Starter</desc>
     <binding>
      <command>property-assign</command>
      <property>/controls/switches/starter</property>
      <value>true</value>
    </binding>
    <mod-up>
      <binding>
        <command>property-assign</command>
        <property>/controls/switches/starter</property>
        <value>false</value>
      </binding>
    </mod-up>
   </event>


</PropertyList>


Hi FCar,

I tried your config file, as I was very pleased to finally see some progress with the switch panel, but FlightGear still won't recognise the switch panel. I fear that your explanation (assigning a user to it) is a bit vague for me too. I work on windows, which I hope is not the problem for it. Have you any idea what I can do? I have my switch panel lying dead for about two years, so making it finally do something would be very nice.

Thanks in advance!
User avatar
BEL ISAAK
 
Posts: 208
Joined: Sat Jun 04, 2011 2:52 pm
Location: Leuven, Belgium
Callsign: OO-ISA
Version: 2018.2.2
OS: Windows 10

Re: Joystick xml codes Library project - open for contributi

Postby cain071546 » Mon Aug 29, 2016 3:44 pm

I have a weird question.

I own a Saitek Cyborg Evo.
It has 5 buttons and a hat switch.

the center of the 3 buttons resets the original view position no matter what view i am using, or where i have looked (changed view direction) or zoomed.

is there a keyboard shortcut for this?

it is not ctrl + x or y

thanx.
two wrongs never made a right but two wrights made a airplane
cain071546
 
Posts: 111
Joined: Wed Sep 29, 2010 9:55 pm
Location: Washington USA
Callsign: cain
IRC name: cain
Version: 3.2
OS: Linux

Re: Joystick xml codes Library project - open for contributi

Postby EFConrad » Fri Nov 25, 2016 3:15 pm

Thrustmaster T.Flight Rudder Pedals (TFRP) XML

Here's a working joystick XML for the relatively new Thrustmaster rudder pedals:

File should be named "T-Rudder.xml" and dropped into /Input/Joysticks/ThrustMaster

Chances are you already launched FlightGear and discovered that while FlightGear discovers the pedals, the joystick configuration menu can't get the brake axes set up correctly. Be sure to delete the (incorrect) user configuration -- in Windows, the default location will be in ../Users/<your-user-name>/AppData/Roaming/flightgear.org/Input/Joysticks
Delete any "T-Rudder.xml" file found there so that FlightGear will locate and use the correct XML file based on the device name.

I recommend editing the XML file if you want to tweak the pedals' response. The native reversed axes of the brake function doesn't seem to play well with the joystick settings editor -- at least not in Windows. For other OSes, your mileage may very. :D

Code: Select all
<?xml version="1.0"?>

<!--
************************************************************************
* Setup for Thrustmaster T-Flight rudder pedals.
*
* These are USB rudder pedals with toe brakes.  Bindings are as
* follows:
*
* Axis 0 (toe, right pedal): right differential brake
* Axis 1 (toe, left pedal): left differential brake
* Axis 2 (combined sliding pedal action): rudder (and nosewheel)
*
* Settings are similar to the pedals found in the Logitecgh G940 set:
* Axes are numbered right-to-left for brakes.
* Offset and Factor values are negative.
************************************************************************
$Id$
-->

<PropertyList>

 <name>T-Rudder</name>

 <axis n="1">
  <desc>Brake left</desc>
  <binding>
   <command>property-scale</command>
   <property>/controls/gear/brake-left</property>
   <offset>-1.0</offset>
   <factor>-0.5</factor>
  </binding>
 </axis>

 <axis n="0">
  <desc>Brake right</desc>
  <binding>
   <command>property-scale</command>
   <property>/controls/gear/brake-right</property>
   <offset>-1.0</offset>
   <factor>-0.5</factor>
  </binding>
 </axis>

 <axis n="2">
  <desc>Rudder</desc>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/rudder</property>
   <factor>1.0</factor>
   <power>2</power>
   <offset>0.0</offset>
  </binding>
 </axis>

</PropertyList>


** Tested on version 2016.4.1 with the default Cessna 172P **
EFConrad
 
Posts: 1
Joined: Fri Nov 25, 2016 2:38 pm
Location: New England
Version: 2016.4.1
OS: Windows 10

Re: Joystick xml codes Library project - open for contributi

Postby N-SCOT » Sun Jan 08, 2017 5:42 pm

A while ago I posted trying to find a code / script for my (non twist) joystick. The goal was stated (wrongly :oops: ) to get something going for nose wheel on ground / rudder in air. What I actually wanted was nose wheel on ground aileron in air.

Anyways, to cut to the chase, the code I was looking for was from Sesbastain Marque. For any interested, it's reposted below.

Code: Select all
<axis n="0">
 <desc>Rudder on ground, aileron in flight</desc>
 <!-- Implemented on-ground taxi patch by Sebastain Marque -->
 <binding>
 <condition>
 <property>/gear/gear/wow</property>
 </condition>
 <command>property-scale</command>
 <property>/controls/flight/rudder</property>
 <squared type="bool">true</squared>
 </binding>
 <desc>Aileron</desc>
 <dead-band type="double">0.02</dead-band>
 <binding>
 <condition>
 <not>
 <property>/gear/gear/wow</property>
 </not>
 </condition>
 <command>property-scale</command>
 <property>/controls/flight/aileron</property>
 <offset type="double">0.0</offset>
 <factor type="double">1.0</factor>
 <tolerance type="double">0.0</tolerance>
 <squared type="bool">true</squared>
 <power type="double">2.0</power>
 </binding>
</axis>


This is definite useful for an old school joystick like mine with no twist axis - I have a CH Combatstick 568. I like it as it's extremely tough and the potentiometers and gimbals inside don't crap out. Mine is 7 years old and still great.

As a result of my searches (caused by my loss of joystick file back then) I made a joystick config file for the model 568. If anyone's interested, it's below. If anyone else has CH products that they have config files for, please do share too.

Code: Select all
<?xml version="1.0"?>

<PropertyList>
  <name type="string">CH COMBATSTICK USB</name>
<axis n="0">
 <desc>Rudder on ground, aileron in flight</desc>
 <!-- Implemented on-ground taxi patch by Sebastain Marque -->
 <binding>
 <condition>
 <property>/gear/gear/wow</property>
 </condition>
 <command>property-scale</command>
 <property>/controls/flight/rudder</property>
 <squared type="bool">true</squared>
 </binding>
 <desc>Aileron</desc>
 <dead-band type="double">0.02</dead-band>
 <binding>
 <condition>
 <not>
 <property>/gear/gear/wow</property>
 </not>
 </condition>
 <command>property-scale</command>
 <property>/controls/flight/aileron</property>
 <offset type="double">0.0</offset>
 <factor type="double">1.0</factor>
 <tolerance type="double">0.0</tolerance>
 <squared type="bool">true</squared>
 <power type="double">2.0</power>
 </binding>
</axis>
  <axis n="1">
    <desc type="string">Elevator</desc>
    <binding>
      <command type="string">property-scale</command>
      <property type="string">/controls/flight/elevator</property>
      <factor type="double">-1</factor>
      <offset type="double">0</offset>
    </binding>
  </axis>
  <axis n="2">
    <desc type="string">Throttle</desc>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.throttleAxis();</script>
    </binding>
  </axis>
  <axis n="3">
    <desc type="string">View (horizontal)</desc>
    <low>
      <binding>
        <command type="string">nasal</command>
        <script type="string">setprop("/sim/current-view/goal-heading-offset-deg", getprop("/sim/current-view/goal-heading-offset-deg") + 30);</script>
      </binding>
    </low>
    <high>
      <binding>
        <command type="string">nasal</command>
        <script type="string">setprop("/sim/current-view/goal-heading-offset-deg", getprop("/sim/current-view/goal-heading-offset-deg") - 30);</script>
      </binding>
    </high>
  </axis>
  <axis n="4">
    <desc type="string">View (vertical)</desc>
    <low>
      <binding>
        <command type="string">nasal</command>
        <script type="string">setprop("/sim/current-view/goal-pitch-offset-deg", getprop("/sim/current-view/goal-pitch-offset-deg") - 20);</script>
      </binding>
    </low>
    <high>
      <binding>
        <command type="string">nasal</command>
        <script type="string">setprop("/sim/current-view/goal-pitch-offset-deg", getprop("/sim/current-view/goal-pitch-offset-deg") + 20);</script>
      </binding>
    </high>
  </axis>
  <button>
    <desc type="string">Trigger</desc>
    <repeatable type="string">false</repeatable>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.trigger(1);</script>
    </binding>
    <mod-up>
      <binding>
        <command type="string">nasal</command>
        <script type="string">controls.trigger(0);</script>
      </binding>
    </mod-up>
  </button>
  <button n="1">
    <desc type="string">Brakes</desc>
    <repeatable type="string">false</repeatable>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.applyBrakes(1);</script>
    </binding>
    <mod-up>
      <binding>
        <command type="string">nasal</command>
        <script type="string">controls.applyBrakes(0);</script>
      </binding>
    </mod-up>
  </button>
  <button n="2">
    <desc type="string">Gear Up</desc>
    <repeatable type="string">false</repeatable>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.gearDown(-1);</script>
    </binding>
    <mod-up>
      <binding>
        <command type="string">nasal</command>
        <script type="string">controls.gearDown(0);</script>
      </binding>
    </mod-up>
  </button>
  <button n="4">
    <desc type="string">Propeller Fine</desc>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.adjPropeller(1);</script>
    </binding>
    <repeatable type="double">1</repeatable>
  </button>
  <button n="5">
    <desc type="string">Mixture Rich</desc>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.adjMixture(1);</script>
    </binding>
    <repeatable type="double">1</repeatable>
  </button>
  <button n="6">
    <desc type="string">Propeller Coarse</desc>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.adjPropeller(-1);</script>
    </binding>
    <repeatable type="double">1</repeatable>
  </button>
  <button n="7">
    <desc type="string">Mixture Lean</desc>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.adjMixture(-1);</script>
    </binding>
    <repeatable type="double">1</repeatable>
  </button>
</PropertyList>


Cheers, G
Gary Brown, aka N-SCOT
Favorite Aircraft: Military
Favorite FG activity: Livery generation
N-SCOT
 
Posts: 162
Joined: Sun Apr 19, 2009 2:17 pm
Location: Gainesville, Florida
Callsign: N-SCOT
Version: 10.2.2
OS: OSX High Sierra

Re: Joystick xml codes Library project - open for contributi

Postby pommesschranke » Fri Jun 23, 2017 4:39 pm

Saitek Saitek Pro Flight Yoke:
I use default config exept
Code: Select all
 <factor type="double">0.5</factor>

for aileron & elevator.

Thrustmaster T-Rudder
Code: Select all
<PropertyList>
  <name type="string">Thrustmaster T-Rudder</name>
  <axis>
    <desc type="string">Brake Right</desc>
    <binding>
      <command type="string">property-scale</command>
      <property type="string">/controls/gear/brake-right</property>
      <factor type="double">-1.0</factor>
      <offset type="double">0</offset>
    </binding>
  </axis>
  <axis n="1">
    <desc type="string">Brake Left</desc>
    <binding>
      <command type="string">property-scale</command>
      <property type="string">/controls/gear/brake-left</property>
      <factor type="double">-1.0</factor>
      <offset type="double">0</offset>
    </binding>
  </axis>
  <axis n="2">
    <desc type="string">Rudder</desc>
    <binding>
      <command type="string">property-scale</command>
      <property type="string">/controls/flight/rudder</property>
      <factor type="double">0.5</factor>
      <offset type="double">0</offset>
    </binding>
  </axis>
  <button>
    <desc type="string">Brakes</desc>
    <repeatable type="string">false</repeatable>
    <binding>
      <command type="string">nasal</command>
      <script type="string">controls.applyBrakes(1);</script>
    </binding>
    <mod-up>
      <binding>
        <command type="string">nasal</command>
        <script type="string">controls.applyBrakes(0);</script>
      </binding>
    </mod-up>
  </button>
 
</PropertyList>
pommesschranke
 
Posts: 1100
Joined: Sat Apr 27, 2013 7:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Lubuntu 18.04

Re: Joystick xml codes Library project - open for contributi

Postby cogliostro » Tue Nov 21, 2017 3:36 am

Anyone know how to map the Carburetor Heater to a button? It doesn't show in the list of functions to map in the Joystick Configuration.
cogliostro
 
Posts: 1
Joined: Tue Nov 21, 2017 3:32 am

Re: Joystick xml codes Library project - open for contributi

Postby Johan G » Sun Nov 26, 2017 9:50 pm

You will probably have to add that manually (by editing your joysticks configuration file). And it will probably only work for some aircraft.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5294
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Previous

Return to Hardware

Who is online

Users browsing this forum: No registered users and 3 guests