Added user-definable positions for front, left, back, etc. rather than
[fg:toms-fgdata.git] / mice.xml
1 <?xml version="1.0"?>
2 <!--
3 Mouse binding definitions.
4
5 NOTE: CURRENTLY, THIS FILE IS USED ONLY IF YOU CONFIGURE FLIGHTGEAR
6 'with-new-mouse' AT BUILD TIME.
7
8 This file is included by preferences.xml, and uses the context of its
9 inclusion point; that means that you need to prepend "/input/mice"
10 to all property names.
11
12 Currently, Glut supports only one mouse, but the configuration format
13 is designed to support additional mice in the future if possible.
14
15 The current mode for each mouse is held in the
16 /devices/status/mice/mouse[n]/mode property.
17 -->
18
19
20 <PropertyList>
21
22  <mouse n="0">
23
24   <mode-count type="int">3</mode-count>
25   <mode archive="y" type="int">0</mode>
26
27
28   <mode n="0">
29    <cursor>inherit</cursor>
30    <constrained type="bool">false</constrained>
31    <pass-through type="bool">true</pass-through>
32
33    <button n="2">
34     <binding>
35      <command>property-assign</command>
36      <property>/devices/status/mice/mouse[0]/mode</property>
37      <value type="int">1</value>
38     </binding>
39    </button>
40
41    <!-- extra buttons control elevator trim -->
42    <!-- these are often assigned to mouse-wheel motion in Linux -->
43    <button n="3">
44     <binding>
45      <command>property-adjust</command>
46      <property>/controls/elevator-trim</property>
47      <step type="double">0.002</step>
48     </binding>
49    </button>
50
51    <button n="4">
52     <binding>
53      <command>property-adjust</command>
54      <property>/controls/elevator-trim</property>
55      <step type="double">-0.002</step>
56     </binding>
57    </button>
58
59   </mode>
60
61   <mode n="1">
62    <cursor>crosshair</cursor>
63    <constrained type="bool">true</constrained>
64    <pass-through type="bool">false</pass-through>
65
66    <button n="2">
67     <binding>
68      <command>property-assign</command>
69      <property>/devices/status/mice/mouse[0]/mode</property>
70      <value type="int">2</value>
71     </binding>
72    </button>
73
74    <!-- extra buttons control elevator trim -->
75    <!-- these are often assigned to mouse-wheel motion in Linux -->
76    <button n="3">
77     <binding>
78      <command>property-adjust</command>
79      <property>/controls/elevator-trim</property>
80      <step type="double">0.01</step>
81     </binding>
82    </button>
83
84    <button n="4">
85     <binding>
86      <command>property-adjust</command>
87      <property>/controls/elevator-trim</property>
88      <step type="double">-0.01</step>
89     </binding>
90    </button>
91
92    <!-- Mouse left/right motion. -->
93    <x-axis>
94
95     <!-- No buttons pressed: control ailerons -->
96     <binding>
97      <condition>
98       <and>
99        <not>
100         <property>/devices/status/mice/mouse[0]/button[0]</property>
101        </not>
102        <not>
103         <property>/devices/status/mice/mouse[0]/button[1]</property>
104        </not>
105       </and>
106      </condition>
107      <command>property-adjust</command>
108      <property>/controls/aileron</property>
109      <factor type="double">4.0</factor>
110      <min type="double">-1.0</min>
111      <max type="double">1.0</max>
112      <wrap type="bool">false</wrap>
113     </binding>
114
115     <!-- Left button pressed: control rudder -->
116     <binding>
117      <condition>
118       <and>
119        <property>/devices/status/mice/mouse[0]/button[0]</property>
120        <not>
121         <property>/devices/status/mice/mouse[0]/button[1]</property>
122        </not>
123       </and>
124      </condition>
125      <command>property-adjust</command>
126      <property>/controls/rudder</property>
127      <factor type="double">4.0</factor>
128      <min type="double">-1.0</min>
129      <max type="double">1.0</max>
130      <wrap type="bool">false</wrap>
131     </binding>
132
133    </x-axis>
134
135    <!-- Mouse up/down motion -->
136    <y-axis>
137
138     <!-- No buttons pressed: control elevator -->
139     <binding>
140      <condition>
141       <and>
142        <not>
143         <property>/devices/status/mice/mouse[0]/button[0]</property>
144        </not>
145        <not>
146         <property>/devices/status/mice/mouse[0]/button[1]</property>
147        </not>
148       </and>
149      </condition>
150      <command>property-adjust</command>
151      <property>/controls/elevator</property>
152      <factor type="double">-4.0</factor>
153      <min type="double">-1.0</min>
154      <max type="double">1.0</max>
155      <wrap type="bool">false</wrap>
156     </binding>
157
158     <!-- Middle button pressed: control throttle -->
159     <binding>
160      <condition>
161       <and>
162        <not>
163         <property>/devices/status/mice/mouse[0]/button[0]</property>
164        </not>
165        <property>/devices/status/mice/mouse[0]/button[1]</property>
166       </and>
167      </condition>
168      <command>property-adjust</command>
169      <property>/controls/throttle</property>
170      <factor type="double">-4.0</factor>
171      <min type="double">0.0</min>
172      <max type="double">1.0</max>
173      <wrap type="bool">false</wrap>
174     </binding>
175    </y-axis>
176
177   </mode>
178
179   <!-- Mode 2: view mode -->
180   <mode n="2">
181    <cursor>left-right</cursor>
182    <constrained type="bool">true</constrained>
183    <pass-through type="bool">false</pass-through>
184
185    <!-- left button centres the offsets -->
186    <button n="0">
187     <binding>
188      <command>property-assign</command>
189      <property>/sim/current-view/heading-offset-deg</property>
190      <value alias="/sim/view/config/front-direction-deg"/>
191     </binding>
192     <binding>
193      <command>property-assign</command>
194      <property>/sim/current-view/pitch-offset-deg</property>
195      <value alias="/sim/view/config/default-pitch-deg"/>
196     </binding>
197    </button>
198
199    <!-- right button switches modes -->
200    <button n="2">
201     <binding>
202      <command>property-assign</command>
203      <property>/devices/status/mice/mouse[0]/mode</property>
204      <value type="int">0</value>
205     </binding>
206    </button>
207
208    <!-- extra buttons control elevator trim -->
209    <!-- these are often assigned to mouse-wheel motion in Linux -->
210    <button n="3">
211     <binding>
212      <command>property-adjust</command>
213      <property>/controls/elevator-trim</property>
214      <step type="double">0.01</step>
215     </binding>
216    </button>
217
218    <button n="4">
219     <binding>
220      <command>property-adjust</command>
221      <property>/controls/elevator-trim</property>
222      <step type="double">-0.01</step>
223     </binding>
224    </button>
225
226    <!-- Mouse left/right motion -->
227    <x-axis>
228
229     <!-- No buttons pressed: move the view position left or right -->
230     <binding>
231      <condition>
232       <and>
233        <not>
234         <property>/devices/status/mice/mouse[0]/button[0]</property>
235        </not>
236        <not>
237         <property>/devices/status/mice/mouse[0]/button[1]</property>
238        </not>
239       </and>
240      </condition>
241      <command>property-adjust</command>
242      <property>/sim/current-view/heading-offset-deg</property>
243      <factor type="double">-360</factor>
244      <min type="double">0</min>
245      <max type="double">360</max>
246      <wrap type="bool">true</wrap>
247     </binding>
248
249    </x-axis>
250
251    <!-- Mouse up/down motion -->
252    <y-axis>
253
254     <!-- No buttons pressed: tilt the view up and down -->
255     <binding>
256      <condition>
257       <and>
258        <not>
259         <property>/devices/status/mice/mouse[0]/button[0]</property>
260        </not>
261        <not>
262         <property>/devices/status/mice/mouse[0]/button[1]</property>
263        </not>
264       </and>
265      </condition>
266      <command>property-adjust</command>
267      <property>/sim/current-view/pitch-offset-deg</property>
268      <factor type="double">-180</factor>
269      <min type="double">-90</min>
270      <max type="double">90</max>
271      <wrap type="bool">false</wrap>
272     </binding>
273    </y-axis>
274
275   </mode>
276
277  </mouse>
278
279 </PropertyList>
280