Forum Flightgear France

Une communauté prend son envol

Vous n'êtes pas identifié(e).

Annonce

Futur nouvel inscrit, tu dois au préalable lire l'intégralité des 10 articles des règles, s'il te plaît. Tout nouveau compte qui ne respecte pas les règles sera supprimé par l'administration.

#1 27/11/2007 20:16:11

georges
Membre
Inscription : 5/01/2007
Messages : 22

Joystick Saitek Cyborg Evo Force : mon fichier js0.xml

Bonsoir,

J'ai fait ce fichier et il marche donc si sa peut aider ;-)

/usr/share/games/FlightGear/Input/joystick/js0.xml

<?xml version="1.0"?>

<!-- Version 0.0 / 01-2007 modifie le 02/05/07

####Saitek Cyborg Evo  MODIFICATIONS   18 02 07   Version  0.0
25/11/07

Les fonctions des boutons du Saitek Cyborg Evo sont modifiables
par les touches sur les cotés gauche et droit du socle ce sont
des boutons 'modifier'
{^, F1, F2} a gauche et {^, F3, F4 } a droite .

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

~~~~ Left Side Modifiers ~~~~
button 10:    "^"        Modifier 1
button 6:    "F1"        Modifier 2
button 7:    "F2"        Modifier 3

~~~~ Right Side Modifiers ~~~~
button 11:    "^"        Modifier 1
button 8:    "F3"        Modifier 2
button 9:    "F4"        Modifier 3

Button #   No Mod    Mod 1           Mod 2        Mod 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
button 0:  Brakes    Parking Brake   Speed Brake    Thrust Reverse
       Frein    Frein de Park    Frein        Inverseur de poussee
button 1:  Reset View     Reset All Trim  Cockpit View    Tail Wheel Lock
       Vue         Trim        Vue cabine   
button 2:  Flaps Up       Gear Up           Zoom In          #
      
button 3:  Flaps Down     Gear Down    Zoom Out    #

button 4:  Prev View      Trim Rudder    #        #
button 5:  Next View      Trim Rudder    #        #
   HAT
axis   8:  look l/r       Trim Aileron    Adj Mixture    #
axis   9:  look u/d       Trim Elevator   Adj Propeller    #

MODIF  axes 2=6 3=7 4=8 5=9


-->

<PropertyList>

<name>Saitek Cyborg USB Stick</name>
<name>Saitek Cyborg Evo</name>

<!-- #################### Axis Bindings ~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- AXE   0  -->
    <!-- Modif du 25/11/07 depuis joystick_doc.txt   -->
<!-- <axis n="0">
    <desc>Aileron</desc>
    <binding>
        <command>property-scale</command>
        <property>/controls/flight/aileron</property>
        <power type="double">2</power>
    </binding>
</axis> -->
<!-- cette  modif evite de zigzaguer sur la piste  -->
<axis n="0">
    <desc>Aileron</desc>
    <binding>
        <condition>
            <property>/gear/gear/wow</property>
        </condition>
        <command>property-scale</command>
        <property>/controls/flight/rudder</property>
        <squared type="bool">true</squared>
    </binding>
    <desc>Rudder only if on the ground</desc>
    <binding>
        <condition>
            <not>
                <property>/gear/gear/wow</property>
            </not>
        </condition>
        <command>property-scale</command>
        <property>/controls/flight/aileron</property>
        <squared type="bool">true</squared>
    </binding>
</axis>
    <!-- AXE  1   -->
<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>
    <!-- AXE  6   -->
<axis n="6">
    <desc>Throttle</desc>
    <binding>
        <command>nasal</command>
        <script>controls.throttleAxis()</script>
    </binding>
</axis>
    <!-- AXE   7  -->
<axis n="7">
    <desc>Rudder</desc>
    <binding>
        <command>property-scale</command>
        <property>/controls/flight/rudder</property>
        <power type="double">2</power>
    </binding>
</axis>
    <!-- AXE   8  -->
<!-- ~~~~~~~~~~~~~ Hat Switch ~~###### MODIFICATION   5=8~~~ -->
<axis>
    <desc>View Direction; Aileron Trim;</desc>
    <number>
        <unix>8</unix>
        <mac>8</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) {
                    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>
    <!-- AXE  9     ###### MODIFICATION  6=9 -->
<axis>
    <desc>View Elevation; Elevator Trim;</desc>
    <number>
        <unix>9</unix>
        <mac>9</mac>
        <windows>7</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 ~~~~~~~~~~~~~~~~~~~~~ -->
<!--   BOUTON    0 -->
<!-- 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>
<!--   BOUTON   1 -->
<!-- Middle Button below Hat-switch, labeled "2" -->
<button>
    <desc>Reset view; toggle tail-wheel lock; reset trim</desc>
    <number>
        <unix>1</unix>
        <mac>1</mac>
        <windows>1</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>
<!--   BOUTON   2  -->
<!-- Left Button below Hat-switch, labeled "3" -->
<button n="2">
    <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) {
                view.increase();
            } 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>
<!--   BOUTON   3 -->
<!-- Right Button below Hat-switch, labeled "4" -->
<button n="3"><!-- right -->
    <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) {
                view.decrease();
            } 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>
<!--   BOUTON   4 -->
<!-- Button left of Hat switch, Labeled '5' -->
<button n="4">
    <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>
<!--   BOUTON   5  -->
<!-- Button right of Hat switch, Labeled '6' -->
<button n="5">
    <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>

<!-- ############################ Modifier Buttons ~~~~~ -->
<!--   BOUTON   10 -->
<!-- Left Side Button labeled ^ -->
<button n="10">
    <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>
<!--   BOUTON   6 -->
<!-- Left Side Button labeled F1 -->
<button n="6">
    <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>
<!--   BOUTON   7 -->
<!-- Left Side Button labeled F2 -->
<button n="7">
    <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>
<!--   BOUTON    11 -->
<!-- Right Side Button labeled ^ -->
<button n="11">
    <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>
<!--   BOUTON  8  -->
<!-- Right Side Button labeled F3 -->
<button n="8">
    <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>
<!--   BOUTON   9 -->
<!-- Right Side Button labeled F4 -->
<button n="9">
    <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>
----------------------------------------------Fin du fichier
Et aussi ne pas oublier :

/usr/share/games/FlightGear/joystick.xml ci dessous


<?xml version="1.0"?>
<!--
    To override or add "named" joystick drivers list them in
    <js-named> entries with paths relative to the directory where
    the joysticks.xml file resides (first example). Such "named"
    drivers are only picked up if one of their <name>s matches
    the joystick hardware (see output of the js_demo application).
    These drivers have precedence over already existing drivers
    with the same <name>. (You can also add a <name>default</name>
    entry to the driver to make it the default choice.)

    The second example shows how to load a driver directly to
    position 0. This will then be used for the first joystick on
    your system and FlightGear will not overwrite it.
-->

<PropertyList>
    <js-named include="Input/Joysticks/js0.xml"/>

    <js n="0" include="/Input/Joysticks/js0.xml"/>
</PropertyList>

Hors ligne

#2 13/03/2008 13:07:36

argon
Membre
Lieu : LFOQ,près de Vendôme.
Inscription : 9/03/2008
Messages : 504

Re : Joystick Saitek Cyborg Evo Force : mon fichier js0.xml

Merci à toi !

Nettement plus facile ,  le soir  surtout dans la pénombre, plutot que le clavier


Mint 10 Julia FG GIT 2.2.0 & VirtualBox WinXP

Hors ligne

Pied de page des forums