Added conditional bindings for throttle and rudder when mouse is
[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>false</constrained>
31    <pass-through>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>1</value>
38     </binding>
39    </button>
40
41   </mode>
42
43   <mode n="1">
44    <cursor>crosshair</cursor>
45    <constrained>true</constrained>
46    <pass-through>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>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>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>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>-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>-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>true</constrained>
147    <pass-through>false</pass-through>
148
149    <!-- left button centres the offsets -->
150    <button n="0">
151     <binding>
152      <command>property-assign</command>
153      <property>/sim/view/offset-deg</property>
154      <property>/sim/view/tilt-deg</property>
155      <value>0</value>
156     </binding>
157    </button>
158
159    <!-- right button switches modes -->
160    <button n="2">
161     <binding>
162      <command>property-assign</command>
163      <property>/devices/status/mice/mouse[0]/mode</property>
164      <value>0</value>
165     </binding>
166    </button>
167
168    <!-- Mouse left/right motion -->
169    <x-axis>
170
171     <!-- No buttons pressed: move the view position left or right -->
172     <binding>
173      <condition>
174       <and>
175        <not>
176         <property>/devices/status/mice/mouse[0]/button[0]</property>
177        </not>
178        <not>
179         <property>/devices/status/mice/mouse[0]/button[1]</property>
180        </not>
181       </and>
182      </condition>
183      <command>property-adjust</command>
184      <property>/sim/view/offset-deg</property>
185      <factor type="double">-360</factor>
186      <min type="double">0</min>
187      <max type="double">360</max>
188      <wrap type="bool">true</wrap>
189     </binding>
190
191    </x-axis>
192
193    <!-- Mouse up/down motion -->
194    <y-axis>
195
196     <!-- No buttons pressed: tilt the view up and down -->
197     <binding>
198      <condition>
199       <and>
200        <not>
201         <property>/devices/status/mice/mouse[0]/button[0]</property>
202        </not>
203        <not>
204         <property>/devices/status/mice/mouse[0]/button[1]</property>
205        </not>
206       </and>
207      </condition>
208      <command>property-adjust</command>
209      <property>/sim/view/tilt-deg</property>
210      <factor type="double">-180</factor>
211      <min type="double">-90</min>
212      <max type="double">90</max>
213      <wrap type="bool">false</wrap>
214     </binding>
215    </y-axis>
216
217   </mode>
218
219  </mouse>
220
221 </PropertyList>