Board index FlightGear Support Hardware

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

Joysticks, pedals, monitors.

Re: Joystick xml codes simple Library project  

Postby Talmid » Mon Jun 06, 2011 8:02 pm


:Tips hat, nods and grins:

Thanks Gijs!
Dain Bramaged...
Talmid
 
Posts: 80
Joined: Thu May 26, 2011 5:14 am
Location: Gulf Plains of Texas
Version: 2020.3.11
OS: Windoze 10

Re: Joystick xml codes simple Library project

Postby sim » Mon Jun 06, 2011 8:44 pm

Thanks for your contributions Dany, Talmid. Will copy and put the notepads in DropBox........sim

http://dl.dropbox.com/u/11151437/XML%20LIBRARY.zip


http://db.tt/gSilOMy
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Joystick xml codes Library project - open for contributi

Postby sgofferj » Sun Dec 18, 2011 6:40 pm

FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: Joystick xml codes Library project - open for contributi

Postby sim » Mon Dec 26, 2011 11:37 pm

Thanks sgofferj,
Will post your AV8R-02 link lower/right alongside "LIBRARY" item 24.
Work still in progress? Let me know when you have completed more features and I will update to get your latest!
Seasons Greetings.....Cheers!....sim


LIBRARY http://db.tt/gSilOMy
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Joystick xml codes Library project - open for contributi

Postby sgofferj » Thu Dec 29, 2011 3:28 am

Wilco
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: Joystick xml codes Library project - open for contributi

Postby someguy » Wed Feb 15, 2012 4:35 am

Here's some code for helicopter pilots who can't get used to the joystick throttle working "backward" as the collective:

Code: Select all
<!-- invert throttle for helis -->
    <nasal>
        <script>var tmode = props.globals.getNode("rotors", 0) != nil;</script>
    </nasal>
<!-- end invert -->
User avatar
someguy
 
Posts: 1650
Joined: Tue Nov 25, 2008 6:54 am
Location: USA
Version: 2019.1.1
OS: Mac OS X 10.11.6

Re: Joystick xml codes Library project - open for contributi

Postby sim » Sun Feb 19, 2012 5:30 pm

Someguy, Added your collective reverse sense code.....item 29 Library links..........sim

PDF Library links
http://db.tt/gSilOMy
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Joystick xml codes Library project - open for contributi

Postby e-Tron » Sun Mar 04, 2012 6:22 am

Saitek Cyborg X and F.L.Y. 5

Updated and fixed error in the .xml and the code box below. 3/4/2012

This may be the wrong place to post this, but.... I modified the "Cyborg-Gold-3d-USB.xml" to make it work well with my "Saitek Cyborg X" joystick. This Joystick is also called "F.L.Y. 5", however, I do not know what name is used for the "F.L.Y. 5", so it may not work for that joystick. I guessed at a few so it may work. If anyone has the "F.L.Y. 5" and this file doesn't work, let me know how your joystick is named by your computer and I will modify the file. To find out how your joystick is named by your computer just look in the HELP tab in FlightGear, then click Joystick Information. Your joystick will be listed and should look like this: Joystick #1: "F.L.Y. 5", or "Saitek F.L.Y. 5" . Between the quotes is the joystick name. If you post this information I will ammend the file to make it work with the F.L.Y. 5.

I use this file to fly jets and it's not perfect, but it is way better than the default Joystick.xml file. This way you will have rudder control by twisting the joystick and the buttons will have useful functions. It should work for Windows, Mac, and Linux.
I have tested it on Mac and Linux, but not Windows.

Download this file and put it in your folder: FGroot/Input/Joysticks/Saitek
http://sourceforge.net/projects/boeingfaxx/files/Cyborg-X.xml/download


Assignments:


Axis # (direction) mapped to
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
axis 0:(left-right)----------------------aileron
axis 1: (forward-backward)-------elevator
axis 2:(slider)-------------------------throttle
axis 3: (twist)--------------------------rudder


~~~~ Modifiers ~~~~
button 9:(Button 10)------ "^"-------Modifier 1
button 10:(Button 11)----"F3"------Modifier 2
button 13:(Button labeled with a filled in circle next to an open circle)(Shift state button)
----------------------------------"F4"------Modifier 3

Button # (location)------------No Mod---------------Mod 1-----------------------Mod 2------------------Mod 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
button 0: (trigger)---------------Brakes---------------Parking Brake------------Speed Brake-------Thrust Reverse
button 1: (Button 2)------------Flaps Up------------Gear Up--------------------#------------------------#
button 2: (Button 3)------------Flaps Down--------Gear Down----------------#------------------------#
button 3: (Button 4)------------Previous View----Trim Rudder---------------#------------------------#
button 4: (Button 5)------------Next View----------Trim Rudder---------------#------------------------#
button 5: (Button 6)------------Reset View--------Reset All Trim------------Cockpit View---------Tail Wheel Lock
button 6:(Button 7)-------------Pause---------------#------------------------------#------------------------#
button 7:(Button 8 )------------Unassigned
button 8:(Button 9)-------------Unassigned
button 11:(scroll wheel up) Zoom In--------------#------------------------------#-----------------------#
button 12:(scroll wheel dwn)Zoom Out----------#------------------------------#-----------------------#

axis 5: (hat left-right)----------look l/r---------------Trim Aileron---------------Adj Mixture----------#
axis 6:(hat up-down)----------look u/d-------------Trim Elevator--------------Adj Propeller ------#

Hope this helps.
If something doesn't work for you let me know. Reply here or send me a PM.


Here is the code:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!--Joystick binding definitions for "Saitek Cyborg X" and "Saitek F.L.Y. 5" Joysticks.
This file was modified from the "Cyborg-Gold-3d-USB.xml" file that is distributed with FlightGear v2.60

Modified By Andy Wagner(e-Tron on FlightGear forum)




Axis #   (direction)         mapped to
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
axis 0:(left-right)         aileron
axis 1:(forward-backward)      elevator
axis 2:(slider)                 throttle
axis 3:(twist)            rudder





~~~~ Modifiers ~~~~
button 9:(Button 10)      "^"      Modifier 1
button 10:(Button 11)     "F3"      Modifier 2
button 13:(Shift state)     "F4"      Modifier 3




Button #(location)      No Mod         Mod 1            Mod 2         Mod 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
button 0:(trigger)           Brakes              Parking Brake              SpeedBrake      Thrust Reverse
button 1:(Button 2)      Flaps Up      Gear Up            #              #
button 2:(Button 3)      Flaps Down      Gear Down         #              #
button 3:(Button 4)           Previous View           Trim Rudder                     #                   #
button 4:(Button 5)           Next View      Trim Rudder         #              #
button 5:(Button 6)      Reset View      Reset All Trim                   Cockpit View           Tail Wheel Lock
button 6:(Button 7)             Pause                   #                               #                       #
button 7:(Button 8)             #                       #                               #                       #
button 8:(Button 9)             #                       #                               #                       #
button 11:(scroll wheel up)     Zoom In         #                      #              #
button 12:(scroll wheel dwn)    Zoom Out      #                 #              #

axis 5: (hat left-right)    look l/r           Trim Aileron              Adj Mixture          #
axis 6: (hat up-down)           look u/d           Trim Elevator              Adj Propeller           #

-->


<PropertyList>


<name>Saitek Cyborg X</name>
<name>Cyborg X</name>
<name>F.L.Y 5</name>
<name>FLY 5</name>
<name>FLY5</name>
<name>Saitek FLY5</name>
<name>Saitek F.L.Y. 5</name>
<name>Saitek FLY 5</name>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ Axis Bindings ~~~~~~~~~~~~~~~~~~~~~~~~ -->

<axis n="0">
   <desc>Aileron</desc>
   <binding>
      <command>property-scale</command>
      <property>/controls/flight/aileron</property>
      <power type="double">2</power>
   </binding>
</axis>

<axis n="1">
   <desc>Elevator</desc>
   <binding>
      <command>property-scale</command>
      <property>/controls/flight/elevator</property>
      <factor type="double">-1.0</factor>
      <power type="double">2</power>
   </binding>
</axis>

<axis>
   <number>
      <mac>3</mac>
      <unix>2</unix>
      <windows>2</windows>
   </number>
   <desc>Throttle</desc>
   <binding>
      <command>nasal</command>
      <script>controls.throttleAxis()</script>
   </binding>
</axis>

<axis>
   <number>
      <mac>2</mac>
      <unix>3</unix>
      <windows>3</windows>
   </number>
   <desc>Rudder</desc>
   <binding>
      <command>property-scale</command>
      <property>/controls/flight/rudder</property>
      <power type="double">2</power>
   </binding>
</axis>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ Hat Switch ~~~~~~~~~~~~~~~~~~~~~~~~ -->
<axis>
   <desc>View Direction; Aileron Trim;</desc>
   <number>
      <unix>5</unix>
      <mac>5</mac>
      <windows>5</windows>
   </number>
   <low>
      <repeatable>true</repeatable>
      <binding>
         <command>nasal</command>
         <script>
            mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
            if (mod == nil or mod == 0) {
               v = getprop("/sim/current-view/view-number");
               if (v == 0 or v == 4) {
                  view.panViewDir(2);
               } else {
                  view.panViewDir(2);
               }
            } elsif (mod == 1) {
               controls.aileronTrim(-0.75);
            } elsif (mod == 2) {
               controls.adjMixture(-2);
            } elsif (mod == 3) {
               #
            }
         </script>
      </binding>
   </low>
   <high>
      <repeatable>true</repeatable>
      <binding>
         <command>nasal</command>
         <script>
            mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
            if (mod == nil or mod == 0) {
               v = getprop("/sim/current-view/view-number");
               if (v == 0 or v == 4) {
                  view.panViewDir(-2);
               } else {
                  view.panViewDir(-2);
               }
            } elsif (mod == 1) {
               controls.aileronTrim(0.75);
            } elsif (mod == 2) {
               controls.adjMixture(2);
            } elsif (mod == 3) {
               #
            }
         </script>
      </binding>
   </high>
</axis>

<axis>
   <desc>View Elevation; Elevator Trim;</desc>
   <number>
      <unix>6</unix>
      <mac>6</mac>
      <windows>6</windows>
   </number>
   <low>
      <repeatable>true</repeatable>
      <binding>
         <command>nasal</command>
         <script>
            mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
            if (mod == nil or mod == 0) {
               view.panViewPitch(2);
            } elsif (mod == 1) {
               controls.elevatorTrim(0.75);
            } elsif (mod == 2) {
               controls.adjPropeller(1);
            } elsif (mod == 3) {
               #
            }
         </script>
      </binding>
   </low>
   <high>
      <repeatable>true</repeatable>
      <binding>
         <command>nasal</command>
         <script>
            mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
            if (mod == nil or mod == 0) {
               view.panViewPitch(-2);
            } elsif (mod == 1) {
               controls.elevatorTrim(-0.75);
            } elsif (mod == 2) {
               controls.adjPropeller(-1);
            } elsif (mod == 3) {
               #
            }
         </script>
      </binding>
   </high>
</axis>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ Button Bindings ~~~~~~~~~~~~~~~~~~~~~~~~ -->
 
<!-- Trigger Button - Brakes, Parking Brake, Thrust Reverser -->
<button n="0">
   <desc>Brakes</desc>
   <repeatable type="bool">true</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
         if (mod == nil or mod == 0) {
            interpolate("/controls/gear/brake-left", 1, 0.075);
            interpolate("/controls/gear/brake-right", 1, 0.075);
         } elsif (mod == 1) {
            setprop("/controls/gear/brake-left", 1);
            setprop("/controls/gear/brake-right", 1);
         } elsif (mod == 2) {
            #
         } elsif (mod == 3) {
            #
         }
      </script>
   </binding>
   <mod-up>
   <repeatable type="bool">true</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
         if (mod == nil or mod == 0) {
            interpolate("/controls/gear/brake-left", 0, 0.075);
            interpolate("/controls/gear/brake-right", 0, 0.075);
         } elsif (mod == 1) {
            brake = !getprop("/controls/gear/brake-parking");
            setprop("/controls/gear/brake-parking", brake);
            if (brake) {
               gui.popupTip("Parking Brake ON");
            } else {
               gui.popupTip("Parking Brake OFF");
            }
            setprop("/controls/gear/brake-left", 0);
            setprop("/controls/gear/brake-right", 0);
         } elsif (mod == 2) {
            speedbrake = !getprop("/controls/flight/speedbrake");
            setprop("/controls/flight/speedbrake", speedbrake);
         } elsif (mod == 3) {
            reverser = !getprop("/controls/engines/engine[0]/reverser");
            props.setAll("/controls/engines/engine", "reverser", reverser);
            if (reverser) {
               gui.popupTip("Thrust Reverser ON");
            } else {
               gui.popupTip("Thrust Reverser OFF");
            }
         }
      </script>
   </binding>
   </mod-up>
</button>



<!-- Left Button below Hat-switch, labeled "2" -->
<button n="1">
   <desc>Flaps Up; Gear up</desc>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
         if (mod == nil or mod == 0) {
            controls.flapsDown(-1);
         } elsif (mod == 1) {
            controls.gearDown(-1);
         } elsif (mod == 2) {
            #
         } elsif (mod == 3) {
            #
         }
      </script>
   </binding>
   <mod-up>
      <binding>
         <command>nasal</command>
         <script>
            mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
            if (mod == nil or mod == 0) {
               controls.flapsDown(0);
            } elsif (mod == 1) {
               controls.gearDown(0);
            } elsif (mod == 2) {
               #
            } elsif (mod == 3) {
               #
            }
         </script>
      </binding>
   </mod-up>
</button>

<!-- Right Button below Hat-switch, labeled "3" -->
<button n="2">
   <desc>Flaps Down; Gear down</desc>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
         if (mod == nil or mod == 0) {
            controls.flapsDown(1);
         } elsif (mod == 1) {
            controls.gearDown(1);
         } elsif (mod == 2) {
            #
         } elsif (mod == 3) {
            #
         }
      </script>
   </binding>
   <mod-up>
      <binding>
         <command>nasal</command>
         <script>
            mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
            if (mod == nil or mod == 0) {
               controls.flapsDown(0);
            } elsif (mod == 1) {
               controls.gearDown(0);
            } elsif (mod == 2) {
               #
            } elsif (mod == 3) {
               #
            }
         </script>
      </binding>
   </mod-up>
</button>

<!-- Button left of Hat switch, Labeled '4' -->
<button n="3">
   <desc>Previous View</desc>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
         if (mod == nil or mod == 0) {
            view.stepView(-1);
         } elsif (mod == 1) {
            controls.rudderTrim(-0.75);
         } elsif (mod == 2) {
            #
         } elsif (mod == 3) {
            #
         }
      </script>
   </binding>
</button>

<!-- Button right of hat switch, Labeled '5' -->
<button n="4">
   <desc>Next View</desc>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
         if (mod == nil or mod == 0) {
            view.stepView(1);
         } elsif (mod == 1) {
            controls.rudderTrim(0.75);
         } elsif (mod == 2) {
            #
         } elsif (mod == 3) {
            #
         }
      </script>
   </binding>
</button>

<!-- Button labeled "6" -->
<button>
   <desc>Reset view; toggle tail-wheel lock; reset trim</desc>
   <number>
      <unix>5</unix>
      <mac>5</mac>
      <windows>5</windows>
   </number>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
         if (mod == nil or mod == 0) {
            view.resetView();
         } elsif (mod == 1) {
            setprop("/controls/flight/elevator-trim", 0);
            setprop("/controls/flight/aileron-trim", 0);
            setprop("/controls/flight/rudder-trim", 0);
         } elsif (mod == 2) {
            setprop("/sim/current-view/view-number", 0);
            view.resetView();
         } elsif (mod == 3) {
            twlock = !getprop("/controls/gear/tailwheel-lock");
            setprop("/controls/gear/tailwheel-lock", twlock);
            if (twlock) {
               gui.popupTip("Tail Wheel LOCKED");
            } else {
               gui.popupTip("Tail Wheel UNLOCKED");
            }
         }
      </script>
   </binding>
</button>

<!-- Button labeled "7" -->
<button n="6">
     <desc>Toggle the pause state of the sim</desc>
   <number>
      <unix>6</unix>
      <mac>6</mac>
      <windows>6</windows>
   </number>
     <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>
</button>
<!-- Scroll wheel down -->
<button n="12">
   <desc>Zoom View</desc>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
         if (mod == nil or mod == 0) {
            view.increase();
         } elsif (mod == 1) {
            #
         } elsif (mod == 2) {
            #
         } elsif (mod == 3) {
            #
         }
      </script>
   </binding>
</button>

<!-- Scroll wheel up -->
<button n="11">
   <desc>Zoom View</desc>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
         if (mod == nil or mod == 0) {
            view.decrease();
         } elsif (mod == 1) {
            #
         } elsif (mod == 2) {
            #
         } elsif (mod == 3) {
            #
         }
      </script>
   </binding>
</button><!-- ~~~~~~~~~~~~~~~~~~~~~~~~ Modifier Buttons ~~~~~~~~~~~~~~~~~~~~~~~~ -->

<!-- Button labeled '10' -->
<button n="9">
   <desc>Modifier 1</desc>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
         <script>
            name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
            setprop(name, 1);
         </script>
   </binding>
   <mod-up>
      <binding>
         <command>nasal</command>
         <script>
            name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
            setprop(name, 0);
         </script>
      </binding>
   </mod-up>
</button>

<!-- Button labeled '11' -->
<button n="10">
   <desc>Modifier 2</desc>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
         setprop(name, 2);
      </script>
   </binding>
   <mod-up>
      <binding>
         <command>nasal</command>
         <script>
            name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
            setprop(name, 0);
         </script>
      </binding>
   </mod-up>
</button>

<!-- Button labeled 0/O (Shift State Button) -->
<button n="13">
   <desc>Modifier 3</desc>
   <repeatable type="bool">false</repeatable>
   <binding>
      <command>nasal</command>
      <script>
         name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
         setprop(name, 3);
      </script>
   </binding>
   <mod-up>
      <binding>
         <command>nasal</command>
         <script>
            name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
            setprop(name, 0);
         </script>
      </binding>
   </mod-up>
</button>


</PropertyList>
Last edited by e-Tron on Sun Mar 04, 2012 5:14 pm, edited 1 time in total.
User avatar
e-Tron
 
Posts: 46
Joined: Fri Feb 24, 2012 7:55 pm
Version: 2.10
OS: Ubuntu 12.10

Re: Joystick xml codes Library project - open for contributi

Postby Gijs » Sun Mar 04, 2012 12:59 pm

Nice! But, when launching FlightGear with this joystick config, I got the following error:
Code: Select all
Fatal error: mismatched tag
  at C:/FlightGear/fgdata/Input/Joysticks/Saitek/Cyborg-X.xml,
line 559, column 2
  (received from SimGear XML Parser)

The issue turned out to be a faulty <name> tag in line 60:
Code: Select all
<name>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ Axis Bindings ~~~~~~~~~~~~~~~~~~~~~~~~ -->

<axis n="0">

After removing that <name>, it ran fine. I don't have a Cyborg X though, so I cannot check if the bindings are nicely done...

Would you permit me to commit this to Git, so it'll be included in the next FlightGear release?
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9543
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Joystick xml codes Library project - open for contributi

Postby e-Tron » Sun Mar 04, 2012 5:10 pm

Absolutely. Please do commit it to Git. I'll fix the error and update my download site. Thanks.
User avatar
e-Tron
 
Posts: 46
Joined: Fri Feb 24, 2012 7:55 pm
Version: 2.10
OS: Ubuntu 12.10

Re: Joystick xml codes Library project - open for contributi

Postby sim » Sun Mar 04, 2012 8:12 pm

e-tron, Also added to Library as item 28

LIBRARY
http://db.tt/gSilOMy
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Joystick xml codes Library project - open for contributi

Postby Gijs » Sun Mar 04, 2012 8:21 pm

e-Tron wrote in Sun Mar 04, 2012 5:10 pm:Please do commit it to Git.

Done, thanks!
https://gitorious.org/fg/fgdata/commit/ ... b46a8ac191
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9543
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Joystick xml codes Library project - open for contributi

Postby Geobrown » Wed Apr 18, 2012 4:11 am

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

<!--
************************************************************************
* Bindings for Logitech Extreme Digital 3D Pro Joystick.
*
*
* Axis 0: Ailerons
* Axis 1: Elevator
* Axis 2: Rudder (twist):
* Axis 3: Throttle (slider)
* Axis 6: View direction (hat)
* Axis 7: View elevation (hat)

* Buttons according to the numbers printed on the joystick:

* Button 1: All brakes
* Button 2: View
* Button 3: Elevator trim down
* Button 4: Flap down
* Button 5: Elevator trim up
* Button 6: Flap up
* Button 7: Propeller pitch decrease
* Button 8: Propeller pitch increase
* Button 9: Left brake only
* Button 10 Right brake only
* Button 11: Gear toggle
* Button 12: Brake park

************************************************************************
$Id$
-->
<PropertyList>

<name>Logitech Extreme 3D Pro USB</name>
 
<axis n="0">
 <desc>Aileron</desc>
 <binding>
 <command>property-scale</command>
 <property>/controls/flight/aileron</property>
 <squared type="bool">true</squared>
 </binding>
</axis>

<axis n="1">
 <desc>Elevator</desc>
 <binding>
 <command>property-scale</command>
 <property>/controls/flight/elevator</property>
 <factor type="double">-1.0</factor>
 <squared type="bool">true</squared>
 </binding>
</axis>

<axis n="3">
 <desc>Rudder</desc>
  <binding>
 <command>property-scale</command>
 <property>/controls/flight/rudder</property>
 <factor type="double">1.0</factor>
 </binding>
</axis>

<axis n="2">
 <desc>Throttle</desc>
  <binding>
 <command>nasal</command>
 <script>controls.throttleAxis()</script>
 </binding>
</axis>

<axis n="6">
 <desc>View Direction</desc>
 <low>
 <repeatable>true</repeatable>
 <binding>
  <command>property-adjust</command>
  <property>/sim/current-view/goal-heading-offset-deg</property>
  <step type="double">5.0</step>
 </binding>
 </low>
 <high>
 <repeatable>true</repeatable>
 <binding>
  <command>property-adjust</command>
  <property>/sim/current-view/goal-heading-offset-deg</property>
  <step type="double">-5.0</step>
 </binding>
 </high>
</axis>

<axis n="7">
 <desc>View Elevation</desc>
  <low>
 <repeatable>true</repeatable>
 <binding>
  <command>property-adjust</command>
  <property>/sim/current-view/goal-pitch-offset-deg</property>
  <step type="double">5.0</step>
 </binding>
 </low>
 <high>
 <repeatable>true</repeatable>
 <binding>
  <command>property-adjust</command>
  <property>/sim/current-view/goal-pitch-offset-deg</property>
  <step type="double">-5.0</step>
 </binding>
 </high>
</axis>

<button n="0">
 <desc>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>
</button>

<button n="1">
  <desc>External Views</desc>
  <repeatable type="bool">false</repeatable>
  <binding>
   <command>nasal</command>
   <script>view.stepView(1)</script>
  </binding>
 </button>

<button n="4">
 <desc>Elevator trim up</desc>
 <repeatable type="bool">true</repeatable>
 <binding>
 <command>property-adjust</command>
 <property>/controls/flight/elevator-trim</property>
 <step type="double">0.001</step>
 </binding>
</button>

<button n="2">
 <desc>Elevator trim down</desc>
 <repeatable type="bool">true</repeatable>
 <binding>
 <command>property-adjust</command>
 <property>/controls/flight/elevator-trim</property>
 <step type="double">-0.001</step>
 </binding>
</button>

<button n="3">
 <desc>Flaps down</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>
</button>

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

<button n="6">
 <desc>Propeller Pitch Decrease</desc>
 <repeatable>true</repeatable>
 <binding>
 <command>nasal</command>
 <script>controls.adjPropeller(-1)</script>
 </binding>
</button>

<button n="7">
 <desc>Propeller Pitch Increase</desc>
 <repeatable>true</repeatable>
 <binding>
 <command>nasal</command>
 <script>controls.adjPropeller(1)</script>
 </binding>
</button>

<button n="9">
 <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>
</button>

<button n="9">
 <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>
</button>

<button n="10">
<desc>Landing Gear Toggle</desc>
  <repeatable>false</repeatable>
  <binding>
    <command>nasal</command>
    <script>controls.gearToggle()</script>
  </binding>   
</button>

<button n="11">
 <desc>Toggle Parking Brake </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>
 </button>

</PropertyList>
Geobrown
 
Posts: 2
Joined: Wed Apr 18, 2012 3:54 am
Location: New Zealand
Version: 2017.1
OS: W10

Re: Joystick xml codes Library project - open for contributi

Postby sim » Tue May 01, 2012 12:44 pm

Thanks geobrown, Link for your Logitech Extreme Digital 3D Pro Joystick code now included....sim

PDF Library links
http://db.tt/gSilOMy
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Joystick xml codes Library project - open for contributi

Postby godarklight » Sat Aug 18, 2012 12:11 pm

This is my first post and im not sure if this is the right place for this, but I've made these modifications to Saitek/Pro-Flight-Yoke.xml

The brake works incorrectly in the concorde, i noted the difference between the X52-pro.xml and it probably should be this:

Code: Select all
    <button n="1"> <!-- Labled as D -->
        <desc>Toggle parking brake</desc>
            <binding>
                <command>nasal</command>
                <script>controls.applyParkingBrake(1)</script>
            </binding>
    </button>


Because the concorde takes around 7 seconds for the reverses to kick in, the old way of full throttle+thrust reverse does not work well to stop the plane. With this way, you pull it down for a second then move it back to idle and it toggles the thrust reversers on, you wait until the reversers are in position and then you push up on the throttle to control how much reverse you want. To turn reversers off just pull down and push up again to idle.

Im not sure if thats the correct way to toggle a property either but abs(value-1) does work...

Code: Select all
    <button n="20">
        <desc>thrust reverse</desc>
        <repeatable type="bool">false</repeatable>
        <binding>
            <command>nasal</command>
            <script>
            props.setAll("/controls/engines/engine", "reverser",(abs(getprop("/controls/engines/engine/reverser")-1)));
            </script>
        </binding>
    </button>


Because i fly the concorde a bit I added this to my config file aswell. Because of the low amount of planes using afterburners this is probably more for people that want to assign the unused button to something.

Code: Select all
    <button n="21">
        <desc>afterburners</desc>
        <repeatable type="bool">false</repeatable>
        <binding>
            <command>nasal</command>
            <script>
            props.setAll("/controls/engines/engine", "reheat",(abs(getprop("/controls/engines/engine/reheat")-1)));
            </script>
        </binding>
    </button>


The brake change should be commited to git, The reversers are a helpful change from default , you can control how much reverse you want. I wouldn't bother with reheat, it's not widely used across airplanes.

NB: For some reason with the CRJ planes, you also need to toggle reverse-cmd (after its armed of course).
godarklight
 
Posts: 29
Joined: Sat Aug 18, 2012 10:31 am
Callsign: DARK-L
Version: 2.12
OS: Linux

PreviousNext

Return to Hardware

Who is online

Users browsing this forum: No registered users and 3 guests