924c003c75f5ec9d47adb5f19be24df8c79de4c5
[free-sw/xcb/proto] / xinput.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 Copyright (C) 2006 Peter Hutterer
4 Copyright (C) 2013 Daniel Martin
5 All Rights Reserved.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 Except as contained in this notice, the names of the authors or their
25 institutions shall not be used in advertising or otherwise to promote the
26 sale, use or other dealings in this Software without prior written
27 authorization from the authors.
28 -->
29
30 <!-- Specifications:
31      http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt
32      http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt
33 -->
34
35 <xcb header="xinput" extension-xname="XInputExtension" extension-name="Input"
36      major-version="2" minor-version="3">
37     <import>xfixes</import>
38     <import>xproto</import>
39
40     <!-- ⋅⋅⋅ Types (v1.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
41
42     <typedef oldname="CARD32" newname="EventClass" />
43     <typedef oldname="CARD8"  newname="KeyCode" />
44
45     <!-- ⋅⋅⋅ Types (v2.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
46
47     <typedef oldname="CARD16" newname="DeviceId" />
48     <typedef oldname="INT32"  newname="FP1616" />
49
50     <struct name="FP3232">
51         <field type="INT32"  name="integral" />
52         <field type="CARD32" name="frac" />
53     </struct>
54
55     <!-- ⋅⋅⋅ Requests (v1.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
56
57     <!-- GetExtensionVersion -->
58
59     <request name="GetExtensionVersion" opcode="1">
60         <field type="CARD16" name="name_len" />
61         <pad bytes="2" />
62         <list type="char" name="name">
63             <fieldref>name_len</fieldref>
64         </list>
65         <reply>
66             <pad bytes="1" />
67             <field type="CARD16" name="server_major" />
68             <field type="CARD16" name="server_minor" />
69             <field type="BOOL"   name="present" />
70             <pad bytes="19" />
71         </reply>
72     </request>
73
74     <!-- ListInputDevices -->
75
76     <enum name="DeviceUse">
77         <item name="IsXPointer">           <value>0</value> </item>
78         <item name="IsXKeyboard">          <value>1</value> </item>
79         <item name="IsXExtensionDevice">   <value>2</value> </item>
80         <item name="IsXExtensionKeyboard"> <value>3</value> </item>
81         <item name="IsXExtensionPointer">  <value>4</value> </item>
82     </enum>
83
84     <enum name="InputClass">
85         <item name="Key">       <value>0</value> </item>
86         <item name="Button">    <value>1</value> </item>
87         <item name="Valuator">  <value>2</value> </item>
88         <item name="Feedback">  <value>3</value> </item>
89         <item name="Proximity"> <value>4</value> </item>
90         <item name="Focus">     <value>5</value> </item>
91         <item name="Other">     <value>6</value> </item>
92     </enum>
93
94     <enum name="ValuatorMode">
95         <item name="Relative"> <value>0</value> </item>
96         <item name="Absolute"> <value>1</value> </item>
97     </enum>
98
99     <struct name="DeviceInfo">
100         <field type="ATOM"  name="device_type" />
101         <field type="CARD8" name="device_id" />
102         <field type="CARD8" name="num_class_info" />
103         <field type="CARD8" name="device_use" enum="DeviceUse" />
104         <pad bytes="1" />
105     </struct>
106
107     <struct name="KeyInfo">
108         <field type="CARD8"   name="class_id" enum="InputClass" />
109         <field type="CARD8"   name="len" />
110         <field type="KeyCode" name="min_keycode" />
111         <field type="KeyCode" name="max_keycode" />
112         <field type="CARD16"  name="num_keys" />
113         <pad bytes="2" />
114     </struct>
115
116     <struct name="ButtonInfo">
117         <field type="CARD8"  name="class_id" enum="InputClass" />
118         <field type="CARD8"  name="len" />
119         <field type="CARD16" name="num_buttons" />
120     </struct>
121
122     <struct name="AxisInfo">
123         <field type="CARD32" name="resolution" />
124         <field type="INT32"  name="minimum" />
125         <field type="INT32"  name="maximum" />
126     </struct>
127
128     <struct name="ValuatorInfo">
129         <field type="CARD8"   name="class_id" enum="InputClass" />
130         <field type="CARD8"   name="len" />
131         <field type="CARD8"   name="axes_len" />
132         <field type="CARD8"   name="mode" enum="ValuatorMode" />
133         <field type="CARD32"  name="motion_size" />
134         <list type="AxisInfo" name="axes">
135             <fieldref>axes_len</fieldref>
136         </list>
137     </struct>
138
139     <struct name="InputInfo">
140         <field type="CARD8" name="class_id" enum="InputClass" />
141         <field type="CARD8" name="len" />
142     </struct>
143
144     <struct name="DeviceName">
145         <field type="CARD8" name="len" />
146         <list type="char"  name="string">
147             <fieldref>len</fieldref>
148         </list>
149     </struct>
150
151     <request name="ListInputDevices" opcode="2">
152         <reply>
153             <pad bytes="1" />
154             <field type="CARD8" name="devices_len" />
155             <pad bytes="23" />
156             <list type="DeviceInfo" name="devices">
157                 <fieldref>devices_len</fieldref>
158             </list>
159             <!-- Uninterpreted: list (infos) of InputInfo structures,
160                                 length is <sumof> all devices.num_class_info -->
161             <!-- Uninterpreted: list (name) of DeviceName structures -->
162         </reply>
163     </request>
164
165     <!-- OpenDevice -->
166
167     <struct name="InputClassInfo">
168         <field type="CARD8" name="class_id" enum="InputClass" />
169         <field type="CARD8" name="event_type_base" />
170     </struct>
171
172     <request name="OpenDevice" opcode="3">
173         <field type="CARD8" name="device_id" />
174         <pad bytes="3" />
175         <reply>
176             <pad bytes="1" />
177             <field type="CARD8" name="num_classes" />
178             <pad bytes="23" />
179             <list type="InputClassInfo" name="class_info">
180                 <fieldref>num_classes</fieldref>
181             </list>
182         </reply>
183     </request>
184
185     <!-- CloseDevice -->
186
187     <request name="CloseDevice" opcode="4">
188         <field type="CARD8" name="device_id" />
189         <pad bytes="3" />
190     </request>
191
192     <!-- SetDeviceMode -->
193
194     <request name="SetDeviceMode" opcode="5">
195         <field type="CARD8" name="device_id" />
196         <field type="CARD8" name="mode" enum="ValuatorMode" />
197         <pad bytes="2" />
198         <reply>
199             <pad bytes="1" />
200             <field type="CARD8" name="status" altenum="GrabStatus" />
201             <pad bytes="23" />
202         </reply>
203     </request>
204
205     <!-- SelectExtensionEvent -->
206
207     <request name="SelectExtensionEvent" opcode="6">
208         <field type="WINDOW" name="window" />
209         <field type="CARD16" name="num_classes" />
210         <pad bytes="2" />
211         <list type="EventClass" name="classes">
212             <fieldref>num_classes</fieldref>
213         </list>
214     </request>
215
216     <!-- GetSelectedExtensionEvents -->
217
218     <request name="GetSelectedExtensionEvents" opcode="7">
219         <field type="WINDOW" name="window" />
220         <reply>
221             <pad bytes="1" />
222             <field type="CARD16" name="num_this_classes" />
223             <field type="CARD16" name="num_all_classes" />
224             <pad bytes="20" />
225             <list type="EventClass" name="this_classes">
226                 <fieldref>num_this_classes</fieldref>
227             </list>
228             <list type="EventClass" name="all_classes">
229                 <fieldref>num_all_classes</fieldref>
230             </list>
231         </reply>
232     </request>
233
234     <!-- ChangeDeviceDontPropagateList -->
235
236     <enum name="PropagateMode">
237         <item name="AddToList">      <value>0</value> </item>
238         <item name="DeleteFromList"> <value>1</value> </item>
239     </enum>
240
241     <request name="ChangeDeviceDontPropagateList" opcode="8">
242         <field type="WINDOW" name="window" />
243         <field type="CARD16" name="num_classes" />
244         <field type="CARD8"  name="mode" enum="PropagateMode" />
245         <pad bytes="1" />
246         <list type="EventClass" name="classes">
247             <fieldref>num_classes</fieldref>
248         </list>
249     </request>
250
251     <!-- GetDeviceDontPropagateList -->
252
253     <request name="GetDeviceDontPropagateList" opcode="9">
254         <field type="WINDOW" name="window" />
255         <reply>
256             <pad bytes="1" />
257             <field type="CARD16" name="num_classes" />
258             <pad bytes="22" />
259             <list type="EventClass" name="classes">
260                 <fieldref>num_classes</fieldref>
261             </list>
262         </reply>
263     </request>
264
265     <!-- GetDeviceMotionEvents -->
266
267     <struct name="DeviceTimeCoord">
268         <field type="TIMESTAMP" name="time" />
269         <!-- Uninterpreted: list (axisvalues) of CARD32,
270                             length is num_axes from GetDeviceMotionEvents -->
271     </struct>
272
273     <request name="GetDeviceMotionEvents" opcode="10">
274         <field type="TIMESTAMP" name="start" />
275         <field type="TIMESTAMP" name="stop" altenum="Time" />
276         <field type="CARD8"     name="device_id" />
277         <reply>
278             <pad bytes="1" />
279             <field type="CARD32" name="num_events" />
280             <field type="CARD8"  name="num_axes" />
281             <field type="CARD8"  name="device_mode" enum="ValuatorMode" />
282             <pad bytes="18" />
283             <!-- Uninterpreted: list (events) of DeviceTimeCoord structures -->
284         </reply>
285     </request>
286
287     <!-- ChangeKeyboardDevice -->
288
289     <request name="ChangeKeyboardDevice" opcode="11">
290         <field type="CARD8" name="device_id" />
291         <pad bytes="3" />
292         <reply>
293             <pad bytes="1" />
294             <field type="CARD8" name="status" altenum="GrabStatus" />
295             <pad bytes="23" />
296         </reply>
297     </request>
298
299     <!-- ChangePointerDevice -->
300
301     <request name="ChangePointerDevice" opcode="12">
302         <field type="CARD8" name="x_axis" />
303         <field type="CARD8" name="y_axis" />
304         <field type="CARD8" name="device_id" />
305         <pad bytes="1" />
306         <reply>
307             <pad bytes="1" />
308             <field type="CARD8" name="status" altenum="GrabStatus" />
309             <pad bytes="23" />
310         </reply>
311     </request>
312
313     <!-- GrabDevice -->
314
315     <request name="GrabDevice" opcode="13">
316         <field type="WINDOW"    name="grab_window" />
317         <field type="TIMESTAMP" name="time" altenum="Time" />
318         <field type="CARD16"    name="num_classes" />
319         <field type="CARD8"     name="this_device_mode" enum="GrabMode" />
320         <field type="CARD8"     name="other_device_mode" enum="GrabMode" />
321         <field type="BOOL"      name="owner_events" />
322         <field type="CARD8"     name="device_id" />
323         <pad bytes="2" />
324         <list type="EventClass" name="classes">
325             <fieldref>num_classes</fieldref>
326         </list>
327         <reply>
328             <pad bytes="1" />
329             <field type="CARD8" name="status" enum="GrabStatus" />
330             <pad bytes="23" />
331         </reply>
332     </request>
333
334     <!-- UngrabDevice -->
335
336     <request name="UngrabDevice" opcode="14">
337         <field type="TIMESTAMP" name="time" altenum="Time" />
338         <field type="CARD8"     name="device_id" />
339     </request>
340
341     <!-- GrabDeviceKey -->
342
343     <request name="GrabDeviceKey" opcode="15">
344         <field type="WINDOW" name="grab_window" />
345         <field type="CARD16" name="num_classes" />
346         <field type="CARD16" name="modifiers" mask="ModMask" />
347         <field type="CARD8"  name="modifier_device" />
348         <field type="CARD8"  name="grabbed_device" />
349         <field type="CARD8"  name="key" altenum="Grab" />
350         <field type="CARD8"  name="this_device_mode" enum="GrabMode" />
351         <field type="CARD8"  name="other_device_mode" enum="GrabMode" />
352         <field type="BOOL"   name="owner_events" />
353         <pad bytes="2" />
354         <list type="EventClass" name="classes">
355             <fieldref>num_classes</fieldref>
356         </list>
357     </request>
358
359     <!-- UngrabDeviceKey -->
360
361     <request name="UngrabDeviceKey" opcode="16">
362         <field type="WINDOW" name="grabWindow" />
363         <field type="CARD16" name="modifiers" mask="ModMask" />
364         <field type="CARD8"  name="modifier_device" />
365         <field type="CARD8"  name="key" altenum="Grab" />
366         <field type="CARD8"  name="grabbed_device" />
367     </request>
368
369     <!-- GrabDeviceButton -->
370
371     <request name="GrabDeviceButton" opcode="17">
372         <field type="WINDOW" name="grab_window" />
373         <field type="CARD8"  name="grabbed_device" />
374         <field type="CARD8"  name="modifier_device" />
375         <field type="CARD16" name="num_classes" />
376         <field type="CARD16" name="modifiers" mask="ModMask" />
377         <field type="CARD8"  name="this_device_mode" enum="GrabMode" />
378         <field type="CARD8"  name="other_device_mode" enum="GrabMode" />
379         <field type="CARD8"  name="button" altenum="Grab" />
380         <field type="CARD8"  name="owner_events" />
381         <pad bytes="2" />
382         <list type="EventClass" name="classes">
383             <fieldref>num_classes</fieldref>
384         </list>
385     </request>
386
387     <!-- UngrabDeviceButton -->
388
389     <request name="UngrabDeviceButton" opcode="18">
390         <field type="WINDOW" name="grab_window" />
391         <field type="CARD16" name="modifiers" mask="ModMask" />
392         <field type="CARD8"  name="modifier_device" />
393         <field type="CARD8"  name="button" altenum="Grab" />
394         <field type="CARD8"  name="grabbed_device" />
395     </request>
396
397     <!-- AllowDeviceEvents -->
398
399     <enum name="DeviceInputMode">
400         <item name="AsyncThisDevice">   <value>0</value> </item>
401         <item name="SyncThisDevice">    <value>1</value> </item>
402         <item name="ReplayThisDevice">  <value>2</value> </item>
403         <item name="AsyncOtherDevices"> <value>3</value> </item>
404         <item name="AsyncAll">          <value>4</value> </item>
405         <item name="SyncAll">           <value>5</value> </item>
406     </enum>
407
408     <request name="AllowDeviceEvents" opcode="19">
409         <field type="TIMESTAMP" name="time" altenum="Time" />
410         <field type="CARD8"     name="mode" enum="DeviceInputMode" />
411         <field type="CARD8"     name="device_id" />
412     </request>
413
414     <!-- GetDeviceFocus -->
415
416     <request name="GetDeviceFocus" opcode="20">
417         <field type="CARD8" name="device_id" />
418         <pad bytes="3" />
419         <reply>
420             <pad bytes="1" />
421             <field type="WINDOW"    name="focus" altenum="InputFocus" />
422             <field type="TIMESTAMP" name="time" />
423             <field type="CARD8"     name="revert_to" enum="InputFocus" />
424             <pad bytes="15" />
425         </reply>
426     </request>
427
428     <!-- SetDeviceFocus -->
429
430     <request name="SetDeviceFocus" opcode="21">
431         <field type="WINDOW"    name="focus" altenum="InputFocus" />
432         <field type="TIMESTAMP" name="time" altenum="Time" />
433         <field type="CARD8"     name="revert_to" enum="InputFocus" />
434         <field type="CARD8"     name="device_id" />
435     </request>
436
437     <!-- GetFeedbackControl -->
438
439     <enum name="FeedbackClass">
440         <item name="Keyboard"> <value>0</value> </item>
441         <item name="Pointer">  <value>1</value> </item>
442         <item name="String">   <value>2</value> </item>
443         <item name="Integer">  <value>3</value> </item>
444         <item name="Led">      <value>4</value> </item>
445         <item name="Bell">     <value>5</value> </item>
446     </enum>
447
448     <struct name="KbdFeedbackState">
449         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
450         <field type="CARD8"  name="feedback_id" />
451         <field type="CARD16" name="len" />
452         <field type="CARD16" name="pitch" />
453         <field type="CARD16" name="duration" />
454         <field type="CARD32" name="led_mask" />
455         <field type="CARD32" name="led_values" />
456         <field type="BOOL"   name="global_auto_repeat" />
457         <field type="CARD8"  name="click" />
458         <field type="CARD8"  name="percent" />
459         <pad bytes="1" />
460         <list type="CARD8" name="auto_repeats">
461             <value>32</value>
462         </list>
463     </struct>
464
465     <struct name="PtrFeedbackState">
466         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
467         <field type="CARD8"  name="feedback_id" />
468         <field type="CARD16" name="len" />
469         <pad bytes="2" />
470         <field type="CARD16" name="accel_num" />
471         <field type="CARD16" name="accel_denom" />
472         <field type="CARD16" name="threshold" />
473     </struct>
474
475     <struct name="IntegerFeedbackState">
476         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
477         <field type="CARD8"  name="feedback_id" />
478         <field type="CARD16" name="len" />
479         <field type="CARD32" name="resolution" />
480         <field type="INT32"  name="min_value" />
481         <field type="INT32"  name="max_value" />
482     </struct>
483
484     <struct name="StringFeedbackState">
485         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
486         <field type="CARD8"  name="feedback_id" />
487         <field type="CARD16" name="len" />
488         <field type="CARD16" name="max_symbols" />
489         <field type="CARD16" name="num_keysyms" />
490         <list type="KEYSYM"  name="keysyms">
491             <fieldref>num_keysyms</fieldref>
492         </list>
493     </struct>
494
495     <struct name="BellFeedbackState">
496         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
497         <field type="CARD8"  name="feedback_id" />
498         <field type="CARD16" name="len" />
499         <field type="CARD8"  name="percent" />
500         <pad bytes="3" />
501         <field type="CARD16" name="pitch" />
502         <field type="CARD16" name="duration" />
503     </struct>
504
505     <struct name="LedFeedbackState">
506         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
507         <field type="CARD8"  name="feedback_id" />
508         <field type="CARD16" name="len" />
509         <field type="CARD32" name="led_mask" />
510         <field type="CARD32" name="led_values" />
511     </struct>
512
513     <struct name="FeedbackState">
514         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
515         <field type="CARD8"  name="feedback_id" />
516         <field type="CARD16" name="len" />
517         <list type="CARD8" name="uninterpreted_data">
518             <op op="-">
519                 <fieldref>len</fieldref>
520                 <value>4</value>
521             </op>
522         </list>
523     </struct>
524
525     <request name="GetFeedbackControl" opcode="22">
526         <field type="CARD8" name="device_id" />
527         <pad bytes="3" />
528         <reply>
529             <pad bytes="1" />
530             <field type="CARD16" name="num_feedbacks" />
531             <pad bytes="22" />
532             <list type="FeedbackState" name="feedbacks">
533                 <fieldref>num_feedbacks</fieldref>
534             </list>
535         </reply>
536     </request>
537
538     <!-- ChangeFeedbackControl -->
539
540     <struct name="KbdFeedbackCtl">
541         <field type="CARD8"   name="class_id" enum="FeedbackClass" />
542         <field type="CARD8"   name="feedback_id" />
543         <field type="CARD16"  name="len" />
544         <field type="KeyCode" name="key" />
545         <field type="CARD8"   name="auto_repeat_mode" />
546         <field type="INT8"    name="key_click_percent" />
547         <field type="INT8"    name="bell_percent" />
548         <field type="INT16"   name="bell_pitch" />
549         <field type="INT16"   name="bell_duration" />
550         <field type="CARD32"  name="led_mask" />
551         <field type="CARD32"  name="led_values" />
552     </struct>
553
554     <struct name="PtrFeedbackCtl">
555         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
556         <field type="CARD8"  name="feedback_id" />
557         <field type="CARD16" name="len" />
558         <pad bytes="2" />
559         <field type="INT16"  name="num" />
560         <field type="INT16"  name="denom" />
561         <field type="INT16"  name="threshold" />
562     </struct>
563
564     <struct name="IntegerFeedbackCtl">
565         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
566         <field type="CARD8"  name="feedback_id" />
567         <field type="CARD16" name="len" />
568         <field type="INT32"  name="int_to_display" />
569     </struct>
570
571     <struct name="StringFeedbackCtl">
572         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
573         <field type="CARD8"  name="feedback_id" />
574         <field type="CARD16" name="len" />
575         <pad bytes="2" />
576         <field type="CARD16" name="num_keysyms" />
577         <list type="KEYSYM"  name="keysyms">
578             <fieldref>num_keysyms</fieldref>
579         </list>
580     </struct>
581
582     <struct name="BellFeedbackCtl">
583         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
584         <field type="CARD8"  name="feedback_id" />
585         <field type="CARD16" name="len" />
586         <field type="INT8"   name="percent" />
587         <pad bytes="3" />
588         <field type="INT16"  name="pitch" />
589         <field type="INT16"  name="duration" />
590     </struct>
591
592     <struct name="LedFeedbackCtl">
593         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
594         <field type="CARD8"  name="feedback_id" />
595         <field type="CARD16" name="len" />
596         <field type="CARD32" name="led_mask" />
597         <field type="CARD32" name="led_values" />
598     </struct>
599
600     <struct name="FeedbackCtl">
601         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
602         <field type="CARD8"  name="feedback_id" />
603         <field type="CARD16" name="len" />
604         <list type="CARD8" name="uninterpreted_data">
605             <op op="-">
606                 <fieldref>len</fieldref>
607                 <value>4</value>
608             </op>
609         </list>
610     </struct>
611
612     <request name="ChangeFeedbackControl" opcode="23">
613         <field type="CARD32"      name="mask" />
614         <field type="CARD8"       name="device_id" />
615         <field type="CARD8"       name="feedback_id" />
616         <field type="FeedbackCtl" name="feedback" />
617     </request>
618
619     <!-- GetDeviceKeyMapping -->
620
621     <request name="GetDeviceKeyMapping" opcode="24">
622         <field type="CARD8"   name="device_id" />
623         <field type="KeyCode" name="first_keycode" />
624         <field type="CARD8"   name="count" />
625         <reply>
626             <pad bytes="1" />
627             <field type="CARD8" name="keysyms_per_keycode" />
628             <pad bytes="23" />
629             <list type="KEYSYM" name="keysyms">
630                 <!-- 'length' is a field in the header -->
631                 <fieldref>length</fieldref>
632             </list>
633         </reply>
634     </request>
635
636     <!-- ChangeDeviceKeyMapping -->
637
638     <request name="ChangeDeviceKeyMapping" opcode="25">
639         <field type="CARD8"   name="device_id" />
640         <field type="KeyCode" name="first_keycode" />
641         <field type="CARD8"   name="keysyms_per_keycode" />
642         <field type="CARD8"   name="keycode_count" />
643         <list type="KEYSYM"   name="keysyms">
644             <op op="*">
645                 <fieldref>keycode_count</fieldref>
646                 <fieldref>keysyms_per_keycode</fieldref>
647             </op>
648         </list>
649     </request>
650
651     <!-- GetDeviceModifierMapping -->
652
653     <request name="GetDeviceModifierMapping" opcode="26">
654         <field type="CARD8" name="device_id" />
655         <pad bytes="3" />
656         <reply>
657             <pad bytes="1" />
658             <field type="CARD8" name="keycodes_per_modifier" />
659             <pad bytes="23" />
660             <list type="CARD8"  name="keymaps">
661                 <op op="*">
662                     <fieldref>keycodes_per_modifier</fieldref>
663                     <value>8</value>
664                 </op>
665             </list>
666         </reply>
667     </request>
668
669     <!-- SetDeviceModifierMapping -->
670
671     <request name="SetDeviceModifierMapping" opcode="27">
672         <field type="CARD8" name="device_id" />
673         <field type="CARD8" name="keycodes_per_modifier" />
674         <pad bytes="1" />
675         <list type="CARD8" name="keymaps">
676             <op op="*">
677                 <fieldref>keycodes_per_modifier</fieldref>
678                 <value>8</value>
679             </op>
680         </list>
681         <reply>
682             <pad bytes="1" />
683             <field type="CARD8" name="status" enum="MappingStatus" />
684             <pad bytes="23" />
685         </reply>
686     </request>
687
688     <!-- GetDeviceButtonMapping -->
689
690     <request name="GetDeviceButtonMapping" opcode="28">
691         <field type="CARD8" name="device_id" />
692         <pad bytes="3" />
693         <reply>
694             <pad bytes="1" />
695             <field type="CARD8" name="map_size" />
696             <pad bytes="23" />
697             <list type="CARD8" name="map">
698                 <fieldref>map_size</fieldref>
699             </list>
700         </reply>
701     </request>
702
703     <!-- SetDeviceButtonMapping -->
704
705     <request name="SetDeviceButtonMapping" opcode="29">
706         <field type="CARD8" name="device_id" />
707         <field type="CARD8" name="map_size" />
708         <pad bytes="2" />
709         <list type="CARD8" name="map">
710             <fieldref>map_size</fieldref>
711         </list>
712         <reply>
713             <pad bytes="1" />
714             <field type="CARD8" name="status" enum="MappingStatus" />
715             <pad bytes="23" />
716         </reply>
717     </request>
718
719     <!-- QueryDeviceState -->
720
721     <struct name="KeyState">
722         <field type="CARD8" name="class_id" enum="InputClass" />
723         <field type="CARD8" name="len" />
724         <field type="CARD8" name="num_keys" />
725         <pad bytes="1" />
726         <list type="CARD8" name="keys">
727             <value>32</value>
728         </list>
729     </struct>
730
731     <struct name="ButtonState">
732         <field type="CARD8" name="class_id" enum="InputClass" />
733         <field type="CARD8" name="len" />
734         <field type="CARD8" name="num_buttons" />
735         <pad bytes="1" />
736         <list type="CARD8" name="buttons">
737             <value>32</value>
738         </list>
739     </struct>
740
741     <struct name="ValuatorState">
742         <field type="CARD8" name="class_id" enum="InputClass" />
743         <field type="CARD8" name="len" />
744         <field type="CARD8" name="num_valuators" />
745         <field type="CARD8" name="mode" />
746         <list type="CARD32" name="valuators">
747             <fieldref>num_valuators</fieldref>
748         </list>
749     </struct>
750
751     <struct name="InputState">
752         <field type="CARD8" name="class_id" enum="InputClass" />
753         <field type="CARD8" name="len" />
754         <field type="CARD8" name="num_items" />
755         <pad bytes="1" />
756         <list type="CARD8" name="uninterpreted_data">
757             <op op="-">
758                 <fieldref>len</fieldref>
759                 <value>4</value>
760             </op>
761         </list>
762     </struct>
763
764     <request name="QueryDeviceState" opcode="30">
765         <field type="CARD8" name="device_id" />
766         <pad bytes="3" />
767         <reply>
768             <pad bytes="1" />
769             <field type="CARD8" name="num_classes" />
770             <pad bytes="23" />
771             <list type="InputState" name="classes">
772                 <fieldref>num_classes</fieldref>
773             </list>
774         </reply>
775     </request>
776
777     <!-- SendExtensionEvent -->
778
779     <request name="SendExtensionEvent" opcode="31">
780         <field type="WINDOW" name="destination" />
781         <field type="CARD8"  name="device_id" />
782         <field type="BOOL"   name="propagate" />
783         <field type="CARD16" name="num_classes" />
784         <field type="CARD8"  name="num_events" />
785         <pad bytes="3" />
786         <list type="CARD8" name="events">
787             <op op="*">
788                 <fieldref>num_events</fieldref>
789                 <value>32</value>
790             </op>
791         </list>
792         <list type="EventClass" name="classes">
793             <fieldref>num_classes</fieldref>
794         </list>
795     </request>
796
797     <!-- DeviceBell -->
798
799     <request name="DeviceBell" opcode="32">
800         <field type="CARD8" name="device_id" />
801         <field type="CARD8" name="feedback_id" />
802         <field type="CARD8" name="feedback_class" />
803         <field type="INT8"  name="percent" />
804     </request>
805
806     <!-- SetDeviceValuators -->
807
808     <request name="SetDeviceValuators" opcode="33">
809         <field type="CARD8" name="device_id" />
810         <field type="CARD8" name="first_valuator" />
811         <field type="CARD8" name="num_valuators" />
812         <pad bytes="1" />
813         <list type="INT32" name="valuators">
814             <fieldref>num_valuators</fieldref>
815         </list>
816         <reply>
817             <pad bytes="1" />
818             <field type="CARD8" name="status" enum="GrabStatus" />
819             <pad bytes="23" />
820         </reply>
821     </request>
822
823     <!-- GetDeviceControl -->
824
825     <enum name="DeviceControl">
826         <item name="resolution"> <value>1</value> </item>
827         <item name="abs_calib">  <value>2</value> </item>
828         <item name="core">       <value>3</value> </item>
829         <item name="enable">     <value>4</value> </item>
830         <item name="abs_area">   <value>5</value> </item>
831     </enum>
832
833     <struct name="DeviceResolutionState">
834         <field type="CARD16" name="control_id" enum="DeviceControl" />
835         <field type="CARD16" name="len" />
836         <field type="CARD32" name="num_valuators" />
837         <list type="CARD32"  name="resolution_values">
838             <fieldref>num_valuators</fieldref>
839         </list>
840         <list type="CARD32" name="resolution_min">
841             <fieldref>num_valuators</fieldref>
842         </list>
843         <list type="CARD32" name="resolution_max">
844             <fieldref>num_valuators</fieldref>
845         </list>
846     </struct>
847
848     <struct name="DeviceAbsCalibState">
849         <field type="CARD16" name="control_id" enum="DeviceControl" />
850         <field type="CARD16" name="len" />
851         <field type="INT32"  name="min_x" />
852         <field type="INT32"  name="max_x" />
853         <field type="INT32"  name="min_y" />
854         <field type="INT32"  name="max_y" />
855         <field type="CARD32" name="flip_x" />
856         <field type="CARD32" name="flip_y" />
857         <field type="CARD32" name="rotation" />
858         <field type="CARD32" name="button_threshold" />
859     </struct>
860
861     <struct name="DeviceAbsAreaState">
862         <field type="CARD16" name="control_id" enum="DeviceControl" />
863         <field type="CARD16" name="len" />
864         <field type="CARD32" name="offset_x" />
865         <field type="CARD32" name="offset_y" />
866         <field type="CARD32" name="width" />
867         <field type="CARD32" name="height" />
868         <field type="CARD32" name="screen" />
869         <field type="CARD32" name="following" />
870     </struct>
871
872     <struct name="DeviceCoreState">
873         <field type="CARD16" name="control_id" enum="DeviceControl" />
874         <field type="CARD16" name="len" />
875         <field type="CARD8"  name="status" />
876         <field type="CARD8"  name="iscore" />
877         <pad bytes="2" />
878     </struct>
879
880     <struct name="DeviceEnableState">
881         <field type="CARD16" name="control_id" enum="DeviceControl" />
882         <field type="CARD16" name="len" />
883         <field type="CARD8"  name="enable" />
884         <pad bytes="3" />
885     </struct>
886
887     <struct name="DeviceState">
888         <field type="CARD16" name="control_id" enum="DeviceControl" />
889         <field type="CARD16" name="len" />
890         <list type="CARD8" name="uninterpreted_data">
891             <op op="-">
892                 <fieldref>len</fieldref>
893                 <value>4</value>
894             </op>
895         </list>
896     </struct>
897
898     <request name="GetDeviceControl" opcode="34">
899         <field type="CARD16" name="control_id" enum="DeviceControl" />
900         <field type="CARD8"  name="device_id" />
901         <pad bytes="1" />
902         <reply>
903             <pad bytes="1" />
904             <field type="CARD8" name="status" altenum="GrabStatus" />
905             <pad bytes="23" />
906             <field type="DeviceState" name="control" />
907         </reply>
908     </request>
909
910     <!-- ChangeDeviceControl -->
911
912     <struct name="DeviceResolutionCtl">
913         <field type="CARD16" name="control_id" enum="DeviceControl" />
914         <field type="CARD16" name="len" />
915         <field type="CARD8"  name="first_valuator" />
916         <field type="CARD8"  name="num_valuators" />
917         <list type="CARD32"  name="resolution_values">
918             <fieldref>num_valuators</fieldref>
919         </list>
920     </struct>
921
922     <struct name="DeviceAbsCalibCtl">
923         <field type="CARD16" name="control_id" enum="DeviceControl" />
924         <field type="CARD16" name="len" />
925         <field type="INT32"  name="min_x" />
926         <field type="INT32"  name="max_x" />
927         <field type="INT32"  name="min_y" />
928         <field type="INT32"  name="max_y" />
929         <field type="CARD32" name="flip_x" />
930         <field type="CARD32" name="flip_y" />
931         <field type="CARD32" name="rotation" />
932         <field type="CARD32" name="button_threshold" />
933     </struct>
934
935     <struct name="DeviceAbsAreaCtrl">
936         <field type="CARD16" name="control_id" enum="DeviceControl" />
937         <field type="CARD16" name="len" />
938         <field type="CARD32" name="offset_x" />
939         <field type="CARD32" name="offset_y" />
940         <field type="INT32"  name="width" />
941         <field type="INT32"  name="height" />
942         <field type="INT32"  name="screen" />
943         <field type="CARD32" name="following" />
944     </struct>
945
946     <struct name="DeviceCoreCtrl">
947         <field type="CARD16" name="control_id" enum="DeviceControl" />
948         <field type="CARD16" name="len" />
949         <field type="CARD8"  name="status" />
950         <pad bytes="3" />
951     </struct>
952
953     <struct name="DeviceEnableCtrl">
954         <field type="CARD16" name="control_id" enum="DeviceControl" />
955         <field type="CARD16" name="len" />
956         <field type="CARD8"  name="enable" />
957         <pad bytes="3" />
958     </struct>
959
960     <struct name="DeviceCtl">
961         <field type="CARD16" name="control_id" enum="DeviceControl" />
962         <field type="CARD16" name="len" />
963         <list type="CARD8" name="uninterpreted_data">
964             <op op="-">
965                 <fieldref>len</fieldref>
966                 <value>4</value>
967             </op>
968         </list>
969     </struct>
970
971     <request name="ChangeDeviceControl" opcode="35">
972         <field type="CARD16" name="control_id" enum="DeviceControl" />
973         <field type="CARD8"  name="device_id" />
974         <pad bytes="1" />
975         <field type="DeviceCtl" name="control" />
976         <reply>
977             <pad bytes="1" />
978             <field type="CARD8" name="status" altenum="GrabStatus" />
979             <pad bytes="23" />
980         </reply>
981     </request>
982
983     <!-- ⋅⋅⋅ Requests (v1.5) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
984
985     <!-- ListDeviceProperties -->
986
987     <request name="ListDeviceProperties" opcode="36">
988         <field type="CARD8"  name="device_id" />
989         <pad bytes="3" />
990         <reply>
991             <pad bytes="1" />
992             <field type="CARD16" name="num_atoms" />
993             <pad bytes="22" />
994             <list type="ATOM" name="atoms">
995                 <fieldref>num_atoms</fieldref>
996             </list>
997         </reply>
998     </request>
999
1000     <!-- ChangeDeviceProperty -->
1001
1002     <enum name="PropertyFormat">
1003         <item name="8Bits">  <value>8</value> </item>
1004         <item name="16Bits"> <value>16</value> </item>
1005         <item name="32Bits"> <value>32</value> </item>
1006     </enum>
1007
1008     <request name="ChangeDeviceProperty" opcode="37">
1009         <field type="ATOM"  name="property" />
1010         <field type="ATOM"  name="type" />
1011         <field type="CARD8" name="device_id" />
1012         <field type="CARD8" name="format" enum="PropertyFormat" />
1013         <field type="CARD8" name="mode" enum="PropMode" />
1014         <pad bytes="1" />
1015         <field type="CARD32" name="num_items" />
1016         <switch name="items">
1017             <fieldref>format</fieldref>
1018             <!-- <bitcase> is not correct, this would need <cases>s.
1019                  It works in that case, because PropertyFormat items can be
1020                  distinguished exactly as their values don't have equal bits.
1021             -->
1022             <bitcase>
1023                 <enumref ref="PropertyFormat">8Bits</enumref>
1024                 <list type="CARD8" name="data8">
1025                     <fieldref>num_items</fieldref>
1026                 </list>
1027             </bitcase>
1028             <bitcase>
1029                 <enumref ref="PropertyFormat">16Bits</enumref>
1030                 <list type="CARD16" name="data16">
1031                     <fieldref>num_items</fieldref>
1032                 </list>
1033             </bitcase>
1034             <bitcase>
1035                 <enumref ref="PropertyFormat">32Bits</enumref>
1036                 <list type="CARD32" name="data32">
1037                     <fieldref>num_items</fieldref>
1038                 </list>
1039             </bitcase>
1040         </switch>
1041     </request>
1042
1043     <!-- DeleteDeviceProperty -->
1044
1045     <request name="DeleteDeviceProperty" opcode="38">
1046         <field type="ATOM"  name="property" />
1047         <field type="CARD8" name="device_id" />
1048         <pad bytes="3" />
1049     </request>
1050
1051     <!-- GetDeviceProperty -->
1052
1053     <request name="GetDeviceProperty" opcode="39">
1054         <field type="ATOM"   name="property" />
1055         <field type="ATOM"   name="type" />
1056         <field type="CARD32" name="offset" />
1057         <field type="CARD32" name="len" />
1058         <field type="CARD8"  name="device_id" />
1059         <field type="BOOL"   name="delete" />
1060         <pad bytes="2" />
1061         <reply>
1062             <pad bytes="1" />
1063             <field type="ATOM"   name="type" />
1064             <field type="CARD32" name="bytes_after" />
1065             <field type="CARD32" name="num_items" />
1066             <field type="CARD8"  name="format" enum="PropertyFormat" />
1067             <field type="CARD8"  name="device_id" />
1068             <pad bytes="10" />
1069             <switch name="items">
1070                 <fieldref>format</fieldref>
1071                 <!-- <bitcase> is not correct, this would need <cases>s.
1072                      It works in that case, because PropertyFormat items can be
1073                      distinguished exactly as their values don't have equal bits.
1074                 -->
1075                 <bitcase>
1076                     <enumref ref="PropertyFormat">8Bits</enumref>
1077                     <list type="CARD8" name="data8">
1078                         <fieldref>num_items</fieldref>
1079                     </list>
1080                 </bitcase>
1081                 <bitcase>
1082                     <enumref ref="PropertyFormat">16Bits</enumref>
1083                     <list type="CARD16" name="data16">
1084                         <fieldref>num_items</fieldref>
1085                     </list>
1086                 </bitcase>
1087                 <bitcase>
1088                     <enumref ref="PropertyFormat">32Bits</enumref>
1089                     <list type="CARD32" name="data32">
1090                         <fieldref>num_items</fieldref>
1091                     </list>
1092                 </bitcase>
1093             </switch>
1094         </reply>
1095     </request>
1096
1097     <!-- ⋅⋅⋅ Requests (v2.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
1098
1099     <!-- XIQueryPointer -->
1100
1101     <enum name="Device">
1102         <item name="All">       <value>0</value> </item>
1103         <item name="AllMaster"> <value>1</value> </item>
1104     </enum>
1105
1106     <struct name="GroupInfo">
1107         <field type="CARD8" name="base" />
1108         <field type="CARD8" name="latched" />
1109         <field type="CARD8" name="locked" />
1110         <field type="CARD8" name="effective" />
1111     </struct>
1112
1113     <struct name="ModifierInfo">
1114         <field type="CARD32" name="base" />
1115         <field type="CARD32" name="latched" />
1116         <field type="CARD32" name="locked" />
1117         <field type="CARD32" name="effective" />
1118     </struct>
1119
1120     <request name="XIQueryPointer" opcode="40">
1121         <field type="WINDOW"   name="window" />
1122         <field type="DeviceId" name="deviceid" altenum="Device" />
1123         <pad bytes="2" />
1124         <reply>
1125             <pad bytes="1" />
1126             <field type="WINDOW"       name="root" />
1127             <field type="WINDOW"       name="child" />
1128             <field type="FP1616"       name="root_x" />
1129             <field type="FP1616"       name="root_y" />
1130             <field type="FP1616"       name="win_x" />
1131             <field type="FP1616"       name="win_y" />
1132             <field type="CARD8"        name="same_screen" />
1133             <pad bytes="1" />
1134             <field type="CARD16"       name="buttons_len" />
1135             <field type="ModifierInfo" name="mods" />
1136             <field type="GroupInfo"    name="group" />
1137             <list type="CARD32" name="buttons">
1138                 <fieldref>buttons_len</fieldref>
1139             </list>
1140         </reply>
1141     </request>
1142
1143     <!-- XIWarpPointer -->
1144
1145     <request name="XIWarpPointer" opcode="41">
1146         <field type="WINDOW"   name="src_win" />
1147         <field type="WINDOW"   name="dst_win" />
1148         <field type="FP1616"   name="src_x" />
1149         <field type="FP1616"   name="src_y" />
1150         <field type="CARD16"   name="src_width" />
1151         <field type="CARD16"   name="src_height" />
1152         <field type="FP1616"   name="dst_x" />
1153         <field type="FP1616"   name="dst_y" />
1154         <field type="DeviceId" name="deviceid" altenum="Device" />
1155         <pad bytes="2" />
1156     </request>
1157
1158     <!-- XIChangeCursor -->
1159
1160     <request name="XIChangeCursor" opcode="42">
1161         <field type="WINDOW"   name="window" />
1162         <field type="CURSOR"   name="cursor" />
1163         <field type="DeviceId" name="deviceid" altenum="Device" />
1164         <pad bytes="2" />
1165     </request>
1166
1167     <!-- XIChangeHierarchy -->
1168
1169     <enum name="HierarchyChangeType">
1170         <item name="AddMaster">    <value>1</value> </item>
1171         <item name="RemoveMaster"> <value>2</value> </item>
1172         <item name="AttachSlave">  <value>3</value> </item>
1173         <item name="DetachSlave">  <value>4</value> </item>
1174     </enum>
1175
1176     <enum name="ChangeMode">
1177         <item name="Attach"> <value>1</value> </item>
1178         <item name="Float">  <value>2</value> </item>
1179     </enum>
1180
1181     <struct name="AddMaster">
1182         <field type="CARD16" name="type" enum="HierarchyChangeType" />
1183         <field type="CARD16" name="len" />
1184         <field type="CARD16" name="name_len" />
1185         <field type="CARD8"  name="send_core" />
1186         <field type="CARD8"  name="enable" />
1187         <list type="char" name="name">
1188             <fieldref>name_len</fieldref>
1189         </list>
1190     </struct>
1191
1192     <struct name="RemoveMaster">
1193         <field type="CARD16"   name="type" enum="HierarchyChangeType" />
1194         <field type="CARD16"   name="len" />
1195         <field type="DeviceId" name="deviceid" altenum="Device" />
1196         <field type="CARD8"    name="return_mode" enum="ChangeMode" />
1197         <pad bytes="1" />
1198         <field type="DeviceId" name="return_pointer" altenum="Device" />
1199         <field type="DeviceId" name="return_keyboard" altenum="Device" />
1200     </struct>
1201
1202     <struct name="AttachSlave">
1203         <field type="CARD16"   name="type" enum="HierarchyChangeType" />
1204         <field type="CARD16"   name="len" />
1205         <field type="DeviceId" name="deviceid" altenum="Device" />
1206         <field type="DeviceId" name="master" altenum="Device" />
1207     </struct>
1208
1209     <struct name="DetachSlave">
1210         <field type="CARD16"   name="type" enum="HierarchyChangeType" />
1211         <field type="CARD16"   name="len" />
1212         <field type="DeviceId" name="deviceid" altenum="Device" />
1213         <pad bytes="2" />
1214     </struct>
1215
1216     <struct name="HierarchyChange">
1217         <field type="CARD16" name="type" enum="HierarchyChangeType" />
1218         <field type="CARD16" name="len" />
1219         <list type="CARD8" name="uninterpreted_data">
1220             <op op="-">
1221                 <op op="*">
1222                     <fieldref>len</fieldref>
1223                     <value>4</value>
1224                 </op>
1225                 <value>4</value>
1226             </op>
1227         </list>
1228     </struct>
1229
1230     <request name="XIChangeHierarchy" opcode="43">
1231         <field type="CARD8" name="num_changes" />
1232         <list type="HierarchyChange" name="changes">
1233             <fieldref>num_changes</fieldref>
1234         </list>
1235     </request>
1236
1237     <!-- XISetClientPointer -->
1238
1239     <request name="XISetClientPointer" opcode="44">
1240         <field type="WINDOW"   name="window" />
1241         <field type="DeviceId" name="deviceid" altenum="Device" />
1242         <pad bytes="2" />
1243     </request>
1244
1245     <!-- XIGetClientPointer -->
1246
1247     <request name="XIGetClientPointer" opcode="45">
1248         <field type="WINDOW" name="window" />
1249         <reply>
1250             <pad bytes="1" />
1251             <field type="BOOL"     name="set" />
1252             <pad bytes="1" />
1253             <field type="DeviceId" name="deviceid" altenum="Device" />
1254             <pad bytes="20" />
1255         </reply>
1256     </request>
1257
1258     <!-- XISelectEvents -->
1259
1260     <enum name="XIEventMask">
1261         <item name="DeviceChanged">    <bit>1</bit> </item>
1262         <item name="KeyPress">         <bit>2</bit> </item>
1263         <item name="KeyRelease">       <bit>3</bit> </item>
1264         <item name="ButtonPress">      <bit>4</bit> </item>
1265         <item name="ButtonRelease">    <bit>5</bit> </item>
1266         <item name="Motion">           <bit>6</bit> </item>
1267         <item name="Enter">            <bit>7</bit> </item>
1268         <item name="Leave">            <bit>8</bit> </item>
1269         <item name="FocusIn">          <bit>9</bit> </item>
1270         <item name="FocusOut">         <bit>10</bit> </item>
1271         <item name="Hierarchy">        <bit>11</bit> </item>
1272         <item name="Property">         <bit>12</bit> </item>
1273         <!-- ⋅⋅⋅ Events (v2.1) ⋅⋅⋅ -->
1274         <item name="RawKeyPress">      <bit>13</bit> </item>
1275         <item name="RawKeyRelease">    <bit>14</bit> </item>
1276         <item name="RawButtonPress">   <bit>15</bit> </item>
1277         <item name="RawButtonRelease"> <bit>16</bit> </item>
1278         <item name="RawMotion">        <bit>17</bit> </item>
1279         <!-- ⋅⋅⋅ Events (v2.2) ⋅⋅⋅ -->
1280         <item name="TouchBegin">       <bit>18</bit> </item>
1281         <item name="TouchUpdate">      <bit>19</bit> </item>
1282         <item name="TouchEnd">         <bit>20</bit> </item>
1283         <item name="TouchOwnership">   <bit>21</bit> </item>
1284         <item name="RawTouchBegin">    <bit>22</bit> </item>
1285         <item name="RawTouchUpdate">   <bit>23</bit> </item>
1286         <item name="RawTouchEnd">      <bit>24</bit> </item>
1287         <!-- ⋅⋅⋅ Events (v2.3) ⋅⋅⋅ -->
1288         <item name="BarrierHit">       <bit>25</bit> </item>
1289         <item name="BarrierLeave">     <bit>26</bit> </item>
1290     </enum>
1291
1292     <struct name="EventMask">
1293         <field type="DeviceId" name="deviceid" altenum="Device" />
1294         <field type="CARD16"   name="mask_len" />
1295         <list type="CARD32" name="mask" mask="XIEventMask">
1296             <fieldref>mask_len</fieldref>
1297         </list>
1298     </struct>
1299
1300     <request name="XISelectEvents" opcode="46">
1301         <field type="WINDOW" name="window" />
1302         <field type="CARD16" name="num_mask" />
1303         <pad bytes="2" />
1304         <list type="EventMask" name="masks">
1305             <fieldref>num_mask</fieldref>
1306         </list>
1307     </request>
1308
1309     <!-- XIQueryVersion -->
1310
1311     <request name="XIQueryVersion" opcode="47">
1312         <field type="CARD16" name="major_version" />
1313         <field type="CARD16" name="minor_version" />
1314
1315         <reply>
1316             <pad bytes="1" />
1317             <field type="CARD16" name="major_version" />
1318             <field type="CARD16" name="minor_version" />
1319             <pad bytes="20" />
1320         </reply>
1321     </request>
1322
1323     <!-- XIQueryDevice -->
1324
1325     <enum name="DeviceClassType">
1326         <item name="Key">      <value>0</value> </item>
1327         <item name="Button">   <value>1</value> </item>
1328         <item name="Valuator"> <value>2</value> </item>
1329         <item name="Scroll">   <value>3</value> </item>
1330         <item name="Touch">    <value>8</value> </item>
1331     </enum>
1332
1333     <enum name="DeviceType">
1334         <item name="MasterPointer">  <value>1</value> </item>
1335         <item name="MasterKeyboard"> <value>2</value> </item>
1336         <item name="SlavePointer">   <value>3</value> </item>
1337         <item name="SlaveKeyboard">  <value>4</value> </item>
1338         <item name="FloatingSlave">  <value>5</value> </item>
1339     </enum>
1340
1341     <enum name="ScrollFlags">
1342         <item name="NoEmulation"> <bit>0</bit> </item>
1343         <item name="Preferred">   <bit>1</bit> </item>
1344     </enum>
1345
1346     <enum name="ScrollType">
1347         <item name="Vertical">   <value>1</value> </item>
1348         <item name="Horizontal"> <value>2</value> </item>
1349     </enum>
1350
1351     <enum name="TouchMode">
1352         <item name="Direct">    <value>1</value> </item>
1353         <item name="Dependent"> <value>2</value> </item>
1354     </enum>
1355
1356     <struct name="ButtonClass">
1357         <field type="CARD16"   name="type" enum="DeviceClassType" />
1358         <field type="CARD16"   name="len" />
1359         <field type="DeviceId" name="sourceid" />
1360         <field type="CARD16"   name="num_buttons" />
1361         <list type="CARD32"    name="state">
1362             <op op="/">
1363                 <op op="+">
1364                     <fieldref>num_buttons</fieldref>
1365                     <value>31</value>
1366                 </op>
1367                 <value>32</value>
1368             </op>
1369         </list>
1370         <list type="ATOM" name="labels">
1371             <fieldref>num_buttons</fieldref>
1372         </list>
1373     </struct>
1374
1375     <struct name="KeyClass">
1376         <field type="CARD16"   name="type" enum="DeviceClassType" />
1377         <field type="CARD16"   name="len" />
1378         <field type="DeviceId" name="sourceid" />
1379         <field type="CARD16"   name="num_keys" />
1380         <list type="CARD32" name="keys">
1381             <fieldref>num_keys</fieldref>
1382         </list>
1383     </struct>
1384
1385     <struct name="ScrollClass">
1386         <field type="CARD16"   name="type" enum="DeviceClassType" />
1387         <field type="CARD16"   name="len" />
1388         <field type="DeviceId" name="sourceid" />
1389         <field type="CARD16"   name="number" />
1390         <field type="CARD16"   name="scroll_type" enum="ScrollType" />
1391         <pad bytes="2" />
1392         <field type="CARD32"   name="flags" enum="ScrollFlags" />
1393         <field type="FP3232"   name="increment" />
1394     </struct>
1395
1396     <struct name="TouchClass">
1397         <field type="CARD16"   name="type" enum="DeviceClassType" />
1398         <field type="CARD16"   name="len" />
1399         <field type="DeviceId" name="sourceid" />
1400         <field type="CARD8"    name="mode" enum="TouchMode" />
1401         <field type="CARD8"    name="num_touches" />
1402     </struct>
1403
1404     <struct name="ValuatorClass">
1405         <field type="CARD16"   name="type" enum="DeviceClassType" />
1406         <field type="CARD16"   name="len" />
1407         <field type="DeviceId" name="sourceid" />
1408         <field type="CARD16"   name="number" />
1409         <field type="ATOM"     name="label" />
1410         <field type="FP3232"   name="min" />
1411         <field type="FP3232"   name="max" />
1412         <field type="FP3232"   name="value" />
1413         <field type="CARD32"   name="resolution" />
1414         <field type="CARD8"    name="mode" enum="ValuatorMode" />
1415         <pad bytes="3" />
1416     </struct>
1417
1418     <struct name="DeviceClass">
1419         <field type="CARD16"   name="type" enum="DeviceClassType" />
1420         <field type="CARD16"   name="len" />
1421         <field type="DeviceId" name="sourceid" />
1422         <pad bytes="2" />
1423         <list type="CARD8" name="uninterpreted_data">
1424             <op op="-">
1425                 <op op="*">
1426                     <fieldref>len</fieldref>
1427                     <value>4</value>
1428                 </op>
1429                 <value>8</value>
1430             </op>
1431         </list>
1432     </struct>
1433
1434     <struct name="XIDeviceInfo">
1435         <field type="DeviceId" name="deviceid" altenum="Device" />
1436         <field type="CARD16"   name="type" altenum="DeviceType" />
1437         <field type="DeviceId" name="attachment" altenum="Device" />
1438         <field type="CARD16"   name="num_classes" />
1439         <field type="CARD16"   name="name_len" />
1440         <field type="BOOL"     name="enabled" />
1441         <pad bytes="1" />
1442         <list type="char" name="name">
1443             <!-- name_len is without padding, so we've to pad on our own,
1444                  auto align pad after the list would be helpfull -->
1445             <op op="*">
1446                 <op op="/">
1447                     <op op="+">
1448                         <fieldref>name_len</fieldref>
1449                         <value>3</value>
1450                     </op>
1451                     <value>4</value>
1452                 </op>
1453                 <value>4</value>
1454             </op>
1455         </list>
1456         <list type="DeviceClass" name="classes">
1457             <fieldref>num_classes</fieldref>
1458         </list>
1459     </struct>
1460
1461     <request name="XIQueryDevice" opcode="48">
1462         <field type="DeviceId" name="deviceid" altenum="Device" />
1463         <pad bytes="2" />
1464         <reply>
1465             <pad bytes="1" />
1466             <field type="CARD16" name="num_infos" />
1467             <pad bytes="22" />
1468             <list type="XIDeviceInfo" name="infos">
1469                 <fieldref>num_infos</fieldref>
1470             </list>
1471         </reply>
1472     </request>
1473
1474     <!-- XISetFocus -->
1475
1476     <request name="XISetFocus" opcode="49">
1477         <field type="WINDOW"    name="window" />
1478         <field type="TIMESTAMP" name="time" altenum="Time" />
1479         <field type="DeviceId"  name="deviceid" altenum="Device" />
1480         <pad bytes="2" />
1481     </request>
1482
1483     <!-- XIGetFocus -->
1484
1485     <request name="XIGetFocus" opcode="50">
1486         <field type="DeviceId" name="deviceid" altenum="Device" />
1487         <pad bytes="2" />
1488         <reply>
1489             <pad bytes="1" />
1490             <field type="WINDOW" name="focus" />
1491             <pad bytes="20" />
1492         </reply>
1493     </request>
1494
1495     <!-- XIGrabDevice -->
1496
1497     <enum name="GrabOwner">
1498         <item name="NoOwner"> <value>0</value> </item>
1499         <item name="Owner">   <value>1</value> </item>
1500     </enum>
1501
1502     <request name="XIGrabDevice" opcode="51">
1503         <field type="WINDOW"    name="window" />
1504         <field type="TIMESTAMP" name="time" altenum="Time" />
1505         <field type="CURSOR"    name="cursor" />
1506         <field type="DeviceId"  name="deviceid" altenum="Device" />
1507         <field type="CARD8"     name="mode" enum="GrabMode" />
1508         <field type="CARD8"     name="paired_device_mode" enum="GrabMode" />
1509         <field type="BOOL"      name="owner_events" enum="GrabOwner" />
1510         <pad bytes="1" />
1511         <field type="CARD16"    name="mask_len" />
1512         <list type="CARD32" name="mask">
1513             <fieldref>mask_len</fieldref>
1514         </list>
1515         <reply>
1516             <pad bytes="1" />
1517             <field type="CARD8" name="status" enum="GrabStatus" />
1518             <pad bytes="23" />
1519         </reply>
1520     </request>
1521
1522     <!-- XIUngrabDevice -->
1523
1524     <request name="XIUngrabDevice" opcode="52">
1525         <field type="TIMESTAMP" name="time" altenum="Time" />
1526         <field type="DeviceId" name="deviceid" altenum="Device" />
1527         <pad bytes="2" />
1528     </request>
1529
1530     <!-- XIAllowEvents -->
1531
1532     <enum name="EventMode">
1533         <item name="AsyncDevice">       <value>0</value> </item>
1534         <item name="SyncDevice">        <value>1</value> </item>
1535         <item name="ReplayDevice">      <value>2</value> </item>
1536         <item name="AsyncPairedDevice"> <value>3</value> </item>
1537         <item name="AsyncPair">         <value>4</value> </item>
1538         <item name="SyncPair">          <value>5</value> </item>
1539         <item name="AcceptTouch">       <value>6</value> </item>
1540         <item name="RejectTouch">       <value>7</value> </item>
1541     </enum>
1542
1543     <request name="XIAllowEvents" opcode="53">
1544         <field type="TIMESTAMP" name="time" altenum="Time" />
1545         <field type="DeviceId"  name="deviceid" altenum="Device" />
1546         <field type="CARD8"     name="event_mode" enum="EventMode" />
1547         <pad bytes="1" />
1548         <field type="CARD32"    name="touchid" />
1549         <field type="WINDOW"    name="grab_window" />
1550     </request>
1551
1552     <!-- XIPassiveGrabDevice -->
1553
1554     <enum name="GrabMode22">
1555         <item name="Sync">  <value>0</value> </item>
1556         <item name="Async"> <value>1</value> </item>
1557         <item name="Touch"> <value>2</value> </item>
1558     </enum>
1559
1560     <enum name="GrabType">
1561         <item name="Button">     <value>0</value> </item>
1562         <item name="Keycode">    <value>1</value> </item>
1563         <item name="Enter">      <value>2</value> </item>
1564         <item name="FocusIn">    <value>3</value> </item>
1565         <item name="TouchBegin"> <value>4</value> </item>
1566     </enum>
1567
1568     <enum name="ModifierMask">
1569         <item name="Any"> <bit>31</bit> </item>
1570     </enum>
1571
1572     <struct name="GrabModifierInfo">
1573         <field type="CARD32" name="modifiers" altenum="ModifierMask" />
1574         <field type="CARD8"  name="status" enum="GrabStatus" />
1575         <pad bytes="3" />
1576     </struct>
1577
1578     <request name="XIPassiveGrabDevice" opcode="54">
1579         <field type="TIMESTAMP" name="time" altenum="Time" />
1580         <field type="WINDOW"    name="grab_window" />
1581         <field type="CURSOR"    name="cursor" />
1582         <field type="CARD32"    name="detail" />
1583         <field type="DeviceId"  name="deviceid" altenum="Device" />
1584         <field type="CARD16"    name="num_modifiers" />
1585         <field type="CARD16"    name="mask_len" />
1586         <field type="CARD8"     name="grab_type" enum="GrabType" />
1587         <field type="CARD8"     name="grab_mode" enum="GrabMode22" />
1588         <field type="CARD8"     name="paired_device_mode" enum="GrabMode" />
1589         <field type="BOOL"      name="owner_events" enum="GrabOwner" />
1590         <pad bytes="2" />
1591         <list type="CARD32" name="mask">
1592             <fieldref>mask_len</fieldref>
1593         </list>
1594         <list type="CARD32" name="modifiers">
1595             <fieldref>num_modifiers</fieldref>
1596         </list>
1597         <reply>
1598             <pad bytes="1" />
1599             <field type="CARD16" name="num_modifiers" />
1600             <pad bytes="22" />
1601             <list type="GrabModifierInfo" name="modifiers">
1602                 <fieldref>num_modifiers</fieldref>
1603             </list>
1604         </reply>
1605     </request>
1606
1607     <!-- XIPassiveUngrabDevice -->
1608
1609     <request name="XIPassiveUngrabDevice" opcode="55">
1610         <field type="WINDOW"   name="grab_window" />
1611         <field type="CARD32"   name="detail" />
1612         <field type="DeviceId" name="deviceid" altenum="Device" />
1613         <field type="CARD16"   name="num_modifiers" />
1614         <field type="CARD8"    name="grab_type" enum="GrabType" />
1615         <pad bytes="3" />
1616         <list type="CARD32" name="modifiers">
1617             <fieldref>num_modifiers</fieldref>
1618         </list>
1619     </request>
1620
1621     <!-- XIListProperties -->
1622
1623     <request name="XIListProperties" opcode="56">
1624         <field type="DeviceId" name="deviceid" altenum="Device" />
1625         <pad bytes="2" />
1626         <reply>
1627             <pad bytes="1" />
1628             <field type="CARD16" name="num_properties" />
1629             <pad bytes="22" />
1630             <list type="ATOM" name="properties">
1631                 <fieldref>num_properties</fieldref>
1632             </list>
1633         </reply>
1634     </request>
1635
1636     <!-- XIChangeProperty -->
1637
1638     <request name="XIChangeProperty" opcode="57">
1639         <field type="DeviceId" name="deviceid" altenum="Device" />
1640         <field type="CARD8"    name="mode" enum="PropMode" />
1641         <field type="CARD8"    name="format" enum="PropertyFormat" />
1642         <field type="ATOM"     name="property" />
1643         <field type="ATOM"     name="type" />
1644         <field type="CARD32"   name="num_items" />
1645         <switch name="items">
1646             <fieldref>format</fieldref>
1647             <!-- <bitcase> is not correct, this would need <cases>s.
1648                  It works in that case, because PropertyFormat items can be
1649                  distinguished exactly as their values don't have equal bits.
1650             -->
1651             <bitcase>
1652                 <enumref ref="PropertyFormat">8Bits</enumref>
1653                 <list type="CARD8" name="data8">
1654                     <fieldref>num_items</fieldref>
1655                 </list>
1656             </bitcase>
1657             <bitcase>
1658                 <enumref ref="PropertyFormat">16Bits</enumref>
1659                 <list type="CARD16" name="data16">
1660                     <fieldref>num_items</fieldref>
1661                 </list>
1662             </bitcase>
1663             <bitcase>
1664                 <enumref ref="PropertyFormat">32Bits</enumref>
1665                 <list type="CARD32" name="data32">
1666                     <fieldref>num_items</fieldref>
1667                 </list>
1668             </bitcase>
1669         </switch>
1670     </request>
1671
1672     <!-- XIDeleteProperty -->
1673
1674     <request name="XIDeleteProperty" opcode="58">
1675         <field type="DeviceId" name="deviceid" altenum="Device" />
1676         <pad bytes="2" />
1677         <field type="ATOM"     name="property" />
1678     </request>
1679
1680     <!-- XIGetProperty -->
1681
1682     <request name="XIGetProperty" opcode="59">
1683         <field type="DeviceId" name="deviceid" altenum="Device" />
1684         <field type="BOOL"     name="delete" />
1685         <pad bytes="1" />
1686         <field type="ATOM"     name="property" />
1687         <field type="ATOM"     name="type" />
1688         <field type="CARD32"   name="offset" />
1689         <field type="CARD32"   name="len" />
1690         <reply>
1691             <pad bytes="1" />
1692             <field type="ATOM"   name="type" />
1693             <field type="CARD32" name="bytes_after" />
1694             <field type="CARD32" name="num_items" />
1695             <field type="CARD8"  name="format" enum="PropertyFormat" />
1696             <pad bytes="11" />
1697             <switch name="items">
1698                 <fieldref>format</fieldref>
1699                 <!-- <bitcase> is not correct, this would need <cases>s.
1700                      It works in that case, because PropertyFormat items can be
1701                      distinguished exactly as their values don't have equal bits.
1702                 -->
1703                 <bitcase>
1704                     <enumref ref="PropertyFormat">8Bits</enumref>
1705                     <list type="CARD8" name="data8">
1706                         <fieldref>num_items</fieldref>
1707                     </list>
1708                 </bitcase>
1709                 <bitcase>
1710                     <enumref ref="PropertyFormat">16Bits</enumref>
1711                     <list type="CARD16" name="data16">
1712                         <fieldref>num_items</fieldref>
1713                     </list>
1714                 </bitcase>
1715                 <bitcase>
1716                     <enumref ref="PropertyFormat">32Bits</enumref>
1717                     <list type="CARD32" name="data32">
1718                         <fieldref>num_items</fieldref>
1719                     </list>
1720                 </bitcase>
1721             </switch>
1722         </reply>
1723     </request>
1724
1725     <!-- XIGetSelectedEvents -->
1726
1727     <request name="XIGetSelectedEvents" opcode="60">
1728         <field type="WINDOW" name="window" />
1729         <reply>
1730             <pad bytes="1" />
1731             <field type="CARD16" name="num_masks" />
1732             <pad bytes="22" />
1733             <list type="EventMask" name="masks">
1734                 <fieldref>num_masks</fieldref>
1735             </list>
1736         </reply>
1737     </request>
1738
1739     <!-- ⋅⋅⋅ Requests (v2.3) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
1740
1741     <!-- XIBarrierReleasePointer -->
1742
1743     <struct name="BarrierReleasePointerInfo">
1744         <field type="DeviceId" name="deviceid" />
1745         <pad bytes="2" />
1746         <field type="BARRIER"  name="barrier" />
1747         <field type="CARD32"   name="eventid" />
1748     </struct>
1749
1750     <request name="XIBarrierReleasePointer" opcode="61">
1751         <field type="CARD32" name="num_barriers" />
1752         <list type="BarrierReleasePointerInfo" name="barriers">
1753             <fieldref>num_barriers</fieldref>
1754         </list>
1755     </request>
1756
1757     <!-- ⋅⋅⋅ Events (v1.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
1758     <!-- Notes:
1759          - A 'len' field in a v1++ structure is in bytes.
1760     -->
1761
1762     <event name="DeviceValuator" number="0">
1763         <field type="CARD8"  name="device_id" />
1764         <field type="CARD16" name="device_state" />
1765         <field type="CARD8"  name="num_valuators" />
1766         <field type="CARD8"  name="first_valuator" />
1767         <list type="INT32"   name="valuators">
1768             <value>6</value>
1769         </list>
1770     </event>
1771
1772     <event name="DeviceKeyPress" number="1">
1773         <field type="BYTE"      name="detail" />
1774         <field type="TIMESTAMP" name="time" />
1775         <field type="WINDOW"    name="root" />
1776         <field type="WINDOW"    name="event" />
1777         <field type="WINDOW"    name="child" altenum="Window" />
1778         <field type="INT16"     name="root_x" />
1779         <field type="INT16"     name="root_y" />
1780         <field type="INT16"     name="event_x" />
1781         <field type="INT16"     name="event_y" />
1782         <field type="CARD16"    name="state" />
1783         <field type="BOOL"      name="same_screen" />
1784         <field type="CARD8"     name="device_id" />
1785     </event>
1786
1787     <eventcopy name="DeviceKeyRelease"    number="2" ref="DeviceKeyPress" />
1788     <eventcopy name="DeviceButtonPress"   number="3" ref="DeviceKeyPress" />
1789     <eventcopy name="DeviceButtonRelease" number="4" ref="DeviceKeyPress" />
1790     <eventcopy name="DeviceMotionNotify"  number="5" ref="DeviceKeyPress" />
1791
1792     <event name="DeviceFocusIn" number="6">
1793         <field type="BYTE"      name="detail" enum="xproto:NotifyDetail" />
1794         <field type="TIMESTAMP" name="time" />
1795         <field type="WINDOW"    name="window" />
1796         <field type="BYTE"      name="mode" enum="xproto:NotifyMode" />
1797         <field type="CARD8"     name="device_id" />
1798         <pad bytes="18" />
1799     </event>
1800
1801     <eventcopy name="DeviceFocusOut" number="7" ref="DeviceFocusIn" />
1802     <eventcopy name="ProximityIn"    number="8" ref="DeviceKeyPress" />
1803     <eventcopy name="ProximityOut"   number="9" ref="DeviceKeyPress" />
1804
1805     <event name="DeviceStateNotify" number="10">
1806         <field type="BYTE"      name="device_id" />
1807         <field type="TIMESTAMP" name="time" />
1808         <field type="CARD8"     name="num_keys" />
1809         <field type="CARD8"     name="num_buttons" />
1810         <field type="CARD8"     name="num_valuators" />
1811         <field type="CARD8"     name="classes_reported" />
1812         <list type="CARD8"      name="buttons">
1813             <value>4</value>
1814         </list>
1815         <list type="CARD8" name="keys">
1816             <value>4</value>
1817         </list>
1818         <list type="CARD32" name="valuators">
1819             <value>3</value>
1820         </list>
1821     </event>
1822
1823     <event name="DeviceMappingNotify" number="11">
1824         <field type="BYTE"    name="device_id" />
1825         <field type="CARD8"   name="request" />
1826         <field type="KeyCode" name="first_keycode" />
1827         <field type="CARD8"   name="count" />
1828         <pad bytes="1" />
1829         <field type="TIMESTAMP" name="time" />
1830         <pad bytes="20" />
1831     </event>
1832
1833     <event name="ChangeDeviceNotify" number="12">
1834         <field type="BYTE"      name="device_id" />
1835         <field type="TIMESTAMP" name="time" />
1836         <field type="CARD8"     name="request" />
1837         <pad bytes="23" />
1838     </event>
1839
1840     <event name="DeviceKeyStateNotify" number="13">
1841         <field type="BYTE" name="device_id" />
1842         <list type="CARD8" name="keys">
1843             <value>28</value>
1844         </list>
1845     </event>
1846
1847     <event name="DeviceButtonStateNotify" number="14">
1848         <field type="BYTE" name="device_id" />
1849         <list type="CARD8" name="buttons">
1850             <value>28</value>
1851         </list>
1852     </event>
1853
1854     <!-- ⋅⋅⋅ Events (v1.4) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
1855
1856     <enum name="DeviceChange">
1857         <item name="Added">          <value>0</value> </item>
1858         <item name="Removed">        <value>1</value> </item>
1859         <item name="Enabled">        <value>2</value> </item>
1860         <item name="Disabled">       <value>3</value> </item>
1861         <item name="Unrecoverable">  <value>4</value> </item>
1862         <item name="ControlChanged"> <value>5</value> </item>
1863     </enum>
1864
1865     <event name="DevicePresenceNotify" number="15">
1866         <pad bytes="1" />
1867         <field type="TIMESTAMP" name="time" />
1868         <field type="BYTE"      name="devchange" enum="DeviceChange" />
1869         <field type="BYTE"      name="device_id" />
1870         <field type="CARD16"    name="control" />
1871         <pad bytes="20" />
1872     </event>
1873
1874     <!-- ⋅⋅⋅ Events (v1.5) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
1875
1876     <event name="DevicePropertyNotify" number="16">
1877         <field type="BYTE"      name="state" enum="Property" />
1878         <field type="TIMESTAMP" name="time" />
1879         <field type="ATOM"      name="property" />
1880         <pad bytes="19" />
1881         <field type="CARD8"     name="device_id" />
1882     </event>
1883
1884     <!-- ⋅⋅⋅ Events (v2.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
1885     <!-- Notes:
1886          - A 'len' field in a v2++ structure is in 4 byte units.
1887     -->
1888
1889     <enum name="ChangeReason">
1890         <item name="SlaveSwitch">  <value>1</value> </item>
1891         <item name="DeviceChange"> <value>2</value> </item>
1892     </enum>
1893
1894     <event name="DeviceChanged" number="1" xge="true">
1895         <field type="DeviceId"  name="deviceid" altenum="Device" />
1896         <field type="TIMESTAMP" name="time" altenum="Time" />
1897         <!-- event specific fields -->
1898         <field type="CARD16"    name="num_classes" />
1899         <field type="DeviceId"  name="sourceid" altenum="Device" />
1900         <field type="CARD8"     name="reason" enum="ChangeReason" />
1901         <pad bytes="11" />
1902         <!-- 32 byte boundary -->
1903         <list type="DeviceClass" name="classes">
1904             <fieldref>num_classes</fieldref>
1905         </list>
1906     </event>
1907
1908     <enum name="KeyEventFlags">
1909         <item name="KeyRepeat"> <bit>16</bit> </item>
1910     </enum>
1911
1912     <event name="KeyPress" number="2" xge="true">
1913         <field type="DeviceId"  name="deviceid" altenum="Device" />
1914         <field type="TIMESTAMP" name="time" altenum="Time" />
1915         <!-- event specific fields -->
1916         <field type="CARD32"    name="detail" />
1917         <field type="WINDOW"    name="root" />
1918         <field type="WINDOW"    name="event" />
1919         <field type="WINDOW"    name="child" />
1920         <!-- 32 byte boundary -->
1921         <field type="FP1616"    name="root_x" />
1922         <field type="FP1616"    name="root_y" />
1923         <field type="FP1616"    name="event_x" />
1924         <field type="FP1616"    name="event_y" />
1925         <field type="CARD16"    name="buttons_len" />
1926         <field type="CARD16"    name="valuators_len" />
1927         <field type="DeviceId"  name="sourceid" altenum="Device" />
1928         <pad bytes="2" />
1929         <field type="CARD32"       name="flags" mask="KeyEventFlags" />
1930         <field type="ModifierInfo" name="mods" />
1931         <field type="GroupInfo"    name="group" />
1932         <list type="CARD32" name="button_mask">
1933             <fieldref>buttons_len</fieldref>
1934         </list>
1935         <list type="CARD32" name="valuator_mask">
1936             <fieldref>valuators_len</fieldref>
1937         </list>
1938         <!-- Uninterpreted: list (axisvalues) of FP3232,
1939                             length is <popcount> on valuator_mask list -->
1940     </event>
1941
1942     <eventcopy name="KeyRelease" number="3" ref="KeyPress" />
1943
1944     <enum name="PointerEventFlags">
1945         <item name="PointerEmulated"> <bit>16</bit> </item>
1946     </enum>
1947
1948     <event name="ButtonPress" number="4" xge="true">
1949         <field type="DeviceId"  name="deviceid" altenum="Device" />
1950         <field type="TIMESTAMP" name="time" altenum="Time" />
1951         <!-- event specific fields -->
1952         <field type="CARD32"    name="detail" />
1953         <field type="WINDOW"    name="root" />
1954         <field type="WINDOW"    name="event" />
1955         <field type="WINDOW"    name="child" />
1956         <!-- 32 byte boundary -->
1957         <field type="FP1616"    name="root_x" />
1958         <field type="FP1616"    name="root_y" />
1959         <field type="FP1616"    name="event_x" />
1960         <field type="FP1616"    name="event_y" />
1961         <field type="CARD16"    name="buttons_len" />
1962         <field type="CARD16"    name="valuators_len" />
1963         <field type="DeviceId"  name="sourceid" altenum="Device" />
1964         <pad bytes="2" />
1965         <field type="CARD32"       name="flags" mask="PointerEventFlags" />
1966         <field type="ModifierInfo" name="mods" />
1967         <field type="GroupInfo"    name="group" />
1968         <list type="CARD32" name="button_mask">
1969             <fieldref>buttons_len</fieldref>
1970         </list>
1971         <list type="CARD32" name="valuator_mask">
1972             <fieldref>valuators_len</fieldref>
1973         </list>
1974         <!-- Uninterpreted: list (axisvalues) of FP3232,
1975                             length is <popcount> on valuator_mask list -->
1976     </event>
1977
1978     <eventcopy name="ButtonRelease" number="5" ref="ButtonPress" />
1979     <eventcopy name="Motion"        number="6" ref="ButtonPress" />
1980
1981     <enum name="NotifyMode">
1982         <item name="Normal">        <value>0</value> </item>
1983         <item name="Grab">          <value>1</value> </item>
1984         <item name="Ungrab">        <value>2</value> </item>
1985         <item name="WhileGrabbed">  <value>3</value> </item>
1986         <item name="PassiveGrab">   <value>4</value> </item>
1987         <item name="PassiveUngrab"> <value>5</value> </item>
1988     </enum>
1989
1990     <enum name="NotifyDetail">
1991         <item name="Ancestor">         <value>0</value> </item>
1992         <item name="Virtual">          <value>1</value> </item>
1993         <item name="Inferior">         <value>2</value> </item>
1994         <item name="Nonlinear">        <value>3</value> </item>
1995         <item name="NonlinearVirtual"> <value>4</value> </item>
1996         <item name="Pointer">          <value>5</value> </item>
1997         <item name="PointerRoot">      <value>6</value> </item>
1998         <item name="None">             <value>7</value> </item>
1999     </enum>
2000
2001     <event name="Enter" number="7" xge="true">
2002         <field type="DeviceId"  name="deviceid" altenum="Device" />
2003         <field type="TIMESTAMP" name="time" altenum="Time" />
2004         <!-- event specific fields -->
2005         <field type="DeviceId"  name="sourceid" altenum="Device" />
2006         <field type="CARD8"     name="mode" enum="xinput:NotifyMode" />
2007         <field type="CARD8"     name="detail" enum="xinput:NotifyDetail" />
2008         <field type="WINDOW"    name="root" />
2009         <field type="WINDOW"    name="event" />
2010         <field type="WINDOW"    name="child" />
2011         <!-- 32 byte boundary -->
2012         <field type="FP1616"       name="root_x" />
2013         <field type="FP1616"       name="root_y" />
2014         <field type="FP1616"       name="event_x" />
2015         <field type="FP1616"       name="event_y" />
2016         <field type="CARD8"        name="same_screen" />
2017         <field type="CARD8"        name="focus" />
2018         <field type="CARD16"       name="buttons_len" />
2019         <field type="ModifierInfo" name="mods" />
2020         <field type="GroupInfo"    name="group" />
2021         <list type="CARD32" name="buttons">
2022             <fieldref>buttons_len</fieldref>
2023         </list>
2024     </event>
2025
2026     <eventcopy name="Leave"    number="8" ref="Enter" />
2027     <eventcopy name="FocusIn"  number="9" ref="Enter" />
2028     <eventcopy name="FocusOut" number="10" ref="Enter" />
2029
2030     <enum name="HierarchyMask">
2031         <item name="MasterAdded">    <bit>0</bit> </item>
2032         <item name="MasterRemoved">  <bit>1</bit> </item>
2033         <item name="SlaveAdded">     <bit>2</bit> </item>
2034         <item name="SlaveRemoved">   <bit>3</bit> </item>
2035         <item name="SlaveAttached">  <bit>4</bit> </item>
2036         <item name="SlaveDetached">  <bit>5</bit> </item>
2037         <item name="DeviceEnabled">  <bit>6</bit> </item>
2038         <item name="DeviceDisabled"> <bit>7</bit> </item>
2039     </enum>
2040
2041     <struct name="HierarchyInfo">
2042         <field type="DeviceId" name="deviceid" altenum="Device" />
2043         <field type="DeviceId" name="attachment" altenum="Device" />
2044         <field type="CARD8"    name="type" enum="DeviceType"/>
2045         <field type="BOOL"     name="enabled" />
2046         <pad bytes="2" />
2047         <field type="CARD32"   name="flags" mask="HierarchyMask" />
2048     </struct>
2049
2050     <event name="Hierarchy" number="11" xge="true">
2051         <field type="DeviceId"  name="deviceid" altenum="Device" />
2052         <field type="TIMESTAMP" name="time" altenum="Time" />
2053         <!-- event specific fields -->
2054         <field type="CARD32"    name="flags" mask="HierarchyMask" />
2055         <field type="CARD16"    name="num_infos" />
2056         <pad bytes="10" />
2057         <!-- 32 byte boundary -->
2058         <list type="HierarchyInfo" name="infos">
2059             <fieldref>num_infos</fieldref>
2060         </list>
2061     </event>
2062
2063     <enum name="PropertyFlag">
2064         <item name="Deleted">  <value>0</value> </item>
2065         <item name="Created">  <value>1</value> </item>
2066         <item name="Modified"> <value>2</value> </item>
2067     </enum>
2068
2069     <event name="Property" number="12" xge="true">
2070         <field type="DeviceId"  name="deviceid" altenum="Device" />
2071         <field type="TIMESTAMP" name="time" altenum="Time" />
2072         <!-- event specific fields -->
2073         <field type="ATOM"      name="property" />
2074         <field type="CARD8"     name="what" enum="PropertyFlag" />
2075         <pad bytes="11" />
2076         <!-- 32 byte boundary -->
2077     </event>
2078
2079     <!-- ⋅⋅⋅ Events (v2.1) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
2080
2081     <event name="RawKeyPress" number="13" xge="true">
2082         <field type="DeviceId"  name="deviceid" altenum="Device" />
2083         <field type="TIMESTAMP" name="time" altenum="Time" />
2084         <!-- event specific fields -->
2085         <field type="CARD32"    name="detail" />
2086         <field type="DeviceId"  name="sourceid" />
2087         <field type="CARD16"    name="valuators_len" />
2088         <field type="CARD32"    name="flags" mask="KeyEventFlags"/>
2089         <pad bytes="4" />
2090         <!-- 32 byte boundary -->
2091         <list type="CARD32" name="valuator_mask">
2092             <fieldref>valuators_len</fieldref>
2093         </list>
2094         <!-- Uninterpreted: list (axisvalues) of FP3232,
2095                             length is <popcount> on valuator_mask list -->
2096         <!-- Uninterpreted: list (axisvalues_raw) of FP3232,
2097                             length is <popcount> on valuator_mask list -->
2098     </event>
2099
2100     <eventcopy name="RawKeyRelease" number="14" ref="RawKeyPress" />
2101
2102     <event name="RawButtonPress" number="15" xge="true">
2103         <field type="DeviceId"  name="deviceid" altenum="Device" />
2104         <field type="TIMESTAMP" name="time" altenum="Time" />
2105         <!-- event specific fields -->
2106         <field type="CARD32"    name="detail" />
2107         <field type="DeviceId"  name="sourceid" />
2108         <field type="CARD16"    name="valuators_len" />
2109         <field type="CARD32"    name="flags" mask="PointerEventFlags"/>
2110         <pad bytes="4" />
2111         <!-- 32 byte boundary -->
2112         <list type="CARD32" name="valuator_mask">
2113             <fieldref>valuators_len</fieldref>
2114         </list>
2115         <!-- Uninterpreted: list (axisvalues) of FP3232,
2116                             length is <popcount> on valuator_mask list -->
2117         <!-- Uninterpreted: list (axisvalues_raw) of FP3232,
2118                             length is <popcount> on valuator_mask list -->
2119     </event>
2120
2121     <eventcopy name="RawButtonRelease" number="16" ref="RawButtonPress" />
2122     <eventcopy name="RawMotion"        number="17" ref="RawButtonPress" />
2123
2124     <!-- ⋅⋅⋅ Events (v2.2) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
2125
2126     <enum name="TouchEventFlags">
2127         <item name="TouchPendingEnd">       <bit>16</bit> </item>
2128         <item name="TouchEmulatingPointer"> <bit>17</bit> </item>
2129     </enum>
2130
2131     <event name="TouchBegin" number="18" xge="true">
2132         <field type="DeviceId"  name="deviceid" altenum="Device" />
2133         <field type="TIMESTAMP" name="time" altenum="Time" />
2134         <!-- event specific fields -->
2135         <field type="CARD32"    name="detail" />
2136         <field type="WINDOW"    name="root" />
2137         <field type="WINDOW"    name="event" />
2138         <field type="WINDOW"    name="child" />
2139         <!-- 32 byte boundary -->
2140         <field type="FP1616"    name="root_x" />
2141         <field type="FP1616"    name="root_y" />
2142         <field type="FP1616"    name="event_x" />
2143         <field type="FP1616"    name="event_y" />
2144         <field type="CARD16"    name="buttons_len" />
2145         <field type="CARD16"    name="valuators_len" />
2146         <field type="DeviceId"  name="sourceid" altenum="Device" />
2147         <pad bytes="2" />
2148         <field type="CARD32"       name="flags" mask="TouchEventFlags" />
2149         <field type="ModifierInfo" name="mods" />
2150         <field type="GroupInfo"    name="group" />
2151         <list type="CARD32" name="button_mask">
2152             <fieldref>buttons_len</fieldref>
2153         </list>
2154         <list type="CARD32" name="valuator_mask">
2155             <fieldref>valuators_len</fieldref>
2156         </list>
2157         <!-- Uninterpreted: list (axisvalues) of FP3232,
2158                             length is <popcount> on valuator_mask list -->
2159     </event>
2160
2161     <eventcopy name="TouchUpdate" number="19" ref="TouchBegin" />
2162     <eventcopy name="TouchEnd"    number="20" ref="TouchBegin" />
2163
2164     <enum name="TouchOwnershipFlags">
2165         <!-- XXX: Remove this enum? Currently, no flag is defined. -->
2166         <item name="None"> <value>0</value> </item>
2167     </enum>
2168
2169     <event name="TouchOwnership" number="21" xge="true">
2170         <field type="DeviceId"  name="deviceid" altenum="Device" />
2171         <field type="TIMESTAMP" name="time" altenum="Time" />
2172         <!-- event specific fields -->
2173         <field type="CARD32"    name="touchid" />
2174         <field type="WINDOW"    name="root" />
2175         <field type="WINDOW"    name="event" />
2176         <field type="WINDOW"    name="child" />
2177         <!-- 32 byte boundary -->
2178         <field type="DeviceId"  name="sourceid" altenum="Device" />
2179         <pad bytes="2" />
2180         <field type="CARD32"    name="flags" enum="TouchOwnershipFlags" />
2181         <pad bytes="8" />
2182     </event>
2183
2184     <event name="RawTouchBegin" number="22" xge="true">
2185         <field type="DeviceId"  name="deviceid" altenum="Device" />
2186         <field type="TIMESTAMP" name="time" altenum="Time" />
2187         <!-- event specific fields -->
2188         <field type="CARD32"    name="detail" />
2189         <field type="DeviceId"  name="sourceid" />
2190         <field type="CARD16"    name="valuators_len" />
2191         <field type="CARD32"    name="flags" mask="TouchEventFlags"/>
2192         <pad bytes="4" />
2193         <!-- 32 byte boundary -->
2194         <list type="CARD32" name="valuator_mask">
2195             <fieldref>valuators_len</fieldref>
2196         </list>
2197         <!-- Uninterpreted: list (axisvalues) of FP3232,
2198                             length is <popcount> on valuator_mask list -->
2199         <!-- Uninterpreted: list (axisvalues_raw) of FP3232,
2200                             length is <popcount> on valuator_mask list -->
2201     </event>
2202
2203     <eventcopy name="RawTouchUpdate" number="23" ref="RawTouchBegin" />
2204     <eventcopy name="RawTouchEnd"    number="24" ref="RawTouchBegin" />
2205
2206     <!-- ⋅⋅⋅ Events (v2.3) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
2207
2208     <event name="BarrierHit" number="25" xge="true">
2209         <field type="DeviceId"  name="deviceid" altenum="Device" />
2210         <field type="TIMESTAMP" name="time" altenum="Time" />
2211         <!-- event specific fields -->
2212         <field type="CARD32"    name="eventid" />
2213         <field type="WINDOW"    name="root" />
2214         <field type="WINDOW"    name="event" />
2215         <field type="BARRIER"   name="barrier" />
2216         <!-- 32 byte boundary -->
2217         <field type="CARD32"    name="dtime" />
2218         <field type="CARD32"    name="flags" />
2219         <field type="DeviceId"  name="sourceid" altenum="Device" />
2220         <pad bytes="2" />
2221         <field type="FP1616"    name="root_x" />
2222         <field type="FP1616"    name="root_y" />
2223         <field type="FP3232"    name="dx" />
2224         <field type="FP3232"    name="dy" />
2225     </event>
2226
2227     <eventcopy name="BarrierLeave" number="26" ref="BarrierHit" />
2228
2229     <!-- ⋅⋅⋅ Errors (v1.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
2230
2231     <error name="Device"     number="0" />
2232     <error name="Event"      number="1" />
2233     <error name="Mode"       number="2" />
2234     <error name="DeviceBusy" number="3" />
2235     <error name="Class"      number="4" />
2236
2237 </xcb>