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">3</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>
29 <command>property-assign</command>
30 <property>/devices/status/mice/mouse[0]/mode</property>
31 <value type="int">1</value>
35 <!-- extra buttons control elevator trim -->
36 <!-- these are often assigned to mouse-wheel motion in Linux -->
39 <command>property-adjust</command>
40 <property>/controls/flight/elevator-trim</property>
41 <step type="double">0.002</step>
47 <command>property-adjust</command>
48 <property>/controls/flight/elevator-trim</property>
49 <step type="double">-0.002</step>
56 <cursor>crosshair</cursor>
57 <constrained type="bool">true</constrained>
58 <pass-through type="bool">false</pass-through>
62 <command>property-assign</command>
63 <property>/devices/status/mice/mouse[0]/mode</property>
64 <value type="int">2</value>
68 <!-- extra buttons control elevator trim -->
69 <!-- these are often assigned to mouse-wheel motion in Linux -->
72 <command>property-adjust</command>
73 <property>/controls/flight/elevator-trim</property>
74 <step type="double">0.01</step>
80 <command>property-adjust</command>
81 <property>/controls/flight/elevator-trim</property>
82 <step type="double">-0.01</step>
86 <!-- Mouse left/right motion. -->
89 <!-- No buttons pressed: control ailerons -->
94 <property>/devices/status/mice/mouse[0]/button[0]</property>
97 <property>/devices/status/mice/mouse[0]/button[1]</property>
101 <command>property-adjust</command>
102 <property>/controls/flight/aileron</property>
103 <factor type="double">4.0</factor>
104 <min type="double">-1.0</min>
105 <max type="double">1.0</max>
106 <wrap type="bool">false</wrap>
109 <!-- Left button pressed: control rudder -->
113 <property>/devices/status/mice/mouse[0]/button[0]</property>
115 <property>/devices/status/mice/mouse[0]/button[1]</property>
119 <command>property-adjust</command>
120 <property>/controls/flight/rudder</property>
121 <factor type="double">4.0</factor>
122 <min type="double">-1.0</min>
123 <max type="double">1.0</max>
124 <wrap type="bool">false</wrap>
129 <!-- Mouse up/down motion -->
132 <!-- No buttons pressed: control elevator -->
137 <property>/devices/status/mice/mouse[0]/button[0]</property>
140 <property>/devices/status/mice/mouse[0]/button[1]</property>
144 <command>property-adjust</command>
145 <property>/controls/flight/elevator</property>
146 <factor type="double">-4.0</factor>
147 <min type="double">-1.0</min>
148 <max type="double">1.0</max>
149 <wrap type="bool">false</wrap>
152 <!-- Middle button pressed: control throttle -->
154 <command>nasal</command>
155 <script>controls.throttleMouse()</script>
161 <!-- Mode 2: view mode -->
163 <cursor>left-right</cursor>
164 <constrained type="bool">true</constrained>
165 <pass-through type="bool">false</pass-through>
167 <!-- left button centres view direction; middle + left also resets view point -->
170 <command>property-assign</command>
171 <property>/sim/current-view/heading-offset-deg</property>
172 <property>/sim/view/config/front-direction-deg</property>
175 <command>property-assign</command>
176 <property>/sim/current-view/goal-pitch-offset-deg</property>
177 <property>/sim/view/config/pitch-offset-deg</property>
181 <property>/devices/status/mice/mouse[0]/button[1]</property>
183 <command>property-assign</command>
184 <property>/sim/current-view/x-offset-m</property>
185 <property>/sim/view/config/x-offset-m</property>
189 <property>/devices/status/mice/mouse[0]/button[1]</property>
191 <command>property-assign</command>
192 <property>/sim/current-view/y-offset-m</property>
193 <property>/sim/view/config/y-offset-m</property>
197 <property>/devices/status/mice/mouse[0]/button[1]</property>
199 <command>property-assign</command>
200 <property>/sim/current-view/z-offset-m</property>
201 <property>/sim/view/config/z-offset-m</property>
205 <!-- right button switches modes -->
208 <command>property-assign</command>
209 <property>/devices/status/mice/mouse[0]/mode</property>
210 <value type="int">0</value>
214 <!-- extra buttons control elevator trim -->
215 <!-- these are often assigned to mouse-wheel motion in Linux -->
218 <command>property-adjust</command>
219 <property>/controls/flight/elevator-trim</property>
220 <step type="double">0.01</step>
226 <command>property-adjust</command>
227 <property>/controls/flight/elevator-trim</property>
228 <step type="double">-0.01</step>
232 <!-- Mouse left/right motion -->
235 <!-- No buttons pressed: rotate the view left or right -->
240 <property>/devices/status/mice/mouse[0]/button[0]</property>
243 <property>/devices/status/mice/mouse[0]/button[1]</property>
247 <command>property-adjust</command>
248 <property>/sim/current-view/heading-offset-deg</property>
249 <factor type="double">-360</factor>
250 <min type="double">0</min>
251 <max type="double">360</max>
252 <wrap type="bool">true</wrap>
256 <!-- Middle button pressed: move the view position left or right -->
261 <property>/devices/status/mice/mouse[0]/button[0]</property>
263 <property>/devices/status/mice/mouse[0]/button[1]</property>
266 <command>property-adjust</command>
267 <property>/sim/current-view/x-offset-m</property>
268 <factor type="double">1</factor>
269 <wrap type="bool">false</wrap>
274 <!-- Mouse up/down motion -->
277 <!-- No buttons pressed: tilt the view up and down -->
282 <property>/devices/status/mice/mouse[0]/button[0]</property>
285 <property>/devices/status/mice/mouse[0]/button[1]</property>
289 <command>property-adjust</command>
290 <property>/sim/current-view/pitch-offset-deg</property>
291 <factor type="double">-180</factor>
292 <min type="double">-90</min>
293 <max type="double">90</max>
294 <wrap type="bool">false</wrap>
297 <!-- Middle button pressed, no Ctrl: move the view up and down -->
302 <property>/devices/status/mice/mouse[0]/button[0]</property>
304 <property>/devices/status/mice/mouse[0]/button[1]</property>
306 <property>/devices/status/keyboard/ctrl</property>
310 <command>property-adjust</command>
311 <property>/sim/current-view/y-offset-m</property>
312 <factor type="double">-1</factor>
313 <wrap type="bool">false</wrap>
316 <!-- Middle button and Ctrl pressed: move the view forward and backward -->
321 <property>/devices/status/mice/mouse[0]/button[0]</property>
323 <property>/devices/status/mice/mouse[0]/button[1]</property>
324 <property>/devices/status/keyboard/ctrl</property>
327 <command>property-adjust</command>
328 <property>/sim/current-view/z-offset-m</property>
329 <factor type="double">1</factor>
330 <wrap type="bool">false</wrap>