3 Mouse binding definitions.
5 This is a independent configuration file: it is not part of the main
6 FlightGear property tree.
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.
18 <mode-count type="int">4</mode-count>
19 <mode archive="y" type="int">0</mode>
23 <cursor>inherit</cursor>
24 <constrained type="bool">false</constrained>
25 <pass-through type="bool">true</pass-through>
30 <property>/sim/menubar/autovisibility/enabled</property>
32 <command>property-assign</command>
33 <property>/sim/menubar/visibility</property>
34 <value type="bool">false</value>
40 <command>cycle-mouse-mode</command>
41 <reason>right-click</reason>
45 <!-- extra buttons control FoV -->
46 <!-- these are often assigned to mouse-wheel motion in Linux -->
51 <property>/devices/status/mice/mouse[0]/button[2]</property>
52 <not><property>/sim/mouse/right-button-mode-cycle-enabled</property></not>
55 <command>nasal</command>
56 <script>view.decrease()</script>
64 <property>/devices/status/mice/mouse[0]/button[2]</property>
65 <not><property>/sim/mouse/right-button-mode-cycle-enabled</property></not>
68 <command>nasal</command>
69 <script>view.increase()</script>
76 <cursor>crosshair</cursor>
77 <constrained type="bool">true</constrained>
78 <pass-through type="bool">false</pass-through>
82 <command>cycle-mouse-mode</command>
83 <reason>right-click</reason>
87 <!-- extra buttons control elevator trim -->
88 <!-- these are often assigned to mouse-wheel motion in Linux -->
91 <command>property-adjust</command>
92 <property>/controls/flight/elevator-trim</property>
93 <step type="double">0.01</step>
99 <command>property-adjust</command>
100 <property>/controls/flight/elevator-trim</property>
101 <step type="double">-0.01</step>
105 <!-- Mouse left/right motion. -->
108 <!-- No buttons pressed: control ailerons -->
113 <property>/devices/status/mice/mouse[0]/button[0]</property>
116 <property>/devices/status/mice/mouse[0]/button[1]</property>
120 <command>property-adjust</command>
121 <property>/controls/flight/aileron</property>
122 <factor type="double">4.0</factor>
123 <min type="double">-1.0</min>
124 <max type="double">1.0</max>
125 <wrap type="bool">false</wrap>
128 <!-- Left button pressed: control rudder -->
132 <property>/devices/status/mice/mouse[0]/button[0]</property>
134 <property>/devices/status/mice/mouse[0]/button[1]</property>
138 <command>property-adjust</command>
139 <property>/controls/flight/rudder</property>
140 <factor type="double">4.0</factor>
141 <min type="double">-1.0</min>
142 <max type="double">1.0</max>
143 <wrap type="bool">false</wrap>
148 <!-- Mouse up/down motion -->
151 <!-- No buttons pressed: control elevator -->
156 <property>/devices/status/mice/mouse[0]/button[0]</property>
159 <property>/devices/status/mice/mouse[0]/button[1]</property>
163 <command>property-adjust</command>
164 <property>/controls/flight/elevator</property>
165 <factor type="double">-4.0</factor>
166 <min type="double">-1.0</min>
167 <max type="double">1.0</max>
168 <wrap type="bool">false</wrap>
171 <!-- Middle button pressed: control throttle -->
173 <command>nasal</command>
174 <script>controls.throttleMouse()</script>
180 <!-- Mode 2: view mode -->
182 <cursor>left-right</cursor>
183 <constrained type="bool">true</constrained>
184 <pass-through type="bool">false</pass-through>
186 <!-- left button centres view direction; middle + left also resets view point -->
189 <command>nasal</command>
197 <property>/devices/status/mice/mouse[0]/button[1]</property>
199 <command>nasal</command>
206 <!-- right button switches modes -->
209 <command>cycle-mouse-mode</command>
210 <reason>right-click</reason>
215 <!-- extra buttons control FoV -->
216 <!-- these are often assigned to mouse-wheel motion in Linux -->
219 <command>nasal</command>
220 <script>view.decrease()</script>
226 <command>nasal</command>
227 <script>view.increase()</script>
231 <!-- Mouse left/right motion -->
234 <!-- No buttons pressed: rotate the view left or right -->
239 <property>/devices/status/mice/mouse[0]/button[0]</property>
242 <property>/devices/status/mice/mouse[0]/button[1]</property>
246 <command>property-adjust</command>
247 <property>/sim/current-view/heading-offset-deg</property>
248 <factor type="double">-360</factor>
249 <min type="double">0</min>
250 <max type="double">360</max>
251 <wrap type="bool">true</wrap>
255 <!-- Middle button pressed: move the view position left or right -->
260 <property>/devices/status/mice/mouse[0]/button[0]</property>
262 <property>/devices/status/mice/mouse[0]/button[1]</property>
265 <command>property-adjust</command>
266 <property>/sim/current-view/x-offset-m</property>
267 <factor type="double">1</factor>
268 <wrap type="bool">false</wrap>
273 <!-- Mouse up/down motion -->
276 <!-- No buttons pressed: tilt the view up and down -->
281 <property>/devices/status/mice/mouse[0]/button[0]</property>
284 <property>/devices/status/mice/mouse[0]/button[1]</property>
288 <command>property-adjust</command>
289 <property>/sim/current-view/pitch-offset-deg</property>
290 <factor type="double">-180</factor>
291 <min type="double">-90</min>
292 <max type="double">90</max>
293 <wrap type="bool">false</wrap>
296 <!-- Middle button pressed move the view up and down -->
301 <property>/devices/status/mice/mouse[0]/button[0]</property>
303 <property>/devices/status/mice/mouse[0]/button[1]</property>
306 <command>property-adjust</command>
307 <property>/sim/current-view/y-offset-m</property>
308 <factor type="double">-1</factor>
309 <wrap type="bool">false</wrap>
314 <!-- Middle button and Ctrl pressed: move the view forward and backward -->
320 <property>/devices/status/mice/mouse[0]/button[0]</property>
322 <property>/devices/status/mice/mouse[0]/button[1]</property>
325 <command>property-adjust</command>
326 <property>/sim/current-view/z-offset-m</property>
327 <factor type="double">1</factor>
328 <wrap type="bool">false</wrap>
334 <!-- Mode 3: spring-loaded-view mode -->
336 <cursor>left-right</cursor>
337 <constrained type="bool">true</constrained>
338 <pass-through type="bool">false</pass-through>
340 <!-- Mouse left/right motion -->
343 <!-- rotate the view left or right -->
347 <property>/devices/status/mice/mouse[0]/button[1]</property>
350 <command>property-adjust</command>
351 <property>/sim/current-view/heading-offset-deg</property>
352 <factor type="double">-360</factor>
353 <min type="double">0</min>
354 <max type="double">360</max>
355 <wrap type="bool">true</wrap>
358 <!-- Middle button pressed: move the view position left or right -->
361 <property>/devices/status/mice/mouse[0]/button[1]</property>
363 <command>property-adjust</command>
364 <property>/sim/current-view/x-offset-m</property>
365 <factor type="double">1</factor>
366 <wrap type="bool">false</wrap>
371 <!-- Mouse up/down motion -->
374 <!-- tilt the view up and down -->
378 <property>/devices/status/mice/mouse[0]/button[1]</property>
381 <command>property-adjust</command>
382 <property>/sim/current-view/pitch-offset-deg</property>
383 <factor type="double">-180</factor>
384 <min type="double">-90</min>
385 <max type="double">90</max>
386 <wrap type="bool">false</wrap>
389 <!-- Middle button pressed move the view up and down -->
392 <property>/devices/status/mice/mouse[0]/button[1]</property>
394 <command>property-adjust</command>
395 <property>/sim/current-view/y-offset-m</property>
396 <factor type="double">-1</factor>
397 <wrap type="bool">false</wrap>
403 <!-- Middle button and Ctrl pressed: move the view forward and backward -->
406 <property>/devices/status/mice/mouse[0]/button[1]</property>
408 <command>property-adjust</command>
409 <property>/sim/current-view/z-offset-m</property>
410 <factor type="double">1</factor>
411 <wrap type="bool">false</wrap>
416 <not><property>/devices/status/mice/mouse[0]/button[1]</property></not>
418 <command>property-adjust</command>
419 <property>/sim/current-view/y-offset-m</property>
420 <factor type="double">-1</factor>
421 <wrap type="bool">false</wrap>
427 <command>property-adjust</command>
428 <property>/sim/current-view/x-offset-m</property>
429 <factor type="double">1</factor>
430 <wrap type="bool">false</wrap>
436 </mouse> <!-- of mouse 0 -->