config / .fgfs / mice-perso.xml /
Newer Older
426 lines | 11.549kb
ajout conf perso pour flight...
Sébastien MARQUE authored on 2017-05-11
1
<?xml version="1.0"?>
2
<!--
3
Mouse binding definitions.
4

            
5
This is a independent configuration file: it is not part of the main
6
FlightGear property tree.
7

            
8
Currently, Glut supports only one mouse, but the configuration format
9
is designed to support additional mice in the future if possible.  The
10
current mode for each mouse is held in the
11
/devices/status/mice/mouse[n]/mode property.
12
-->
13

            
14
<PropertyList>
15
<input>
16
<mice>
17

            
18
 <mouse n="0">
19

            
20
  <mode-count type="int">4</mode-count>
21
  <mode archive="y" type="int">0</mode>
22

            
23

            
24
  <mode n="0">
25
   <cursor>inherit</cursor>
26
   <constrained type="bool">false</constrained>
27
   <pass-through type="bool">true</pass-through>
28

            
29
   <button n="0">
30
    <binding>
31
     <condition>
32
       <property>/sim/menubar/autovisibility/enabled</property>
33
     </condition>
34
     <command>property-assign</command>
35
     <property>/sim/menubar/visibility</property>
36
     <value type="bool">false</value>
37
    </binding>
38
    <binding>
39
     <condition>
40
       <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
41
     </condition>
42
     <command>property-assign</command>
43
     <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
44
     <value type="bool">0</value>
45
    </binding>
46
   </button>
47

            
48
   <button n="2">
49
    <binding>
50
    <condition>
51
      <property>/sim/mouse/right-button-mode-cycle-enabled</property>
52
       <not>
53
         <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
54
       </not>
55
     </condition>
56
     <command>nasal</command>
57
     <script>
58
       setprop("/devices/status/mice/mouse[0]/mode", props.globals.getNode("/input/joysticks/js/id") == nil ? 1 : 2);
59
     </script>
60
    </binding>
61
    <binding>
62
     <condition>
63
       <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
64
     </condition>
65
     <command>property-assign</command>
66
     <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
67
     <value type="bool">0</value>
68
    </binding>
69
   </button>
70

            
71
   <!-- extra buttons control elevator trim -->
72
   <!-- these are often assigned to mouse-wheel motion in Linux -->
73
   <button n="3">
74
    <binding>
75
     <condition>
76
       <not>
77
         <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
78
       </not>
79
     </condition>
80
     <command>nasal</command>
81
     <script>view.decrease();</script>
82
    </binding>
83
    <binding>
84
     <condition>
85
       <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
86
     </condition>
87
     <command>property-assign</command>
88
     <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
89
     <value type="bool">0</value>
90
    </binding>
91
   </button>
92

            
93
   <button n="4">
94
    <binding>
95
     <condition>
96
       <not>
97
         <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
98
       </not>
99
     </condition>
100
     <command>nasal</command>
101
     <script>view.increase();</script>
102
    </binding>
103
    <binding>
104
     <condition>
105
       <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
106
     </condition>
107
     <command>property-assign</command>
108
     <property type="bool">/devices/status/mice/mouse[0]/mode/freezed</property>
109
     <value type="bool">0</value>
110
    </binding>
111
   </button>
112
 
113
  </mode>
114

            
115
  <mode n="1">
116
   <cursor>crosshair</cursor>
117
   <constrained type="bool">true</constrained>
118
   <pass-through type="bool">false</pass-through>
119

            
120
   <button n="2">
121
    <binding>
122
    <condition>
123
      <property>/sim/mouse/right-button-mode-cycle-enabled</property>
124
    </condition>
125
     <command>property-assign</command>
126
     <property>/devices/status/mice/mouse[0]/mode</property>
127
     <value type="int">2</value>
128
    </binding>
129
   </button>
130

            
131
   <!-- extra buttons control elevator trim -->
132
   <!-- these are often assigned to mouse-wheel motion in Linux -->
133
   <button n="3">
134
    <binding>
135
     <command>property-adjust</command>
136
     <property>/controls/flight/elevator-trim</property>
137
     <step type="double">0.01</step>
138
    </binding>
139
   </button>
140

            
141
   <button n="4">
142
    <binding>
143
     <command>property-adjust</command>
144
     <property>/controls/flight/elevator-trim</property>
145
     <step type="double">-0.01</step>
146
    </binding>
147
   </button>
148

            
149
   <!-- Mouse left/right motion. -->
150
   <x-axis>
151

            
152
    <!-- No buttons pressed: control ailerons -->
153
    <binding>
154
     <condition>
155
      <and>
156
       <not>
157
        <property>/devices/status/mice/mouse[0]/button[0]</property>
158
       </not>
159
       <not>
160
        <property>/devices/status/mice/mouse[0]/button[1]</property>
161
       </not>
162
      </and>
163
     </condition>
164
     <command>property-adjust</command>
165
     <property>/controls/flight/aileron</property>
166
     <factor type="double">4.0</factor>
167
     <min type="double">-1.0</min>
168
     <max type="double">1.0</max>
169
     <wrap type="bool">false</wrap>
170
    </binding>
171

            
172
    <!-- Left button pressed: control rudder -->
173
    <binding>
174
     <condition>
175
      <and>
176
       <property>/devices/status/mice/mouse[0]/button[0]</property>
177
       <not>
178
        <property>/devices/status/mice/mouse[0]/button[1]</property>
179
       </not>
180
      </and>
181
     </condition>
182
     <command>property-adjust</command>
183
     <property>/controls/flight/rudder</property>
184
     <factor type="double">4.0</factor>
185
     <min type="double">-1.0</min>
186
     <max type="double">1.0</max>
187
     <wrap type="bool">false</wrap>
188
    </binding>
189

            
190
   </x-axis>
191

            
192
   <!-- Mouse up/down motion -->
193
   <y-axis>
194

            
195
    <!-- No buttons pressed: control elevator -->
196
    <binding>
197
     <condition>
198
      <and>
199
       <not>
200
        <property>/devices/status/mice/mouse[0]/button[0]</property>
201
       </not>
202
       <not>
203
        <property>/devices/status/mice/mouse[0]/button[1]</property>
204
       </not>
205
      </and>
206
     </condition>
207
     <command>property-adjust</command>
208
     <property>/controls/flight/elevator</property>
209
     <factor type="double">-4.0</factor>
210
     <min type="double">-1.0</min>
211
     <max type="double">1.0</max>
212
     <wrap type="bool">false</wrap>
213
    </binding>
214

            
215
    <!-- Middle button pressed: control throttle -->
216
    <binding>
217
     <command>nasal</command>
218
     <script>controls.throttleMouse()</script>
219
    </binding>
220
   </y-axis>
221

            
222
  </mode>
223

            
224
  <!-- Mode 2: view mode -->
225
  <mode n="2">
226
   <cursor>left-right</cursor>
227
   <constrained type="bool">true</constrained>
228
   <pass-through type="bool">false</pass-through>
229

            
230
   <!-- left button centres view direction; middle + left also resets view point -->
231
   <button n="0">
232
    <binding>
233
     <command>nasal</command>
234
     <script>
235
         view.resetViewDir();
236
         view.resetFOV();
237
     </script>
238
    </binding>
239
    <binding>
240
     <condition>
241
      <property>/devices/status/mice/mouse[0]/button[1]</property>
242
     </condition>
243
     <command>nasal</command>
244
     <script>
245
         view.resetViewPos();
246
     </script>
247
    </binding>
248
   </button>
249

            
250
   <!-- right button switches modes -->
251
   <button n="2">
252
    <binding>
253
        <condition>
254
          <property>/sim/mouse/right-button-mode-cycle-enabled</property>
255
        </condition>
256
     <command>property-assign</command>
257
     <property>/devices/status/mice/mouse[0]/mode</property>
258
     <value type="int">0</value>
259
    </binding>
260
   </button>
261
 
262
   <!-- extra buttons control FoV -->
263
   <!-- these are often assigned to mouse-wheel motion in Linux -->
264
   <button n="3">
265
    <binding>
266
      <command>nasal</command>
267
      <script>view.decrease()</script>
268
    </binding>
269
   </button>
270

            
271
   <button n="4">
272
    <binding>
273
      <command>nasal</command>
274
      <script>view.increase()</script>
275
    </binding>
276
   </button>
277

            
278
   <!-- Mouse left/right motion -->
279
   <x-axis>
280

            
281
    <!-- No buttons pressed: rotate the view left or right -->
282
    <binding>
283
     <condition>
284
      <and>
285
       <not>
286
        <property>/devices/status/mice/mouse[0]/button[0]</property>
287
       </not>
288
       <not>
289
        <property>/devices/status/mice/mouse[0]/button[1]</property>
290
       </not>
291
      </and>
292
     </condition>
293
     <command>property-adjust</command>
294
     <property>/sim/current-view/heading-offset-deg</property>
295
     <factor type="double">-360</factor>
296
     <min type="double">0</min>
297
     <max type="double">360</max>
298
     <wrap type="bool">true</wrap>
299
    </binding>
300

            
301

            
302
    <!-- Middle button pressed: move the view position left or right -->
303
    <binding>
304
     <condition>
305
      <and>
306
       <not>
307
        <property>/devices/status/mice/mouse[0]/button[0]</property>
308
       </not>
309
       <property>/devices/status/mice/mouse[0]/button[1]</property>
310
      </and>
311
     </condition>
312
     <command>property-adjust</command>
313
     <property>/sim/current-view/x-offset-m</property>
314
     <factor type="double">1</factor>
315
     <wrap type="bool">false</wrap>
316
    </binding>
317

            
318
   </x-axis>
319

            
320
   <!-- Mouse up/down motion -->
321
   <y-axis>
322

            
323
    <!-- No buttons pressed: tilt the view up and down -->
324
    <binding>
325
     <condition>
326
      <and>
327
       <not>
328
        <property>/devices/status/mice/mouse[0]/button[0]</property>
329
       </not>
330
       <not>
331
        <property>/devices/status/mice/mouse[0]/button[1]</property>
332
       </not>
333
      </and>
334
     </condition>
335
     <command>property-adjust</command>
336
     <property>/sim/current-view/pitch-offset-deg</property>
337
     <factor type="double">-180</factor>
338
     <min type="double">-90</min>
339
     <max type="double">90</max>
340
     <wrap type="bool">false</wrap>
341
    </binding>
342

            
343
    <!-- Middle button pressed, no Ctrl: move the view up and down -->
344
    <binding>
345
     <condition>
346
      <and>
347
       <not>
348
        <property>/devices/status/mice/mouse[0]/button[0]</property>
349
       </not>
350
       <property>/devices/status/mice/mouse[0]/button[1]</property>
351
       <not>
352
        <property>/devices/status/keyboard/ctrl</property>
353
       </not>
354
      </and>
355
     </condition>
356
     <command>property-adjust</command>
357
     <property>/sim/current-view/y-offset-m</property>
358
     <factor type="double">-1</factor>
359
     <wrap type="bool">false</wrap>
360
    </binding>
361

            
362
    <!-- Middle button and Ctrl pressed: move the view forward and backward -->
363
    <binding>
364
     <condition>
365
      <and>
366
       <not>
367
        <property>/devices/status/mice/mouse[0]/button[0]</property>
368
       </not>
369
       <property>/devices/status/mice/mouse[0]/button[1]</property>
370
       <property>/devices/status/keyboard/ctrl</property>
371
      </and>
372
     </condition>
373
     <command>property-adjust</command>
374
     <property>/sim/current-view/z-offset-m</property>
375
     <factor type="double">1</factor>
376
     <wrap type="bool">false</wrap>
377
    </binding>
378

            
379
   </y-axis>
380

            
381
  </mode>
382

            
383
  <!-- Mode 3: spring-loaded-view mode -->
384
  <mode n="3">
385
   <cursor>left-right</cursor>
386
   <constrained type="bool">true</constrained>
387
   <pass-through type="bool">false</pass-through>
388

            
389
   <!-- Mouse left/right motion -->
390
   <x-axis>
391

            
392
    <!-- rotate the view left or right -->
393
    <binding>
394
     <command>property-adjust</command>
395
     <property>/sim/current-view/heading-offset-deg</property>
396
     <factor type="double">-360</factor>
397
     <min type="double">0</min>
398
     <max type="double">360</max>
399
     <wrap type="bool">true</wrap>
400
    </binding>
401

            
402
   </x-axis>
403

            
404
   <!-- Mouse up/down motion -->
405
   <y-axis>
406

            
407
    <!-- tilt the view up and down -->
408
    <binding>
409
     <command>property-adjust</command>
410
     <property>/sim/current-view/pitch-offset-deg</property>
411
     <factor type="double">-180</factor>
412
     <min type="double">-90</min>
413
     <max type="double">90</max>
414
     <wrap type="bool">false</wrap>
415
    </binding>
416

            
417
   </y-axis>
418

            
419
  </mode>
420
    
421
 </mouse> <!-- of mouse 0 -->
422

            
423
</mice>
424
</input>
425
</PropertyList>
426