1
0
Fork 0
fgdata/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml

538 lines
14 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<!--
$Id$
_______________________________________ Layout _______________________________________
axis 0: aileron
axis 1: elevator
axis 2: rudder
axis 3: throttle
no modifier F3 F4 F3+F4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
button 0 (trigger): brakes parking brake speed brake thrust revers.
button 1 (left): flaps up gear up previous view *
button 2 (middle): reset view dir tail wheel lock cockpit view reset all trim
button 3 (right): flaps down gear down next view *
button 4 (F1): brakes left * zoom out *
button 5 (F2): brakes right * zoom in *
button 6 (F3): //////////////////////// modifier 0 /////////////////////////
button 7 (F4): //////////////////////// modifier 1 /////////////////////////
button 8 (>>): * * * *
button 9 (<<): * * * *
hat left: look left leaner mixture aileron trim rudder trim
hat right: look right richer mixture aileron trim rudder trim
hat back: look down dec prop pitch elevator trim *
hat forward: look up inc prop pitch elevator trim *
F3 and F4 are used like "Shift", "Control", or "Alternate" on computer keyboards.
For example: press F3 and keep holding it down while pressing the fire
button/trigger -> toggle parking brake
When flying the Harrier, "F3/hat left" and "right" control the thrust vector.
___________________________________ Customization ____________________________________
If you want to change some (or all) of the bindings, the recommended way is
to copy this file to your home directory, make your changes there, and include
it from your personal preferences.xml file. You can use any number lower than
1000 for n in <js-named n="0">. The lowest takes precedence in case of identical
names. You can include such a preferences.xml file with the ~~config option,
e.g. ~~config=$HOME/.fgfs/preferences.xml.
<?xml version="1.0"?>
<PropertyList>
<input>
<js-named n="100">
<joysticks include="your-modified-copy.xml"/>
</js-named>
</input>
</PropertyList>
The property "/input/joysticks/js[0]/data/modifier" indicates
the "shift" level. F3 sets bit 0, F4 sets bit 1. The property is 'nil' or
zero if none of the shift buttons is pressed, 1 if F3 is pressed, 2 if F4
is pressed, and 3 if both F3 and F4 are pressed.
Note that you have to enclose nasal scripts in <script><![CDATA[...]]></script>
if they contain characters that interfere with the xml markup. This is the case
if you are, for example, using < (lower than). Alternatively, you can 'escape'
the character with "&lt;".
____________________________________ References ______________________________________
Joysticks: $FG_ROOT/Docs/README.Joystick.html
Properties: see property browser (fgfs menu: "File"->"Browse internal properties")
Nasal: http://www.plausible.org/nasal/
Nasal examples: $FG_ROOT/Nasal/
______________________________________________________________________________________
~~ Melchior FRANZ <mfranz # aon : at>
-->
<PropertyList>
<name>SAITEK CYBORG 3D USB</name>
<name>CYBORG 3D USB</name>
<data>
<mode type="int">0</mode>
<modifier type="int">0</modifier>
</data>
<nasal>
<script><![CDATA[
if (!contains(globals, "saitek_cyborg")) {
globals.saitek_cyborg = {};
saitek_cyborg.js = {};
}
saitek_cyborg.which_node = props.globals.getNode("/input/joysticks/which");
saitek_cyborg.which = func { saitek_cyborg.which_node.getValue() }
i = saitek_cyborg.which();
data = props.globals.getNode("/input/joysticks/js[" ~ i ~ "]").getChild("data");
saitek_cyborg.js[i] = {
mode : data.getNode("mode"),
modifier : data.getNode("modifier"),
};
saitek_cyborg.get_data = func { saitek_cyborg.js[saitek_cyborg.which()] }
saitek_cyborg.get_mode = func {
var js = saitek_cyborg.get_data();
js.modifier.getValue() + js.mode.getValue() * 4;
}
saitek_cyborg.harrier = func {
if (getprop("/sim/aero") == "harrier") {
thv = getprop("/controls/engines/engine[0]/mixture");
gui.popupTip("Thrust vector " ~ int(thv * 120 - 20));
}
}
]]>
</script>
</nasal>
<axis n="0">
<desc>Aileron</desc>
<binding>
<command>property-scale</command>
<property>/controls/flight/aileron</property>
<power type="double">2.0</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.0</power>
</binding>
</axis>
2004-04-29 09:14:14 +00:00
<axis>
<desc>Rudder</desc>
2004-04-29 09:14:14 +00:00
<number>
<unix>2</unix>
2005-02-11 15:30:45 +00:00
<mac>2</mac>
2004-04-29 09:14:14 +00:00
<windows>3</windows>
</number>
<binding>
<command>property-scale</command>
<property>/controls/flight/rudder</property>
<offset type="double">0.0</offset>
<factor type="double">1.0</factor>
2004-02-26 14:51:04 +00:00
<power type="double">2.0</power>
</binding>
</axis>
2004-04-29 09:14:14 +00:00
<axis>
<desc>Throttle</desc>
2004-04-29 09:14:14 +00:00
<number>
<unix>3</unix>
2005-02-11 15:30:45 +00:00
<mac>2</mac>
2004-04-29 09:14:14 +00:00
<windows>2</windows>
</number>
<binding>
<command>nasal</command>
<script>controls.throttleAxis()</script>
</binding>
</axis>
<button n="0"><!-- trigger -->
<desc>Brakes</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (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>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
interpolate("/controls/gear/brake-left", 0, 0.075);
interpolate("/controls/gear/brake-right", 0, 0.075);
} elsif (mod == 1) {
i = !getprop("/controls/gear/brake-parking");
setprop("/controls/gear/brake-parking", i);
gui.popupTip("Parking Brake " ~ ["OFF", "ON"][i]);
setprop("/controls/gear/brake-left", 0);
setprop("/controls/gear/brake-right", 0);
} elsif (mod == 2) {
i = !getprop("/controls/flight/speedbrake");
setprop("/controls/flight/speedbrake", i);
gui.popupTip("Speed Brake " ~ ["OFF", "ON"][i]);
} elsif (mod == 3) {
i = !getprop("/controls/engines/engine[0]/reverser");
props.setAll("/controls/engines/engine", "reverser", i);
gui.popupTip("Thrust Reverser " ~ ["OFF", "ON"][i]);
}
</script>
</binding>
</mod-up>
</button>
<button n="1"><!-- left -->
<desc>Flaps/gear up; previous view</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
controls.stepFlaps(-1);
} elsif (mod == 1) {
controls.gearDown(0);
} elsif (mod == 2) {
view.stepView(-1);
} elsif (mod == 3) {
#
}
</script>
</binding>
</button>
<button n="2"><!-- middle -->
<desc>Reset view; toggle tail-wheel lock; reset trim</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
view.resetView();
} elsif (mod == 1) {
i = !getprop("/controls/gear/tailwheel-lock");
setprop("/controls/gear/tailwheel-lock", i);
gui.popupTip("Tail Wheel " ~ ["UNLOCKED", "LOCKED"][i]);
} elsif (mod == 2) {
setprop("/sim/current-view/view-number", 0);
view.resetView();
} elsif (mod == 3) {
setprop("/controls/flight/elevator-trim", 0);
setprop("/controls/flight/aileron-trim", 0);
setprop("/controls/flight/rudder-trim", 0);
}
</script>
</binding>
</button>
<button n="3"><!-- right -->
<desc>Flaps/gear down; next view</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
controls.stepFlaps(1);
} elsif (mod == 1) {
controls.gearDown(1);
} elsif (mod == 2) {
view.stepView(1);
} elsif (mod == 3) {
#
}
</script>
</binding>
</button>
<button n="4"><!-- F1 -->
<desc>Brakes left</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
interpolate("/controls/gear/brake-left", 1, 0.075);
} elsif (mod == 1) {
#
} elsif (mod == 2) {
view.increase();
} elsif (mod == 3) {
#
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
interpolate("/controls/gear/brake-left", 0, 0.075);
} elsif (mod == 1) {
#
} elsif (mod == 2) {
#
} elsif (mod == 3) {
#
}
</script>
</binding>
</mod-up>
</button>
<button n="5"><!-- F2 -->
<desc>Brakes right</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
interpolate("/controls/gear/brake-right", 1, 0.075);
} elsif (mod == 1) {
#
} elsif (mod == 2) {
view.decrease();
} elsif (mod == 3) {
#
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
interpolate("/controls/gear/brake-right", 0, 0.075);
} elsif (mod == 1) {
#
} elsif (mod == 2) {
#
} elsif (mod == 3) {
#
}
</script>
</binding>
</mod-up>
</button>
<button n="6"><!-- F3 -->
<desc>Modifier Bit 0</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>
js = saitek_cyborg.get_data();
m = js.modifier.getValue();
if (m == 0 or m == 2) {
js.modifier.setIntValue(m + 1);
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
js = saitek_cyborg.get_data();
m = js.modifier.getValue();
if (m == 1 or m == 3) {
js.modifier.setIntValue(m - 1);
}
</script>
</binding>
</mod-up>
</button>
<button n="7"><!-- F4 -->
<desc>Modifier Bit 1</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>
js = saitek_cyborg.get_data();
m = js.modifier.getValue();
if (m == 0 or m == 1) {
js.modifier.setIntValue(m + 2);
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
js = saitek_cyborg.get_data();
m = js.modifier.getValue();
if (m == 2 or m == 3) {
js.modifier.setIntValue(m - 2);
}
</script>
</binding>
</mod-up>
</button>
<button n="8"><!-- >> --> <!-- reserved for switching main-modes -->
<desc>free</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>
<![CDATA[
text = "read $FG_ROOT/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml";
print("Please " ~ text ~ " for the full joystick layout.");
gui.popupTip(text);
]]>
</script>
</binding>
</button>
<button n="9"><!-- << --> <!-- reserved for switching main-modes -->
<desc>free</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>
<![CDATA[
text = "read $FG_ROOT/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml";
print("Please " ~ text ~ " for the full joystick layout.");
gui.popupTip(text);
]]>
</script>
</binding>
</button>
<button n="10"><!-- hat up -->
<desc>View direction; prop pitch; elevator trim</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
view.panViewPitch(1);
} elsif (mod == 1) {
controls.adjPropeller(1);
} elsif (mod == 2) {
controls.elevatorTrim(0.75);
} elsif (mod == 3) {
#
}
</script>
</binding>
</button>
<button n="11"><!-- hat left -->
<desc>View direction; mixture; aileron trim; rudder trim</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
v = getprop("/sim/current-view/view-number");
view.panViewDir(v == 0 or v == 4 ? 1 : -1);
} elsif (mod == 1) {
controls.adjMixture(-1);
saitek_cyborg.harrier();
} elsif (mod == 2) {
controls.aileronTrim(-0.75);
} elsif (mod == 3) {
controls.rudderTrim(-0.75);
}
</script>
</binding>
</button>
<button n="12"><!-- hat right -->
<desc>View elevation; mixture; aileron trim; rudder trim</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
v = getprop("/sim/current-view/view-number");
view.panViewDir(v == 0 or v == 4 ? -1 : 1);
} elsif (mod == 1) {
controls.adjMixture(1);
saitek_cyborg.harrier();
} elsif (mod == 2) {
controls.aileronTrim(0.75);
} elsif (mod == 3) {
controls.rudderTrim(-0.75);
}
</script>
</binding>
</button>
<button n="13"><!-- hat down -->
<desc>View direction; prop pitch; elevator trim</desc>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
mod = saitek_cyborg.get_mode();
if (mod == 0) {
view.panViewPitch(-1);
} elsif (mod == 1) {
controls.adjPropeller(-1);
} elsif (mod == 2) {
controls.elevatorTrim(-0.75);
} elsif (mod == 3) {
#
}
</script>
</binding>
</button>
</PropertyList>