In panning fixed left button to return both pitch and heading offset to zero
[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   </mode>
42
43   <mode n="1">
44    <cursor>crosshair</cursor>
45    <constrained type="bool">true</constrained>
46    <pass-through type="bool">false</pass-through>
47
48    <button n="2">
49     <binding>
50      <command>property-assign</command>
51      <property>/devices/status/mice/mouse[0]/mode</property>
52      <value type="int">2</value>
53     </binding>
54    </button>
55
56    <!-- Mouse left/right motion. -->
57    <x-axis>
58
59     <!-- No buttons pressed: control ailerons -->
60     <binding>
61      <condition>
62       <and>
63        <not>
64         <property>/devices/status/mice/mouse[0]/button[0]</property>
65        </not>
66        <not>
67         <property>/devices/status/mice/mouse[0]/button[1]</property>
68        </not>
69       </and>
70      </condition>
71      <command>property-adjust</command>
72      <property>/controls/aileron</property>
73      <factor type="double">4.0</factor>
74      <min type="double">-1.0</min>
75      <max type="double">1.0</max>
76      <wrap type="bool">false</wrap>
77     </binding>
78
79     <!-- Left button pressed: control rudder -->
80     <binding>
81      <condition>
82       <and>
83        <property>/devices/status/mice/mouse[0]/button[0]</property>
84        <not>
85         <property>/devices/status/mice/mouse[0]/button[1]</property>
86        </not>
87       </and>
88      </condition>
89      <command>property-adjust</command>
90      <property>/controls/rudder</property>
91      <factor type="double">4.0</factor>
92      <min type="double">-1.0</min>
93      <max type="double">1.0</max>
94      <wrap type="bool">false</wrap>
95     </binding>
96
97    </x-axis>
98
99    <!-- Mouse up/down motion -->
100    <y-axis>
101
102     <!-- No buttons pressed: control elevator -->
103     <binding>
104      <condition>
105       <and>
106        <not>
107         <property>/devices/status/mice/mouse[0]/button[0]</property>
108        </not>
109        <not>
110         <property>/devices/status/mice/mouse[0]/button[1]</property>
111        </not>
112       </and>
113      </condition>
114      <command>property-adjust</command>
115      <property>/controls/elevator</property>
116      <factor type="double">-4.0</factor>
117      <min type="double">-1.0</min>
118      <max type="double">1.0</max>
119      <wrap type="bool">false</wrap>
120     </binding>
121
122     <!-- Middle button pressed: control throttle -->
123     <binding>
124      <condition>
125       <and>
126        <not>
127         <property>/devices/status/mice/mouse[0]/button[0]</property>
128        </not>
129        <property>/devices/status/mice/mouse[0]/button[1]</property>
130       </and>
131      </condition>
132      <command>property-adjust</command>
133      <property>/controls/throttle</property>
134      <factor type="double">-4.0</factor>
135      <min type="double">0.0</min>
136      <max type="double">1.0</max>
137      <wrap type="bool">false</wrap>
138     </binding>
139    </y-axis>
140
141   </mode>
142
143   <!-- Mode 2: view mode -->
144   <mode n="2">
145    <cursor>left-right</cursor>
146    <constrained type="bool">true</constrained>
147    <pass-through type="bool">false</pass-through>
148
149    <!-- left button centres the offsets -->
150    <button n="0">
151     <binding>
152      <command>property-assign</command>
153      <property>/sim/current-view/heading-offset-deg</property>
154      <value type="double">0</value>
155     </binding>
156     <binding>
157      <command>property-assign</command>
158      <property>/sim/current-view/pitch-offset-deg</property>
159      <value type="double">0</value>
160     </binding>
161    </button>
162
163    <!-- right button switches modes -->
164    <button n="2">
165     <binding>
166      <command>property-assign</command>
167      <property>/devices/status/mice/mouse[0]/mode</property>
168      <value type="int">0</value>
169     </binding>
170    </button>
171
172    <!-- Mouse left/right motion -->
173    <x-axis>
174
175     <!-- No buttons pressed: move the view position left or right -->
176     <binding>
177      <condition>
178       <and>
179        <not>
180         <property>/devices/status/mice/mouse[0]/button[0]</property>
181        </not>
182        <not>
183         <property>/devices/status/mice/mouse[0]/button[1]</property>
184        </not>
185       </and>
186      </condition>
187      <command>property-adjust</command>
188      <property>/sim/current-view/heading-offset-deg</property>
189      <factor type="double">-360</factor>
190      <min type="double">0</min>
191      <max type="double">360</max>
192      <wrap type="bool">true</wrap>
193     </binding>
194
195    </x-axis>
196
197    <!-- Mouse up/down motion -->
198    <y-axis>
199
200     <!-- No buttons pressed: tilt the view up and down -->
201     <binding>
202      <condition>
203       <and>
204        <not>
205         <property>/devices/status/mice/mouse[0]/button[0]</property>
206        </not>
207        <not>
208         <property>/devices/status/mice/mouse[0]/button[1]</property>
209        </not>
210       </and>
211      </condition>
212      <command>property-adjust</command>
213      <property>/sim/current-view/pitch-offset-deg</property>
214      <factor type="double">-180</factor>
215      <min type="double">-90</min>
216      <max type="double">90</max>
217      <wrap type="bool">false</wrap>
218     </binding>
219    </y-axis>
220
221   </mode>
222
223  </mouse>
224
225 </PropertyList>
226