Debian Codegraph @

Input/Joysticks/Genius/f31.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 *******************************************************************************
4 Genius F-31U VIBRATION USB Joystick Configuration for Flightgear.
5 Version 2.
6 © 2011, 2014 Martin Měřinský, [email protected], GPLv2 or later.
7
8 Axes:
9 0 - Aileron
10 1 - Elevator
11 2 - Rudder
12 3 - Throttle
13 4 - View left/right hat
14 5 - View up/down hat
15
16 Buttons:
17 0 - Fire primary and secondary weapon (armament trigger).
18 1 - Cycle view
19 2 - Elevator trim up
20 3 - Elevator trim down
21 4 - Flaps up
22 5 - Mixture richer
23 6 - Brakes
24 7 - Flaps down
25 8 - Mixture leaner
26 9 - Landing gear toggle
27
28 Known issues:
29 Flightgear cannot invert left/right "lookat" view, so this is done using Nasal
30 and thus it works when Flightgear is paused, unlike view elevation (up/down).
31
32 In Windows up and down view is inverted.
33 *******************************************************************************
34 -->
35 <PropertyList>
36 <name type="string">Padix Co. Ltd. 10-Button USB Joystick</name> <!-- GNU/Linux. -->
37 <name type="string">10-Button USB Joystick with Vibration</name> <!-- Windows with vibration driver.-->
38 <name type="string">10-Button USB Joystick</name> <!-- Windows without vibration driver.-->
39
40 <axis n="0">
41 <desc>Aileron</desc>
42 <binding>
43 <command>property-scale</command>
44 <property>/controls/flight/aileron</property>
45 <power type="int">2</power>
46 </binding>
47 </axis>
48
49 <axis n="1">
50 <desc>Elevator</desc>
51 <binding>
52 <command>property-scale</command>
53 <property>/controls/flight/elevator</property>
54 <power type="int">2</power>
55 <factor type="double">-1.0</factor> <!-- Reverse axis. -->
56 </binding>
57 </axis>
58
59 <axis>
60 <desc>Rudder</desc>
61 <number>
62 <unix>2</unix>
63 <windows>3</windows>
64 </number>
65 <binding>
66 <command>property-scale</command>
67 <property>/controls/flight/rudder</property>
68 <power type="int">2</power>
69 <factor type="double">-1.0</factor> <!-- Reverse axis. -->
70 </binding>
71 </axis>
72
73 <axis>
74 <desc>Throttle</desc>
75 <number>
76 <unix>3</unix>
77 <windows>2</windows>
78 </number>
79 <binding>
80 <command>nasal</command>
81 <script>controls.throttleAxis()</script>
82 </binding>
83 </axis>
84
85 <axis>
86 <desc>View direction</desc>
87 <number>
88 <unix>4</unix>
89 <windows>6</windows>
90 </number>
91 <low>
92 <desc>View left</desc>
93 <repeatable>true</repeatable>
94 <binding>
95 <!--
96 This also works, but LookAt views have inverted left/right.
97 <command>property-adjust</command>
98 <property>/sim/current-view/goal-heading-offset-deg</property>
99 <step type="double">3.0</step>
100 -->
101 <command>nasal</command>
102 <script>
103 var valueDelta = -3.0;
104 if (getprop("/sim/current-view/type") == "lookat")
105 {
106 valueDelta = 3.0;
107 }
108 setprop("/sim/current-view/heading-offset-deg", getprop("/sim/current-view/heading-offset-deg") - valueDelta);
109 </script>
110 </binding>
111 </low>
112 <high>
113 <desc>View right</desc>
114 <repeatable>true</repeatable>
115 <binding>
116 <!--
117 This also works, but LookAt views have inverted left/right.
118 <command>property-adjust</command>
119 <property>/sim/current-view/goal-heading-offset-deg</property>
120 <step type="double">-3.0</step>
121 -->
122 <command>nasal</command>
123 <script>
124 var valueDelta = -3.0;
125 if (getprop("/sim/current-view/type") == "lookat")
126 {
127 valueDelta = 3.0;
128 }
129 setprop("/sim/current-view/heading-offset-deg", getprop("/sim/current-view/heading-offset-deg") + valueDelta);
130 </script>
131 </binding>
132 </high>
133 </axis>
134
135 <axis>
136 <desc>View elevation</desc>
137 <number>
138 <unix>5</unix>
139 <windows>7</windows>
140 </number>
141 <low>
142 <desc>View down</desc>
143 <repeatable>true</repeatable>
144 <binding>
145 <command>property-adjust</command>
146 <property>/sim/current-view/goal-pitch-offset-deg</property>
147 <step type="double">3.0</step>
148 </binding>
149 </low>
150 <high>
151 <desc>View up</desc>
152 <repeatable>true</repeatable>
153 <binding>
154 <command>property-adjust</command>
155 <property>/sim/current-view/goal-pitch-offset-deg</property>
156 <step type="double">-3.0</step>
157 </binding>
158 </high>
159 </axis>
160
161 <button n="0">
162 <desc>Fire</desc>
163 <binding>
164 <command>nasal</command>
165 <script>
166 setprop("/controls/armament/trigger", 1);
167 setprop("ai/submodels/trigger", 1);
168 setprop("/controls/armament/trigger1", 1);
169 setprop("ai/submodels/trigger1", 1);
170 </script>
171 </binding>
172 <mod-up>
173 <binding>
174 <command>nasal</command>
175 <script>
176 setprop("/controls/armament/trigger", 0);
177 setprop("ai/submodels/trigger", 0);
178 setprop("/controls/armament/trigger1", 0);
179 setprop("ai/submodels/trigger1", 0);
180 </script>
181 </binding>
182 </mod-up>
183 </button>
184
185 <button n="1">
186 <desc>View cycle</desc>
187 <repeatable>false</repeatable>
188 <binding>
189 <command>nasal</command>
190 <script>
191 view.stepView(1);
192 #gui.popupTip(sprintf("View index: %d, view type: %s", getprop("sim/current-view/view-number"), getprop("/sim/current-view/type")));
193 </script>
194 </binding>
195 </button>
196
197 <button n="2">
198 <desc>Elevator trim up</desc>
199 <repeatable type="bool">true</repeatable>
200 <binding>
201 <command>nasal</command>
202 <script>controls.elevatorTrim(1)</script>
203 </binding>
204 </button>
205
206 <button n="3">
207 <desc>Elevator trim down</desc>
208 <repeatable type="bool">true</repeatable>
209 <binding>
210 <command>nasal</command>
211 <script>controls.elevatorTrim(-1)</script>
212 </binding>
213 </button>
214
215 <button n="4">
216 <desc>Flaps up</desc>
217 <repeatable>false</repeatable>
218 <binding>
219 <command>nasal</command>
220 <script>controls.flapsDown(-1)</script>
221 </binding>
222 <mod-up>
223 <binding>
224 <command>nasal</command>
225 <script>controls.flapsDown(0)</script>
226 </binding>
227 </mod-up>
228 </button>
229
230 <button n="5">
231 <desc>Mixture richer</desc>
232 <repeatable>true</repeatable>
233 <binding>
234 <command>nasal</command>
235 <script>controls.adjMixture(1)</script>
236 </binding>
237 </button>
238
239 <button n="6">
240 <desc>Brakes</desc>
241 <binding>
242 <command>nasal</command>
243 <script>controls.applyBrakes(1)</script>
244 </binding>
245 <mod-up>
246 <binding>
247 <command>nasal</command>
248 <script>controls.applyBrakes(0)</script>
249 </binding>
250 </mod-up>
251 </button>
252
253 <button n="7">
254 <desc>Flaps down</desc>
255 <binding>
256 <command>nasal</command>
257 <script>controls.flapsDown(1)</script>
258 </binding>
259 <mod-up>
260 <binding>
261 <command>nasal</command>
262 <script>controls.flapsDown(0)</script>
263 </binding>
264 </mod-up>
265 </button>
266
267 <button n="8">
268 <desc>Mixture leaner</desc>
269 <repeatable>true</repeatable>
270 <binding>
271 <command>nasal</command>
272 <script>controls.adjMixture(-1)</script>
273 </binding>
274 </button>
275
276 <button n="9">
277 <desc>Landing Gear Toggle</desc>
278 <repeatable>false</repeatable>
279 <binding>
280 <command>nasal</command>
281 <script>controls.gearToggle()</script>
282 </binding>
283 </button>
284
285 </PropertyList>
286