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>
41 <property>/sim/mouse/right-button-mode-cycle-enabled</property>
43 <command>property-assign</command>
44 <property>/devices/status/mice/mouse[0]/mode</property>
45 <value type="int">1</value>
52 <cursor>crosshair</cursor>
53 <constrained type="bool">true</constrained>
54 <pass-through type="bool">false</pass-through>
59 <property>/sim/mouse/right-button-mode-cycle-enabled</property>
61 <command>property-assign</command>
62 <property>/devices/status/mice/mouse[0]/mode</property>
63 <value type="int">2</value>
67 <!-- extra buttons control elevator trim -->
68 <!-- these are often assigned to mouse-wheel motion in Linux -->
71 <command>property-adjust</command>
72 <property>/controls/flight/elevator-trim</property>
73 <step type="double">0.01</step>
79 <command>property-adjust</command>
80 <property>/controls/flight/elevator-trim</property>
81 <step type="double">-0.01</step>
85 <!-- Mouse left/right motion. -->
88 <!-- No buttons pressed: control ailerons -->
93 <property>/devices/status/mice/mouse[0]/button[0]</property>
96 <property>/devices/status/mice/mouse[0]/button[1]</property>
100 <command>property-adjust</command>
101 <property>/controls/flight/aileron</property>
102 <factor type="double">4.0</factor>
103 <min type="double">-1.0</min>
104 <max type="double">1.0</max>
105 <wrap type="bool">false</wrap>
108 <!-- Left button pressed: control rudder -->
112 <property>/devices/status/mice/mouse[0]/button[0]</property>
114 <property>/devices/status/mice/mouse[0]/button[1]</property>
118 <command>property-adjust</command>
119 <property>/controls/flight/rudder</property>
120 <factor type="double">4.0</factor>
121 <min type="double">-1.0</min>
122 <max type="double">1.0</max>
123 <wrap type="bool">false</wrap>
128 <!-- Mouse up/down motion -->
131 <!-- No buttons pressed: control elevator -->
136 <property>/devices/status/mice/mouse[0]/button[0]</property>
139 <property>/devices/status/mice/mouse[0]/button[1]</property>
143 <command>property-adjust</command>
144 <property>/controls/flight/elevator</property>
145 <factor type="double">-4.0</factor>
146 <min type="double">-1.0</min>
147 <max type="double">1.0</max>
148 <wrap type="bool">false</wrap>
151 <!-- Middle button pressed: control throttle -->
153 <command>nasal</command>
154 <script>controls.throttleMouse()</script>
160 <!-- Mode 2: view mode -->
162 <cursor>left-right</cursor>
163 <constrained type="bool">true</constrained>
164 <pass-through type="bool">false</pass-through>
166 <!-- left button centres view direction; middle + left also resets view point -->
169 <command>nasal</command>
177 <property>/devices/status/mice/mouse[0]/button[1]</property>
179 <command>nasal</command>
186 <!-- right button switches modes -->
190 <property>/sim/mouse/right-button-mode-cycle-enabled</property>
192 <command>property-assign</command>
193 <property>/devices/status/mice/mouse[0]/mode</property>
194 <value type="int">0</value>
198 <!-- extra buttons control FoV -->
199 <!-- these are often assigned to mouse-wheel motion in Linux -->
202 <command>nasal</command>
203 <script>view.decrease()</script>
209 <command>nasal</command>
210 <script>view.increase()</script>
214 <!-- Mouse left/right motion -->
217 <!-- No buttons pressed: rotate the view left or right -->
222 <property>/devices/status/mice/mouse[0]/button[0]</property>
225 <property>/devices/status/mice/mouse[0]/button[1]</property>
229 <command>property-adjust</command>
230 <property>/sim/current-view/heading-offset-deg</property>
231 <factor type="double">-360</factor>
232 <min type="double">0</min>
233 <max type="double">360</max>
234 <wrap type="bool">true</wrap>
238 <!-- Middle button pressed: move the view position left or right -->
243 <property>/devices/status/mice/mouse[0]/button[0]</property>
245 <property>/devices/status/mice/mouse[0]/button[1]</property>
248 <command>property-adjust</command>
249 <property>/sim/current-view/x-offset-m</property>
250 <factor type="double">1</factor>
251 <wrap type="bool">false</wrap>
256 <!-- Mouse up/down motion -->
259 <!-- No buttons pressed: tilt the view up and down -->
264 <property>/devices/status/mice/mouse[0]/button[0]</property>
267 <property>/devices/status/mice/mouse[0]/button[1]</property>
271 <command>property-adjust</command>
272 <property>/sim/current-view/pitch-offset-deg</property>
273 <factor type="double">-180</factor>
274 <min type="double">-90</min>
275 <max type="double">90</max>
276 <wrap type="bool">false</wrap>
279 <!-- Middle button pressed, no Ctrl: move the view up and down -->
284 <property>/devices/status/mice/mouse[0]/button[0]</property>
286 <property>/devices/status/mice/mouse[0]/button[1]</property>
288 <property>/devices/status/keyboard/ctrl</property>
292 <command>property-adjust</command>
293 <property>/sim/current-view/y-offset-m</property>
294 <factor type="double">-1</factor>
295 <wrap type="bool">false</wrap>
298 <!-- Middle button and Ctrl pressed: move the view forward and backward -->
303 <property>/devices/status/mice/mouse[0]/button[0]</property>
305 <property>/devices/status/mice/mouse[0]/button[1]</property>
306 <property>/devices/status/keyboard/ctrl</property>
309 <command>property-adjust</command>
310 <property>/sim/current-view/z-offset-m</property>
311 <factor type="double">1</factor>
312 <wrap type="bool">false</wrap>
319 <!-- Mode 3: spring-loaded-view mode -->
321 <cursor>left-right</cursor>
322 <constrained type="bool">true</constrained>
323 <pass-through type="bool">false</pass-through>
325 <!-- Mouse left/right motion -->
328 <!-- rotate the view left or right -->
330 <command>property-adjust</command>
331 <property>/sim/current-view/heading-offset-deg</property>
332 <factor type="double">-360</factor>
333 <min type="double">0</min>
334 <max type="double">360</max>
335 <wrap type="bool">true</wrap>
340 <!-- Mouse up/down motion -->
343 <!-- tilt the view up and down -->
345 <command>property-adjust</command>
346 <property>/sim/current-view/pitch-offset-deg</property>
347 <factor type="double">-180</factor>
348 <min type="double">-90</min>
349 <max type="double">90</max>
350 <wrap type="bool">false</wrap>
357 </mouse> <!-- of mouse 0 -->