5436401db5bde8aea930fe54ed1ebc854eae7d9b
[free-sw/xcb/proto] / src / xkb.xml
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!--
3 Copyright (C) 2009 Open Text Corporation.  All Rights Reserved.
4
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be included in all
13 copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22 Except as contained in this notice, the names of the authors or their
23 institutions shall not be used in advertising or otherwise to promote the
24 sale, use or other dealings in this Software without prior written
25 authorization from the authors.
26 -->
27 <xcb header="xkb" extension-xname="XKEYBOARD" extension-name="xkb"
28         major-version="1" minor-version="0">
29
30         <import>xproto</import>
31
32         <!-- Common Types -->
33         <enum name="Const">
34                 <item name="MaxLegalKeyCode"> <value>255</value> </item>
35                 <item name="PerKeyBitArraySize">
36                         <value>32</value>
37                 </item>
38                 <item name="KeyNameLength">
39                         <value>4</value>
40                 </item>
41         </enum>
42
43         <enum name="EventType">
44                 <item name="NewKeyboardNotify">      <bit>0</bit> </item>
45                 <item name="MapNotify">              <bit>1</bit> </item>
46                 <item name="StateNotify">            <bit>2</bit> </item>
47                 <item name="ControlsNotify">         <bit>3</bit> </item>
48                 <item name="IndicatorStateNotify">   <bit>4</bit> </item>
49                 <item name="IndicatorMapNotify">     <bit>5</bit> </item>
50                 <item name="NamesNotify">            <bit>6</bit> </item>
51                 <item name="CompatMapNotify">        <bit>7</bit> </item>
52                 <item name="BellNotify">             <bit>8</bit> </item>
53                 <item name="ActionMessage">          <bit>9</bit> </item>
54                 <item name="AccessXNotify">          <bit>10</bit> </item>
55                 <item name="ExtensionDeviceNotify">  <bit>11</bit> </item>
56         </enum>
57
58         <enum name="NKNDetail">
59                 <item name="Keycodes"> <bit>0</bit> </item>
60                 <item name="Geometry"> <bit>1</bit> </item>
61                 <item name="DeviceID"> <bit>2</bit> </item>
62         </enum>
63
64         <enum name="AXNDetail">
65                 <item name="SKPress">      <bit>0</bit> </item>
66                 <item name="SKAccept">     <bit>1</bit> </item>
67                 <item name="SKReject">     <bit>2</bit> </item>
68                 <item name="SKRelease">    <bit>3</bit> </item>
69                 <item name="BKAccept">     <bit>4</bit> </item>
70                 <item name="BKReject">     <bit>5</bit> </item>
71                 <item name="AXKWarning">   <bit>6</bit> </item>
72         </enum>
73
74         <enum name="MapPart">
75                 <item name="KeyTypes">            <bit>0</bit> </item>
76                 <item name="KeySyms">             <bit>1</bit> </item>
77                 <item name="ModifierMap">         <bit>2</bit> </item>
78                 <item name="ExplicitComponents">  <bit>3</bit> </item>
79                 <item name="KeyActions">          <bit>4</bit> </item>
80                 <item name="KeyBehaviors">        <bit>5</bit> </item>
81                 <item name="VirtualMods">         <bit>6</bit> </item>
82                 <item name="VirtualModMap">       <bit>7</bit> </item>
83         </enum>
84
85         <enum name="SetMapFlags">
86                 <item name="ResizeTypes">       <bit>0</bit> </item>
87                 <item name="RecomputeActions">  <bit>1</bit> </item>
88         </enum>
89
90         <enum name="StatePart">
91                 <item name="ModifierState">     <bit>0</bit> </item>
92                 <item name="ModifierBase">      <bit>1</bit> </item>
93                 <item name="ModifierLatch">     <bit>2</bit> </item>
94                 <item name="ModifierLock">      <bit>3</bit> </item>
95                 <item name="GroupState">        <bit>4</bit> </item>
96                 <item name="GroupBase">         <bit>5</bit> </item>
97                 <item name="GroupLatch">        <bit>6</bit> </item>
98                 <item name="GroupLock">         <bit>7</bit> </item>
99                 <item name="CompatState">       <bit>8</bit> </item>
100                 <item name="GrabMods">          <bit>9</bit> </item>
101                 <item name="CompatGrabMods">    <bit>10</bit> </item>
102                 <item name="LookupMods">        <bit>11</bit> </item>
103                 <item name="CompatLookupMods">  <bit>12</bit> </item>
104                 <item name="PointerButtons">    <bit>13</bit> </item>
105         </enum>
106
107         <enum name="BoolCtrl">
108                 <item name="RepeatKeys">           <bit>0</bit> </item>
109                 <item name="SlowKeys">             <bit>1</bit> </item>
110                 <item name="BounceKeys">           <bit>2</bit> </item>
111                 <item name="StickyKeys">           <bit>3</bit> </item>
112                 <item name="MouseKeys">            <bit>4</bit> </item>
113                 <item name="MouseKeysAccel">       <bit>5</bit> </item>
114                 <item name="AccessXKeys">          <bit>6</bit> </item>
115                 <item name="AccessXTimeoutMask">   <bit>7</bit> </item>
116                 <item name="AccessXFeedbackMask">  <bit>8</bit> </item>
117                 <item name="AudibleBellMask">      <bit>9</bit> </item>
118                 <item name="Overlay1Mask">         <bit>10</bit> </item>
119                 <item name="Overlay2Mask">         <bit>11</bit> </item>
120                 <item name="IgnoreGroupLockMask">  <bit>12</bit> </item>
121         </enum>
122
123         <!-- XXX: one zero less than XKB specification says,
124                   uses the same values as libX11 -->
125         <enum name="Control" >
126                 <item name="GroupsWrap">      <bit>27</bit> </item>
127                 <item name="InternalMods">    <bit>28</bit> </item>
128                 <item name="IgnoreLockMods">  <bit>29</bit> </item>
129                 <item name="PerKeyRepeat">    <bit>30</bit> </item>
130                 <item name="ControlsEnabled"> <bit>31</bit> </item>
131         </enum>
132
133         <enum name="AXOption">
134                 <item name="SKPressFB">     <bit>0</bit> </item>
135                 <item name="SKAcceptFB">    <bit>1</bit> </item>
136                 <item name="FeatureFB">     <bit>2</bit> </item>
137                 <item name="SlowWarnFB">    <bit>3</bit> </item>
138                 <item name="IndicatorFB">   <bit>4</bit> </item>
139                 <item name="StickyKeysFB">  <bit>5</bit> </item>
140                 <item name="TwoKeys">       <bit>6</bit> </item>
141                 <item name="LatchToLock">   <bit>7</bit> </item>
142                 <item name="SKReleaseFB">   <bit>8</bit> </item>
143                 <item name="SKRejectFB">    <bit>9</bit> </item>
144                 <item name="BKRejectFB">    <bit>10</bit> </item>
145                 <item name="DumbBell">      <bit>11</bit> </item>
146         </enum>
147
148         <typedef oldname="CARD16" newname="DeviceSpec" />
149
150         <enum name="LedClassResult">
151                 <item name="KbdFeedbackClass"> <value>0</value> </item>
152                 <item name="LedFeedbackClass"> <value>4</value> </item>
153         </enum>
154
155         <enum name="LedClass">
156                 <item name="KbdFeedbackClass"> <value>0</value> </item>
157                 <item name="LedFeedbackClass"> <value>4</value> </item>
158                 <item name="DfltXIClass">      <value>768</value> </item>       <!--0x300-->
159                 <item name="AllXIClasses">     <value>1280</value> </item>      <!--0x500-->
160         </enum>
161         <typedef oldname="CARD16" newname="LedClassSpec" />
162
163         <enum name="BellClassResult">
164                 <item name="KbdFeedbackClass">  <value>0</value> </item>
165                 <item name="BellFeedbackClass"> <value>5</value> </item>
166         </enum>
167
168         <enum name="BellClass">
169                 <item name="KbdFeedbackClass">  <value>0</value> </item>
170                 <item name="BellFeedbackClass"> <value>5</value> </item>
171                 <item name="DfltXIClass">       <value>768</value> </item>      <!--0x300-->
172         </enum>
173         <typedef oldname="CARD16" newname="BellClassSpec" />
174
175         <enum name="ID">
176                 <item name="UseCoreKbd">  <value>256</value> </item>    <!-- 0x100 -->
177                 <item name="UseCorePtr">  <value>512</value> </item>    <!-- 0x200 -->
178                 <item name="DfltXIClass"> <value>768</value> </item>    <!-- 0x300 -->
179                 <item name="DfltXIId">   <value>1024</value> </item>    <!-- 0x400 -->
180                 <item name="AllXIClass"> <value>1280</value> </item>    <!-- 0x500 -->
181                 <item name="AllXIId">    <value>1536</value> </item>    <!-- 0x600 -->
182                 <item name="XINone">     <value>65280</value> </item>   <!--0xff00-->
183         </enum>
184         <typedef oldname="CARD16" newname="IDSpec" />
185
186         <enum name="Group">
187                 <item name="1"> <value>0</value> </item>
188                 <item name="2"> <value>1</value> </item>
189                 <item name="3"> <value>2</value> </item>
190                 <item name="4"> <value>3</value> </item>
191         </enum>
192
193         <enum name="Groups">
194                 <item name="Any"> <value>254</value> </item>
195                 <item name="All"> <value>255</value> </item>
196         </enum>
197
198         <enum name="SetOfGroup">
199                 <item name="Group1"> <bit>0</bit> </item>
200                 <item name="Group2"> <bit>1</bit> </item>
201                 <item name="Group3"> <bit>2</bit> </item>
202                 <item name="Group4"> <bit>3</bit> </item>
203         </enum>
204
205         <enum name="SetOfGroups">
206                 <item name="Any"> <bit>7</bit> </item>
207         </enum>
208
209         <enum name="GroupsWrap">
210                 <item name="WrapIntoRange">     <value>0</value> </item>
211                 <item name="ClampIntoRange">    <bit>6</bit> </item>
212                 <item name="RedirectIntoRange"> <bit>7</bit> </item>
213         </enum>
214
215         <enum name="VModsHigh">
216                 <item name="15"> <bit>7</bit> </item>
217                 <item name="14"> <bit>6</bit> </item>
218                 <item name="13"> <bit>5</bit> </item>
219                 <item name="12"> <bit>4</bit> </item>
220                 <item name="11"> <bit>3</bit> </item>
221                 <item name="10"> <bit>2</bit> </item>
222                 <item name="9">  <bit>1</bit> </item>
223                 <item name="8">  <bit>0</bit> </item>
224         </enum>
225
226         <enum name="VModsLow">
227                 <item name="7"> <bit>7</bit> </item>
228                 <item name="6"> <bit>6</bit> </item>
229                 <item name="5"> <bit>5</bit> </item>
230                 <item name="4"> <bit>4</bit> </item>
231                 <item name="3"> <bit>3</bit> </item>
232                 <item name="2"> <bit>2</bit> </item>
233                 <item name="1"> <bit>1</bit> </item>
234                 <item name="0"> <bit>0</bit> </item>
235         </enum>
236
237         <enum name="VMod">
238                 <item name="15"> <bit>15</bit> </item>
239                 <item name="14"> <bit>14</bit> </item>
240                 <item name="13"> <bit>13</bit> </item>
241                 <item name="12"> <bit>12</bit> </item>
242                 <item name="11"> <bit>11</bit> </item>
243                 <item name="10"> <bit>10</bit> </item>
244                 <item name="9">  <bit>9</bit> </item>
245                 <item name="8">  <bit>8</bit> </item>
246                 <item name="7">  <bit>7</bit> </item>
247                 <item name="6">  <bit>6</bit> </item>
248                 <item name="5">  <bit>5</bit> </item>
249                 <item name="4">  <bit>4</bit> </item>
250                 <item name="3">  <bit>3</bit> </item>
251                 <item name="2">  <bit>2</bit> </item>
252                 <item name="1">  <bit>1</bit> </item>
253                 <item name="0">  <bit>0</bit> </item>
254         </enum>
255
256         <enum name="Explicit">
257                 <item name="VModMap">     <bit>7</bit> </item>
258                 <item name="Behavior">    <bit>6</bit> </item>
259                 <item name="AutoRepeat">  <bit>5</bit> </item>
260                 <item name="Interpret">   <bit>4</bit> </item>
261                 <item name="KeyType4">    <bit>3</bit> </item>
262                 <item name="KeyType3">    <bit>2</bit> </item>
263                 <item name="KeyType2">    <bit>1</bit> </item>
264                 <item name="KeyType1">    <bit>0</bit> </item>
265         </enum>
266
267         <enum name="SymInterpretMatch">
268                 <item name="NoneOf">      <value>0</value> </item>
269                 <item name="AnyOfOrNone"> <value>1</value> </item>
270                 <item name="AnyOf">       <value>2</value> </item>
271                 <item name="AllOf">       <value>3</value> </item>
272                 <item name="Exactly">     <value>4</value> </item>
273         </enum>
274
275         <enum name="SymInterpMatch">
276                 <item name="LevelOneOnly"> <bit>7</bit> </item>
277                 <item name="OpMask">       <value>127</value> </item>   <!--0x7f-->
278         </enum>
279
280         <enum name="IMFlag">
281                 <item name="NoExplicit">  <bit>7</bit> </item>
282                 <item name="NoAutomatic"> <bit>6</bit> </item>
283                 <item name="LEDDrivesKB"> <bit>5</bit> </item>
284         </enum>
285
286         <enum name="IMModsWhich">
287                 <item name="UseCompat">    <bit>4</bit> </item>
288                 <item name="UseEffective"> <bit>3</bit> </item>
289                 <item name="UseLocked">    <bit>2</bit> </item>
290                 <item name="UseLatched">   <bit>1</bit> </item>
291                 <item name="UseBase">      <bit>0</bit> </item>
292         </enum>
293
294         <enum name="IMGroupsWhich">
295                 <item name="UseCompat">    <bit>4</bit> </item>
296                 <item name="UseEffective"> <bit>3</bit> </item>
297                 <item name="UseLocked">    <bit>2</bit> </item>
298                 <item name="UseLatched">   <bit>1</bit> </item>
299                 <item name="UseBase">      <bit>0</bit> </item>
300         </enum>
301
302         <struct name="IndicatorMap">
303                 <field name="flags" type="CARD8" enum="IMFlag" />
304                 <field name="whichGroups" type="CARD8" enum="IMGroupsWhich" />
305                 <field name="groups" type="CARD8" enum="SetOfGroup" />
306                 <field name="whichMods" type="CARD8" enum="IMModsWhich" />
307                 <field name="mods" type="CARD8" mask="ModMask" />
308                 <field name="realMods" type="CARD8" mask="ModMask" />
309                 <field name="vmods" type="CARD16" mask="VMod" />
310                 <field name="ctrls" type="CARD32" mask="BoolCtrl" />
311         </struct>
312
313         <enum name="CMDetail">
314                 <item name="SymInterp">   <bit>0</bit> </item>
315                 <item name="GroupCompat"> <bit>1</bit> </item>
316         </enum>
317
318         <enum name="NameDetail">
319                 <item name="Keycodes">        <bit>0</bit> </item>
320                 <item name="Geometry">        <bit>1</bit> </item>
321                 <item name="Symbols">         <bit>2</bit> </item>
322                 <item name="PhysSymbols">     <bit>3</bit> </item>
323                 <item name="Types">           <bit>4</bit> </item>
324                 <item name="Compat">          <bit>5</bit> </item>
325                 <item name="KeyTypeNames">    <bit>6</bit> </item>
326                 <item name="KTLevelNames">    <bit>7</bit> </item>
327                 <item name="IndicatorNames">  <bit>8</bit> </item>
328                 <item name="KeyNames">        <bit>9</bit> </item>
329                 <item name="KeyAliases">      <bit>10</bit> </item>
330                 <item name="VirtualModNames"> <bit>11</bit> </item>
331                 <item name="GroupNames">      <bit>12</bit> </item>
332                 <item name="RGNames">         <bit>13</bit> </item>
333         </enum>
334
335         <enum name="GBNDetail">
336                 <item name="Types">         <bit>0</bit> </item>
337                 <item name="CompatMap">     <bit>1</bit> </item>
338                 <item name="ClientSymbols"> <bit>2</bit> </item>
339                 <item name="ServerSymbols"> <bit>3</bit> </item>
340                 <item name="IndicatorMaps"> <bit>4</bit> </item>
341                 <item name="KeyNames">      <bit>5</bit> </item>
342                 <item name="Geometry">      <bit>6</bit> </item>
343                 <item name="OtherNames">    <bit>7</bit> </item>
344         </enum>
345
346         <enum name="XIFeature">
347                 <item name="Keyboards">      <bit>0</bit> </item>
348                 <item name="ButtonActions">  <bit>1</bit> </item>
349                 <item name="IndicatorNames"> <bit>2</bit> </item>
350                 <item name="IndicatorMaps">  <bit>3</bit> </item>
351                 <item name="IndicatorState"> <bit>4</bit> </item>
352         </enum>
353
354         <enum name="PerClientFlag">
355                 <item name="DetectableAutoRepeat">   <bit>0</bit> </item>
356                 <item name="GrabsUseXKBState">       <bit>1</bit> </item>
357                 <item name="AutoResetControls">      <bit>2</bit> </item>
358                 <item name="LookupStateWhenGrabbed"> <bit>3</bit> </item>
359                 <item name="SendEventUsesXKBState">  <bit>4</bit> </item>
360         </enum>
361
362         <struct name="ModDef">
363                 <field name="mask" type="CARD8" mask="ModMask" />
364                 <field name="realMods" type="CARD8" mask="ModMask" />
365                 <field name="vmods" type="CARD16" mask="VMod" />
366         </struct>
367
368         <struct name="KeyName">
369                 <list name="name" type="char">
370                         <value>4</value>
371                 </list>
372         </struct>
373
374         <struct name="KeyAlias">
375                 <list name="real" type="char">
376                         <value>4</value>
377                 </list>
378                 <list name="alias" type="char">
379                         <value>4</value>
380                 </list>
381         </struct>
382
383         <struct name="CountedString16">
384                 <field name="length" type="CARD16" />
385                 <list name="string" type="char">
386                         <fieldref>length</fieldref>
387                 </list>
388                 <list type="void" name="alignment_pad">
389                         <op op="-">
390                                 <op op="&amp;">
391                                         <op op="+">
392                                                 <fieldref>length</fieldref>
393                                                 <value>5</value>
394                                         </op>
395                                         <unop op="~">
396                                                 <value>3</value>
397                                         </unop>
398                                 </op>
399                                 <op op="+">
400                                         <fieldref>length</fieldref>
401                                         <value>2</value>
402                                 </op>
403                         </op>
404                 </list>
405         </struct>
406
407         <struct name="KTMapEntry">
408                 <field name="active" type="BOOL" />
409                 <field name="mods_mask" type="CARD8" mask="ModMask" />
410                 <field name="level" type="CARD8" />
411                 <field name="mods_mods" type="CARD8" mask="ModMask" />
412                 <field name="mods_vmods" type="CARD16" mask="VMod" />
413                 <pad bytes="2" />
414         </struct>
415
416         <struct name="KeyType">
417                 <field name="mods_mask" type="CARD8" mask="ModMask" />
418                 <field name="mods_mods" type="CARD8" mask="ModMask" />
419                 <field name="mods_vmods" type="CARD16" mask="VMod" />
420                 <field name="numLevels" type="CARD8" />
421                 <field name="nMapEntries" type="CARD8" />
422                 <field name="hasPreserve" type="BOOL" />
423                 <pad bytes="1" />
424                 <list name="map" type="KTMapEntry">
425                         <fieldref>nMapEntries</fieldref>
426                 </list>
427                 <list name="preserve" type="ModDef">
428                     <op op="*">
429                         <fieldref>hasPreserve</fieldref>
430                         <fieldref>nMapEntries</fieldref>
431                     </op>
432                 </list>
433         </struct>
434
435         <struct name="KeySymMap">
436                 <list name="kt_index" type="CARD8">
437                         <value>4</value>
438                 </list>
439                 <field name="groupInfo" type="CARD8" />
440                 <field name="width" type="CARD8" />
441                 <field name="nSyms" type="CARD16" />
442                 <list name="syms" type="KEYSYM">
443                         <fieldref>nSyms</fieldref>
444                 </list>
445         </struct>
446
447         <!-- Key Behaviors -->
448
449         <struct name="CommonBehavior">
450                 <field name="type" type="CARD8" />
451                 <field name="data" type="CARD8" />
452         </struct>
453
454         <struct name="DefaultBehavior">
455                 <field name="type" type="CARD8" />
456                 <pad bytes="1" />
457         </struct>
458
459         <typedef oldname="DefaultBehavior" newname="LockBehavior" />
460
461         <struct name="RadioGroupBehavior">
462                 <field name="type" type="CARD8" />
463                 <field name="group" type="CARD8" />
464         </struct>
465
466         <struct name="OverlayBehavior">
467                 <field name="type" type="CARD8" />
468                 <field name="key" type="KEYCODE" />
469         </struct>
470
471         <typedef oldname="LockBehavior" newname="PermamentLockBehavior" />
472         <typedef oldname="RadioGroupBehavior" newname="PermamentRadioGroupBehavior" />
473         <typedef oldname="OverlayBehavior" newname="PermamentOverlayBehavior" />
474
475         <union name="Behavior">
476                 <field name="common" type="CommonBehavior" />
477                 <field name="default" type="DefaultBehavior" />
478                 <field name="lock" type="LockBehavior" />
479                 <field name="radioGroup" type="RadioGroupBehavior" />
480                 <field name="overlay1" type="OverlayBehavior" />
481                 <field name="overlay2" type="OverlayBehavior" />
482                 <field name="permamentLock" type="PermamentLockBehavior" />
483                 <field name="permamentRadioGroup" type="PermamentRadioGroupBehavior" />
484                 <field name="permamentOverlay1" type="PermamentOverlayBehavior" />
485                 <field name="permamentOverlay2" type="PermamentOverlayBehavior" />
486                 <field name="type" type="CARD8" />
487         </union>
488
489         <enum name="BehaviorType">
490                 <item name="Default">             <value>0</value> </item>      <!--0x00-->
491                 <item name="Lock">                <value>1</value> </item>      <!--0x01-->
492                 <item name="RadioGroup">          <value>2</value> </item>      <!--0x02-->
493                 <item name="Overlay1">            <value>3</value> </item>      <!--0x03-->
494                 <item name="Overlay2">            <value>4</value> </item>      <!--0x04-->
495                 <item name="PermamentLock">       <value>129</value> </item>    <!--0x81-->
496                 <item name="PermamentRadioGroup"> <value>130</value> </item>    <!--0x82-->
497                 <item name="PermamentOverlay1">   <value>131</value> </item>    <!--0x83-->
498                 <item name="PermamentOverlay2">   <value>132</value> </item>    <!--0x84-->
499         </enum>
500
501         <struct name="SetBehavior">
502                 <field name="keycode" type="KEYCODE" />
503                 <field name="behavior" type="Behavior" />
504                 <pad bytes="1" />
505         </struct>
506
507         <struct name="SetExplicit">
508                 <field name="keycode" type="KEYCODE" />
509                 <field name="explicit" type="CARD8" mask="Explicit" />
510         </struct>
511
512         <struct name="KeyModMap">
513                 <field name="keycode" type="KEYCODE" />
514                 <field name="mods" type="CARD8" mask="ModMask" />
515         </struct>
516
517         <struct name="KeyVModMap">
518                 <field name="keycode" type="KEYCODE" />
519                 <pad bytes="1" />
520                 <field name="vmods" type="CARD16" mask="VMod" />
521         </struct>
522
523         <struct name="KTSetMapEntry">
524                 <field name="level" type="CARD8" />
525                 <field name="realMods" type="CARD8" mask="ModMask" />
526                 <field name="virtualMods" type="CARD16" mask="VMod" />
527         </struct>
528
529         <struct name="SetKeyType">
530                 <field name="mask" type="CARD8" mask="ModMask" />
531                 <field name="realMods" type="CARD8" mask="ModMask" />
532                 <field name="virtualMods" type="CARD16" mask="VMod" />
533                 <field name="numLevels" type="CARD8" />
534                 <field name="nMapEntries" type="CARD8" />
535                 <field name="preserve" type="BOOL" />
536                 <pad bytes="1" />
537                 <list name="entries" type="KTSetMapEntry">
538                         <fieldref>nMapEntries</fieldref>
539                 </list>
540                 <list name="preserve_entries" type="KTSetMapEntry">
541                     <op op = "*">
542                         <fieldref>preserve</fieldref>
543                         <fieldref>nMapEntries</fieldref>
544                     </op>
545                 </list>
546         </struct>
547
548         <typedef oldname="char" newname="STRING8" />
549
550         <struct name="Property">
551                 <field name="nameLength" type="CARD16" />
552                 <list name="name" type="STRING8">
553                         <fieldref>nameLength</fieldref>
554                 </list>
555                 <field name="valueLength" type="CARD16" />
556                 <list name="value" type="STRING8">
557                         <fieldref>valueLength</fieldref>
558                 </list>
559         </struct>
560
561         <struct name="Outline">
562                 <field name="nPoints" type="CARD8" />
563                 <field name="cornerRadius" type="CARD8" />
564                 <pad bytes="2" />
565                 <list name="points" type="POINT">
566                         <fieldref>nPoints</fieldref>
567                 </list>
568         </struct>
569
570         <struct name="Shape">
571                 <field name="name" type="ATOM" />
572                 <field name="nOutlines" type="CARD8" />
573                 <field name="primaryNdx" type="CARD8" />
574                 <field name="approxNdx" type="CARD8" />
575                 <pad bytes="1" />
576                 <list name="outlines" type="Outline">
577                         <fieldref>nOutlines</fieldref>
578                 </list>
579         </struct>
580
581         <struct name="Key">
582                 <list name="name" type="STRING8">
583                         <value>4</value>
584                 </list>
585                 <field name="gap" type="INT16" />
586                 <field name="shapeNdx" type="CARD8" />
587                 <field name="colorNdx" type="CARD8" />
588         </struct>
589
590         <struct name="OverlayKey">
591                 <list name="over" type="STRING8">
592                         <value>4</value>
593                 </list>
594                 <list name="under" type="STRING8">
595                         <value>4</value>
596                 </list>
597         </struct>
598
599         <struct name="OverlayRow">
600                 <field name="rowUnder" type="CARD8" />
601                 <field name="nKeys" type="CARD8" />
602                 <pad bytes="2" />
603                 <list name="keys" type="OverlayKey">
604                         <fieldref>nKeys</fieldref>
605                 </list>
606         </struct>
607
608         <struct name="Overlay">
609                 <field name="name" type="ATOM" />
610                 <field name="nRows" type="CARD8" />
611                 <pad bytes="3" />
612                 <list name="rows" type="OverlayRow">
613                         <fieldref>nRows</fieldref>
614                 </list>
615         </struct>
616
617         <struct name="Row">
618                 <field name="top" type="INT16" />
619                 <field name="left" type="INT16" />
620                 <field name="nKeys" type="CARD8" />
621                 <field name="vertical" type="BOOL" />
622                 <pad bytes="2" />
623                 <list name="keys" type="Key">
624                         <fieldref>nKeys</fieldref>
625                 </list>
626         </struct>
627
628         <enum name="DoodadType">
629                 <item name="Outline">   <value>1</value> </item>
630                 <item name="Solid">     <value>2</value> </item>
631                 <item name="Text">      <value>3</value> </item>
632                 <item name="Indicator"> <value>4</value> </item>
633                 <item name="Logo">      <value>5</value> </item>
634         </enum>
635
636         <!-- XXX: doodads are broken
637         <struct name="CommonDoodad">
638                 <field name="name" type="ATOM" />
639                 <field name="type" type="CARD8" enum="DoodadType" />
640                 <field name="priority" type="CARD8" />
641                 <field name="top" type="INT16" />
642                 <field name="left" type="INT16" />
643                 <field name="angle" type="INT16" />
644                 <pad bytes="8" />
645         </struct>
646
647         <struct name="ShapeDoodad">
648                 <field name="name" type="ATOM" />
649                 <field name="type" type="CARD8" enum="DoodadType" />
650                 <field name="priority" type="CARD8" />
651                 <field name="top" type="INT16" />
652                 <field name="left" type="INT16" />
653                 <field name="angle" type="INT16" />
654                 <field name="colorNdx" type="CARD8" />
655                 <field name="shapeNdx" type="CARD8" />
656                 <pad bytes="6" />
657         </struct>
658
659         <struct name="TextDoodad">
660                 <field name="name" type="ATOM" />
661                 <field name="type" type="CARD8" enum="DoodadType" />
662                 <field name="priority" type="CARD8" />
663                 <field name="top" type="INT16" />
664                 <field name="left" type="INT16" />
665                 <field name="angle" type="INT16" />
666                 <field name="width" type="CARD16" />
667                 <field name="height" type="CARD16" />
668                 <field name="colorNdx" type="CARD8" />
669                 <pad bytes="3" />
670                 <field name="text" type="CountedString16" />
671                 <field name="font" type="CountedString16" />
672         </struct>
673
674         <struct name="IndicatorDoodad">
675                 <field name="name" type="ATOM" />
676                 <field name="type" type="CARD8" enum="DoodadType" />
677                 <field name="priority" type="CARD8" />
678                 <field name="top" type="INT16" />
679                 <field name="left" type="INT16" />
680                 <field name="angle" type="INT16" />
681                 <field name="shapeNdx" type="CARD8" />
682                 <field name="onColorNdx" type="CARD8" />
683                 <field name="offColorNdx" type="CARD8" />
684                 <pad bytes="5" />
685         </struct>
686
687         <struct name="LogoDoodad">
688                 <field name="name" type="ATOM" />
689                 <field name="type" type="CARD8" enum="DoodadType" />
690                 <field name="priority" type="CARD8" />
691                 <field name="top" type="INT16" />
692                 <field name="left" type="INT16" />
693                 <field name="angle" type="INT16" />
694                 <field name="colorNdx" type="CARD8" />
695                 <field name="shapeNdx" type="CARD8" />
696                 <pad bytes="6" />
697                 <field name="logoName" type="CountedString16" />
698         </struct>
699
700         <union name="Doodad">
701                 <field name="common" type="CommonDoodad" />
702                 <field name="shape" type="ShapeDoodad" />
703                 <field name="text" type="TextDoodad" />
704                 <field name="indicator" type="IndicatorDoodad" />
705                 <field name="logo" type="LogoDoodad" />
706         </union>
707
708         <struct name="Section">
709                 <field name="name" type="ATOM" />
710                 <field name="top" type="INT16" />
711                 <field name="left" type="INT16" />
712                 <field name="width" type="CARD16" />
713                 <field name="height" type="CARD16" />
714                 <field name="angle" type="INT16" />
715                 <field name="priority" type="CARD8" />
716                 <field name="nRows" type="CARD8" />
717                 <field name="nDoodads" type="CARD8" />
718                 <field name="nOverlays" type="CARD8" />
719                 <pad bytes="2" />
720                 <list name="rows" type="Row">
721                         <fieldref>nRows</fieldref>
722                 </list>
723                 <list name="doodads" type="Doodad">
724                         <fieldref>nDoodads</fieldref>
725                 </list>
726                 <list name="overlays" type="Overlay">
727                         <fieldref>nOverlays</fieldref>
728                 </list>
729         </struct>
730         -->
731
732         <struct name="Listing">
733                 <field name="flags" type="CARD16" />
734                 <field name="length" type="CARD16" />
735                 <list name="string" type="STRING8">
736                         <fieldref>length</fieldref>
737                 </list>
738         </struct>
739
740         <struct name="DeviceLedInfo">
741                 <field name="ledClass" type="LedClassSpec" enum="LedClass" />
742                 <field name="ledID" type="IDSpec" altenum="ID" />
743                 <field name="namesPresent" type="CARD32" />
744                 <field name="mapsPresent" type="CARD32" />
745                 <field name="physIndicators" type="CARD32" />
746                 <field name="state" type="CARD32" />
747                 <list name="names" type="ATOM">
748                         <popcount>
749                                 <fieldref>namesPresent</fieldref>
750                         </popcount>
751                 </list>
752                 <list name="maps" type="IndicatorMap">
753                         <popcount>
754                                 <fieldref>mapsPresent</fieldref>
755                         </popcount>
756                 </list>
757         </struct>
758
759         <!-- Errors -->
760
761         <enum name="Error">
762                 <item name="BadDevice"> <value>255</value> </item>      <!--0xff-->
763                 <item name="BadClass">  <value>254</value> </item>      <!--0xfe-->
764                 <item name="BadId">     <value>253</value> </item>      <!--0xfd-->
765         </enum>
766
767         <error name="Keyboard" number="0">
768                 <field name="value" type="CARD32" />
769                 <field name="minorOpcode" type="CARD16" />
770                 <field name="majorOpcode" type="CARD8" />
771                 <pad bytes="21" />
772         </error>
773
774         <!-- Key Actions -->
775
776         <enum name="SA">
777                 <item name="ClearLocks">    <bit>0</bit> </item>
778                 <item name="LatchToLock">   <bit>1</bit> </item>
779                 <item name="UseModMapMods"> <bit>2</bit> </item>
780                 <item name="GroupAbsolute"> <bit>2</bit> </item>
781         </enum>
782
783         <enum name="SAType">
784                 <item name="NoAction">       <value>0</value> </item>
785                 <item name="SetMods">        <value>1</value> </item>
786                 <item name="LatchMods">      <value>2</value> </item>
787                 <item name="LockMods">       <value>3</value> </item>
788                 <item name="SetGroup">       <value>4</value> </item>
789                 <item name="LatchGroup">     <value>5</value> </item>
790                 <item name="LockGroup">      <value>6</value> </item>
791                 <item name="MovePtr">        <value>7</value> </item>
792                 <item name="PtrBtn">         <value>8</value> </item>
793                 <item name="LockPtrBtn">     <value>9</value> </item>
794                 <item name="SetPtrDflt">     <value>10</value> </item>
795                 <item name="ISOLock">        <value>11</value> </item>
796                 <item name="Terminate">      <value>12</value> </item>
797                 <item name="SwitchScreen">   <value>13</value> </item>
798                 <item name="SetControls">    <value>14</value> </item>
799                 <item name="LockControls">   <value>15</value> </item>
800                 <item name="ActionMessage">  <value>16</value> </item>
801                 <item name="RedirectKey">    <value>17</value> </item>
802                 <item name="DeviceBtn">      <value>18</value> </item>
803                 <item name="LockDeviceBtn">  <value>19</value> </item>
804                 <item name="DeviceValuator"> <value>20</value> </item>
805         </enum>
806
807         <struct name="SANoAction">
808                 <field name="type" type="CARD8" enum="SAType" />
809                 <pad bytes="7" />
810         </struct>
811
812         <struct name="SASetMods">
813                 <field name="type" type="CARD8" enum="SAType" />
814                 <field name="flags" type="CARD8" mask="SA" />
815                 <field name="mask" type="CARD8" mask="ModMask" />
816                 <field name="realMods" type="CARD8" mask="ModMask" />
817                 <field name="vmodsHigh" type="CARD8" mask="VModsHigh" />
818                 <field name="vmodsLow" type="CARD8" mask="VModsLow" />
819                 <pad bytes="2" />
820         </struct>
821
822         <typedef oldname="SASetMods" newname="SALatchMods" />
823
824         <typedef oldname="SASetMods" newname="SALockMods" />
825
826         <struct name="SASetGroup">
827                 <field name="type" type="CARD8" enum="SAType" />
828                 <field name="flags" type="CARD8" mask="SA" />
829                 <field name="group" type="INT8" />
830                 <pad bytes="5" />
831         </struct>
832
833         <typedef oldname="SASetGroup" newname="SALatchGroup" />
834
835         <typedef oldname="SASetGroup" newname="SALockGroup" />
836
837         <enum name="SAMovePtrFlag">
838                 <item name="NoAcceleration"> <bit>0</bit> </item>
839                 <item name="MoveAbsoluteX">  <bit>1</bit> </item>
840                 <item name="MoveAbsoluteY">  <bit>2</bit> </item>
841         </enum>
842
843         <struct name="SAMovePtr">
844                 <field name="type" type="CARD8" enum="SAType" />
845                 <field name="flags" type="CARD8" mask="SAMovePtrFlag" />
846                 <field name="xHigh" type="INT8" />
847                 <field name="xLow" type="CARD8" />
848                 <field name="yHigh" type="INT8" />
849                 <field name="yLow" type="CARD8" />
850                 <pad bytes="2" />
851         </struct>
852
853         <struct name="SAPtrBtn">
854                 <field name="type" type="CARD8" enum="SAType" />
855                 <field name="flags" type="CARD8" />
856                 <field name="count" type="CARD8" />
857                 <field name="button" type="CARD8" />
858                 <pad bytes="4" />
859         </struct>
860
861         <struct name="SALockPtrBtn">
862                 <field name="type" type="CARD8" enum="SAType" />
863                 <field name="flags" type="CARD8" />
864                 <pad bytes="1" />
865                 <field name="button" type="CARD8" />
866                 <pad bytes="4" />
867         </struct>
868
869         <enum name="SASetPtrDfltFlag">
870                 <!-- The spec says 0x02 but Xlib uses 0x04. -->
871                 <item name="DfltBtnAbsolute">  <bit>2</bit> </item>
872                 <item name="AffectDfltButton"> <bit>0</bit> </item>
873         </enum>
874
875         <struct name="SASetPtrDflt">
876                 <field name="type" type="CARD8" enum="SAType" />
877                 <field name="flags" type="CARD8" mask="SASetPtrDfltFlag" />
878                 <field name="affect" type="CARD8" mask="SASetPtrDfltFlag" />
879                 <field name="value" type="INT8" />
880                 <pad bytes="4" />
881         </struct>
882
883         <enum name="SAIsoLockFlag">
884                 <item name="NoLock">         <bit>0</bit> </item>
885                 <item name="NoUnlock">       <bit>1</bit> </item>
886                 <item name="UseModMapMods">  <bit>2</bit> </item>
887                 <item name="GroupAbsolute">  <bit>2</bit> </item>
888                 <item name="ISODfltIsGroup"> <bit>3</bit> </item>
889         </enum>
890
891         <enum name="SAIsoLockNoAffect">
892                 <item name="Ctrls"> <bit>3</bit> </item>
893                 <item name="Ptr">   <bit>4</bit> </item>
894                 <item name="Group"> <bit>5</bit> </item>
895                 <item name="Mods">  <bit>6</bit> </item>
896         </enum>
897
898         <struct name="SAIsoLock">
899                 <field name="type" type="CARD8" enum="SAType" />
900                 <field name="flags" type="CARD8" mask="SAIsoLockFlag" />
901                 <field name="mask" type="CARD8" mask="ModMask" />
902                 <field name="realMods" type="CARD8" mask="ModMask" />
903                 <field name="group" type="INT8" />
904                 <field name="affect" type="CARD8" mask="SAIsoLockNoAffect" />
905                 <field name="vmodsHigh" type="CARD8" mask="VModsHigh" />
906                 <field name="vmodsLow" type="CARD8" mask="VModsLow" />
907         </struct>
908
909         <struct name="SATerminate">
910                 <field name="type" type="CARD8" enum="SAType" />
911                 <pad bytes="7" />
912         </struct>
913
914         <enum name="SwitchScreenFlag">
915                 <item name="Application"> <bit>0</bit> </item>
916                 <item name="Absolute" >   <bit>2</bit> </item>
917         </enum>
918
919         <struct name="SASwitchScreen">
920                 <field name="type" type="CARD8" enum="SAType" />
921                 <field name="flags" type="CARD8" />
922                 <field name="newScreen" type="INT8" />
923                 <pad bytes="5" />
924         </struct>
925
926         <enum name="BoolCtrlsHigh">
927                 <item name="AccessXFeedback"> <bit>0</bit> </item>
928                 <item name="AudibleBell">     <bit>1</bit> </item>
929                 <item name="Overlay1">        <bit>2</bit> </item>
930                 <item name="Overlay2">        <bit>3</bit> </item>
931                 <item name="IgnoreGroupLock"> <bit>4</bit> </item>
932         </enum>
933
934         <enum name="BoolCtrlsLow">
935                 <item name="RepeatKeys">     <bit>0</bit> </item>
936                 <item name="SlowKeys">       <bit>1</bit> </item>
937                 <item name="BounceKeys">     <bit>2</bit> </item>
938                 <item name="StickyKeys">     <bit>3</bit> </item>
939                 <item name="MouseKeys">      <bit>4</bit> </item>
940                 <item name="MouseKeysAccel"> <bit>5</bit> </item>
941                 <item name="AccessXKeys">    <bit>6</bit> </item>
942                 <item name="AccessXTimeout"> <bit>7</bit> </item>
943         </enum>
944
945         <struct name="SASetControls">
946                 <field name="type" type="CARD8" enum="SAType" />
947                 <pad bytes="3" />
948                 <field name="boolCtrlsHigh" type="CARD8" mask="BoolCtrlsHigh" />
949                 <field name="boolCtrlsLow"  type="CARD8" mask="BoolCtrlsLow" />
950                 <pad bytes="2" />
951         </struct>
952
953         <typedef oldname="SASetControls" newname="SALockControls" />
954
955         <enum name="ActionMessageFlag">
956                 <item name="OnPress">     <bit>0</bit> </item>
957                 <item name="OnRelease">   <bit>1</bit> </item>
958                 <item name="GenKeyEvent"> <bit>2</bit> </item>
959         </enum>
960
961         <struct name="SAActionMessage">
962                 <field name="type" type="CARD8" enum="SAType" />
963                 <field name="flags" type="CARD8" mask="ActionMessageFlag" />
964                 <list name="message" type="CARD8">
965                         <value>6</value>
966                 </list>
967         </struct>
968
969         <struct name="SARedirectKey">
970                 <field name="type" type="CARD8" enum="SAType" />
971                 <field name="newkey" type="KEYCODE" />
972                 <field name="mask" type="CARD8" mask="ModMask" />
973                 <field name="realModifiers" type="CARD8" mask="ModMask" />
974                 <field name="vmodsMaskHigh" type="CARD8" mask="VModsHigh"/>
975                 <field name="vmodsMaskLow" type="CARD8" mask="VModsLow"/>
976                 <field name="vmodsHigh" type="CARD8" mask="VModsHigh"/>
977                 <field name="vmodsLow" type="CARD8" mask="VModsLow"/>
978         </struct>
979
980         <struct name="SADeviceBtn">
981                 <field name="type" type="CARD8" enum="SAType" />
982                 <field name="flags" type="CARD8" />
983                 <field name="count" type="CARD8" />
984                 <field name="button" type="CARD8" />
985                 <field name="device" type="CARD8" />
986                 <pad bytes="3" />
987         </struct>
988
989         <enum name="LockDeviceFlags">
990                 <item name="NoLock">   <bit>0</bit> </item>
991                 <item name="NoUnlock"> <bit>1</bit> </item>
992         </enum>
993
994         <struct name="SALockDeviceBtn">
995                 <field name="type" type="CARD8" enum="SAType" />
996                 <field name="flags" type="CARD8" mask="LockDeviceFlags" />
997                 <pad bytes="1" />
998                 <field name="button" type="CARD8" />
999                 <field name="device" type="CARD8" />
1000                 <pad bytes="3" />
1001         </struct>
1002
1003         <enum name="SAValWhat">
1004                 <item name="IgnoreVal">      <value>0</value> </item>
1005                 <item name="SetValMin">      <value>1</value> </item>
1006                 <item name="SetValCenter">   <value>2</value> </item>
1007                 <item name="SetValMax">      <value>3</value> </item>
1008                 <item name="SetValRelative"> <value>4</value> </item>
1009                 <item name="SetValAbsolute"> <value>5</value> </item>
1010         </enum>
1011
1012         <struct name="SADeviceValuator">
1013                 <field name="type" type="CARD8" enum="SAType" />
1014                 <field name="device" type="CARD8" />
1015                 <field name="val1what" type="CARD8" enum="SAValWhat" />
1016                 <field name="val1index" type="CARD8" />
1017                 <field name="val1value" type="CARD8" />
1018                 <field name="val2what" type="CARD8" enum="SAValWhat" />
1019                 <field name="val2index" type="CARD8" />
1020                 <field name="val2value" type="CARD8" />
1021         </struct>
1022
1023         <struct name="SIAction">
1024                 <field name="type" type="CARD8" enum="SAType" />
1025                 <list name="data" type="CARD8">
1026                         <value>7</value>
1027                 </list>
1028         </struct>
1029
1030         <struct name="SymInterpret">
1031                 <field name="sym" type="KEYSYM" />
1032                 <field name="mods" type="CARD8" mask="ModMask" />
1033                 <!-- "match" may also have XkbSI_LevelOneOnly (0x80) or'd into it -->
1034                 <field name="match" type="CARD8" altenum="SymInterpretMatch" />
1035                 <field name="virtualMod" type="CARD8" mask="VModsLow" />
1036                 <field name="flags" type="CARD8" />
1037                 <field name="action" type="SIAction" />
1038         </struct>
1039
1040         <union name="Action">
1041                 <field name="noaction" type="SANoAction" />
1042                 <field name="setmods" type="SASetMods" />
1043                 <field name="latchmods" type="SALatchMods" />
1044                 <field name="lockmods" type="SALockMods" />
1045                 <field name="setgroup" type="SASetGroup" />
1046                 <field name="latchgroup" type="SALatchGroup" />
1047                 <field name="lockgroup" type="SALockGroup" />
1048                 <field name="moveptr" type="SAMovePtr" />
1049                 <field name="ptrbtn" type="SAPtrBtn" />
1050                 <field name="lockptrbtn" type="SALockPtrBtn" />
1051                 <field name="setptrdflt" type="SASetPtrDflt" />
1052                 <field name="isolock" type="SAIsoLock" />
1053                 <field name="terminate" type="SATerminate" />
1054                 <field name="switchscreen" type="SASwitchScreen" />
1055                 <field name="setcontrols" type="SASetControls" />
1056                 <field name="lockcontrols" type="SALockControls" />
1057                 <field name="message" type="SAActionMessage" />
1058                 <field name="redirect" type="SARedirectKey" />
1059                 <field name="devbtn" type="SADeviceBtn" />
1060                 <field name="lockdevbtn" type="SALockDeviceBtn" />
1061                 <field name="devval" type="SADeviceValuator" />
1062                 <field name="type" type="CARD8" enum="SAType" />
1063         </union>
1064
1065         <!-- Requests -->
1066
1067         <request name="UseExtension" opcode="0">
1068                 <field name="wantedMajor" type="CARD16" />
1069                 <field name="wantedMinor" type="CARD16" />
1070                 <reply>
1071                         <field name="supported" type="BOOL" />
1072                         <field name="serverMajor" type="CARD16" />
1073                         <field name="serverMinor" type="CARD16" />
1074                         <pad bytes="20" />
1075                 </reply>
1076         </request>
1077
1078         <request name="SelectEvents" opcode="1">
1079                 <field name="deviceSpec" type="DeviceSpec" />
1080                 <field name="affectWhich" type="CARD16" mask="EventType" />
1081                 <field name="clear" type="CARD16" mask="EventType" />
1082                 <field name="selectAll" type="CARD16" mask="EventType" />
1083                 <field name="affectMap" type="CARD16" mask="MapPart" />
1084                 <field name="map" type="CARD16" mask="MapPart" />
1085                 <switch name="details">
1086                         <op op="&amp;">
1087                                 <fieldref>affectWhich</fieldref>
1088                                 <op op="&amp;">
1089                                         <unop op="~"><fieldref>clear</fieldref></unop>
1090                                         <unop op="~"><fieldref>selectAll</fieldref></unop>
1091                                 </op>
1092                         </op>
1093                         <bitcase>
1094                                 <enumref ref="EventType">NewKeyboardNotify</enumref>
1095                                 <field name="affectNewKeyboard" type="CARD16" mask="NKNDetail" />
1096                                 <field name="newKeyboardDetails" type="CARD16" mask="NKNDetail" />
1097                         </bitcase>
1098                         <bitcase>
1099                                 <enumref ref="EventType">StateNotify</enumref>
1100                                 <field name="affectState" type="CARD16" mask="StatePart" />
1101                                 <field name="stateDetails" type="CARD16" mask="StatePart" />
1102                         </bitcase>
1103                         <bitcase>
1104                                 <enumref ref="EventType">ControlsNotify</enumref>
1105                                 <field name="affectCtrls" type="CARD32" mask="Control" />
1106                                 <field name="ctrlDetails" type="CARD32" mask="Control" />
1107                         </bitcase>
1108                         <bitcase>
1109                                 <enumref ref="EventType">IndicatorStateNotify</enumref>
1110                                 <field name="affectIndicatorState" type="CARD32" />
1111                                 <field name="indicatorStateDetails" type="CARD32" />
1112                         </bitcase>
1113                         <bitcase>
1114                                 <enumref ref="EventType">IndicatorMapNotify</enumref>
1115                                 <field name="affectIndicatorMap" type="CARD32" />
1116                                 <field name="indicatorMapDetails" type="CARD32" />
1117                         </bitcase>
1118                         <bitcase>
1119                                 <enumref ref="EventType">NamesNotify</enumref>
1120                                 <field name="affectNames" type="CARD16" mask="NameDetail" />
1121                                 <field name="namesDetails" type="CARD16" mask="NameDetail" />
1122                         </bitcase>
1123                         <bitcase>
1124                                 <enumref ref="EventType">CompatMapNotify</enumref>
1125                                 <field name="affectCompat" type="CARD8" mask="CMDetail" />
1126                                 <field name="compatDetails" type="CARD8" mask="CMDetail" />
1127                         </bitcase>
1128                         <bitcase>
1129                                 <enumref ref="EventType">BellNotify</enumref>
1130                                 <field name="affectBell" type="CARD8" />
1131                                 <field name="bellDetails" type="CARD8" />
1132                         </bitcase>
1133                         <bitcase>
1134                                 <enumref ref="EventType">ActionMessage</enumref>
1135                                 <field name="affectMsgDetails" type="CARD8" />
1136                                 <field name="msgDetails" type="CARD8" />
1137                         </bitcase>
1138                         <bitcase>
1139                                 <enumref ref="EventType">AccessXNotify</enumref>
1140                                 <field name="affectAccessX" type="CARD16" mask="AXNDetail" />
1141                                 <field name="accessXDetails" type="CARD16" mask="AXNDetail" />
1142                         </bitcase>
1143                         <bitcase>
1144                                 <enumref ref="EventType">ExtensionDeviceNotify</enumref>
1145                                 <field name="affectExtDev" type="CARD16" mask="XIFeature" />
1146                                 <field name="extdevDetails" type="CARD16" mask="XIFeature" />
1147                         </bitcase>
1148                 </switch>
1149         </request>
1150
1151         <request name="Bell" opcode="3">
1152                 <field name="deviceSpec" type="DeviceSpec" />
1153                 <field name="bellClass" type="BellClassSpec" />
1154                 <field name="bellID" type="IDSpec" />
1155                 <field name="percent" type="INT8" />
1156                 <field name="forceSound" type="BOOL" />
1157                 <field name="eventOnly" type="BOOL" />
1158                 <pad bytes="1" />
1159                 <field name="pitch" type="INT16" />
1160                 <field name="duration" type="INT16" />
1161                 <pad bytes="2" />
1162                 <field name="name" type="ATOM" />
1163                 <field name="window" type="WINDOW" />
1164         </request>
1165
1166         <request name="GetState" opcode="4">
1167                 <field name="deviceSpec" type="DeviceSpec" />
1168                 <pad bytes="2" />
1169                 <reply>
1170                         <field name="deviceID" type="CARD8" />
1171                         <field name="mods" type="CARD8" mask="ModMask" />
1172                         <field name="baseMods" type="CARD8" mask="ModMask" />
1173                         <field name="latchedMods" type="CARD8" mask="ModMask" />
1174                         <field name="lockedMods" type="CARD8" mask="ModMask" />
1175                         <field name="group" type="CARD8" enum="Group" />
1176                         <field name="lockedGroup" type="CARD8" enum="Group" />
1177                         <field name="baseGroup" type="INT16" />
1178                         <field name="latchedGroup" type="INT16" />
1179                         <field name="compatState" type="CARD8" mask="ModMask" />
1180                         <field name="grabMods" type="CARD8" mask="ModMask" />
1181                         <field name="compatGrabMods" type="CARD8" mask="ModMask" />
1182                         <field name="lookupMods" type="CARD8" mask="ModMask" />
1183                         <field name="compatLookupMods" type="CARD8" mask="ModMask" />
1184                         <pad bytes="1" />
1185                         <field name="ptrBtnState" type="CARD16" mask="KeyButMask" />
1186                         <pad bytes="6" />
1187                 </reply>
1188         </request>
1189
1190         <request name="LatchLockState" opcode="5">
1191                 <field name="deviceSpec" type="DeviceSpec" />
1192                 <field name="affectModLocks" type="CARD8" mask="ModMask" />
1193                 <field name="modLocks" type="CARD8" mask="ModMask" />
1194                 <field name="lockGroup" type="BOOL" />
1195                 <field name="groupLock" type="CARD8" enum="Group" />
1196                 <field name="affectModLatches" type="CARD8" mask="ModMask" />
1197                 <pad bytes="1" />
1198                 <field name="latchGroup" type="BOOL" />
1199                 <field name="groupLatch" type="CARD16" />
1200         </request>
1201
1202         <request name="GetControls" opcode="6">
1203                 <field name="deviceSpec" type="DeviceSpec" />
1204                 <pad bytes="2" />
1205                 <reply>
1206                         <field name="deviceID" type="CARD8" />
1207                         <field name="mouseKeysDfltBtn" type="CARD8" />
1208                         <field name="numGroups" type="CARD8" />
1209                         <field name="groupsWrap" type="CARD8" />
1210                         <field name="internalModsMask" type="CARD8" mask="ModMask" />
1211                         <field name="ignoreLockModsMask" type="CARD8" mask="ModMask" />
1212                         <field name="internalModsRealMods" type="CARD8" mask="ModMask" />
1213                         <field name="ignoreLockModsRealMods" type="CARD8" mask="ModMask" />
1214                         <pad bytes="1" />
1215                         <field name="internalModsVmods" type="CARD16" mask="VMod" />
1216                         <field name="ignoreLockModsVmods" type="CARD16" mask="VMod" />
1217                         <field name="repeatDelay" type="CARD16" />
1218                         <field name="repeatInterval" type="CARD16" />
1219                         <field name="slowKeysDelay" type="CARD16" />
1220                         <field name="debounceDelay" type="CARD16" />
1221                         <field name="mouseKeysDelay" type="CARD16" />
1222                         <field name="mouseKeysInterval" type="CARD16" />
1223                         <field name="mouseKeysTimeToMax" type="CARD16" />
1224                         <field name="mouseKeysMaxSpeed" type="CARD16" />
1225                         <field name="mouseKeysCurve" type="INT16" />
1226                         <field name="accessXOption" type="CARD16" mask="AXOption" />
1227                         <field name="accessXTimeout" type="CARD16" />
1228                         <field name="accessXTimeoutOptionsMask" type="CARD16" mask="AXOption" />
1229                         <field name="accessXTimeoutOptionsValues" type="CARD16" mask="AXOption" />
1230                         <pad bytes="2" />
1231                         <field name="accessXTimeoutMask" type="CARD32" mask="BoolCtrl" />
1232                         <field name="accessXTimeoutValues" type="CARD32" mask="BoolCtrl" />
1233                         <field name="enabledControls" type="CARD32" mask="BoolCtrl" />
1234                         <list name="perKeyRepeat" type="CARD8">
1235                                 <value>32</value>
1236                         </list>
1237                 </reply>
1238         </request>
1239
1240         <request name="SetControls" opcode="7">
1241                 <field name="deviceSpec" type="DeviceSpec" />
1242                 <field name="affectInternalRealMods" type="CARD8" mask="ModMask" />
1243                 <field name="internalRealMods" type="CARD8" mask="ModMask" />
1244                 <field name="affectIgnoreLockRealMods" type="CARD8" mask="ModMask" />
1245                 <field name="ignoreLockRealMods" type="CARD8" mask="ModMask" />
1246                 <field name="affectInternalVirtualMods" type="CARD16" mask="VMod" />
1247                 <field name="internalVirtualMods" type="CARD16" mask="VMod" />
1248                 <field name="affectIgnoreLockVirtualMods" type="CARD16" mask="VMod" />
1249                 <field name="ignoreLockVirtualMods" type="CARD16" mask="VMod" />
1250                 <field name="mouseKeysDfltBtn" type="CARD8" />
1251                 <field name="groupsWrap" type="CARD8" />
1252                 <field name="accessXOptions" type="CARD16" mask="AXOption" />
1253                 <pad bytes="2" />
1254                 <field name="affectEnabledControls" type="CARD32" mask="BoolCtrl" />
1255                 <field name="enabledControls" type="CARD32" mask="BoolCtrl" />
1256                 <field name="changeControls" type="CARD32" mask="Control" />
1257                 <field name="repeatDelay" type="CARD16" />
1258                 <field name="repeatInterval" type="CARD16" />
1259                 <field name="slowKeysDelay" type="CARD16" />
1260                 <field name="debounceDelay" type="CARD16" />
1261                 <field name="mouseKeysDelay" type="CARD16" />
1262                 <field name="mouseKeysInterval" type="CARD16" />
1263                 <field name="mouseKeysTimeToMax" type="CARD16" />
1264                 <field name="mouseKeysMaxSpeed" type="CARD16" />
1265                 <field name="mouseKeysCurve" type="INT16" />
1266                 <field name="accessXTimeout" type="CARD16" />
1267                 <field name="accessXTimeoutMask" type="CARD32" mask="BoolCtrl" />
1268                 <field name="accessXTimeoutValues" type="CARD32" mask="BoolCtrl" />
1269                 <field name="accessXTimeoutOptionsMask" type="CARD16" mask="AXOption" />
1270                 <field name="accessXTimeoutOptionsValues" type="CARD16" mask="AXOption" />
1271                 <list name="perKeyRepeat" type="CARD8">
1272                         <value>32</value>
1273                 </list>
1274         </request>
1275
1276         <request name="GetMap" opcode="8">
1277                 <field name="deviceSpec" type="DeviceSpec" />
1278                 <field name="full" type="CARD16" mask="MapPart" />
1279                 <field name="partial" type="CARD16" mask="MapPart" />
1280                 <field name="firstType" type="CARD8" />
1281                 <field name="nTypes" type="CARD8" />
1282                 <field name="firstKeySym" type="KEYCODE" />
1283                 <field name="nKeySyms" type="CARD8" />
1284                 <field name="firstKeyAction" type="KEYCODE" />
1285                 <field name="nKeyActions" type="CARD8" />
1286                 <field name="firstKeyBehavior" type="KEYCODE" />
1287                 <field name="nKeyBehaviors" type="CARD8" />
1288                 <field name="virtualMods" type="CARD16" mask="VMod" />
1289                 <field name="firstKeyExplicit" type="KEYCODE" />
1290                 <field name="nKeyExplicit" type="CARD8" />
1291                 <field name="firstModMapKey" type="KEYCODE" />
1292                 <field name="nModMapKeys" type="CARD8" />
1293                 <field name="firstVModMapKey" type="KEYCODE" />
1294                 <field name="nVModMapKeys" type="CARD8" />
1295                 <pad bytes="2" />
1296                 <reply>
1297                         <field name="deviceID" type="CARD8" />
1298                         <pad bytes="2" />
1299                         <field name="minKeyCode" type="KEYCODE" />
1300                         <field name="maxKeyCode" type="KEYCODE" />
1301                         <field name="present" type="CARD16" mask="MapPart" />
1302                         <field name="firstType" type="CARD8" />
1303                         <field name="nTypes" type="CARD8" />
1304                         <field name="totalTypes" type="CARD8" />
1305                         <field name="firstKeySym" type="KEYCODE" />
1306                         <field name="totalSyms" type="CARD16" />
1307                         <field name="nKeySyms" type="CARD8" />
1308                         <field name="firstKeyAction" type="KEYCODE" />
1309                         <field name="totalActions" type="CARD16" />
1310                         <field name="nKeyActions" type="CARD8" />
1311                         <field name="firstKeyBehavior" type="KEYCODE" />
1312                         <field name="nKeyBehaviors" type="CARD8" />
1313                         <field name="totalKeyBehaviors" type="CARD8" />
1314                         <field name="firstKeyExplicit" type="KEYCODE" />
1315                         <field name="nKeyExplicit" type="CARD8" />
1316                         <field name="totalKeyExplicit" type="CARD8" />
1317                         <field name="firstModMapKey" type="KEYCODE" />
1318                         <field name="nModMapKeys" type="CARD8" />
1319                         <field name="totalModMapKeys" type="CARD8" />
1320                         <field name="firstVModMapKey" type="KEYCODE" />
1321                         <field name="nVModMapKeys" type="CARD8" />
1322                         <field name="totalVModMapKeys" type="CARD8" />
1323                         <pad bytes="1" />
1324                         <field name="virtualMods" type="CARD16" mask="VMod" />
1325                         <switch name="map">
1326                                 <fieldref>present</fieldref>
1327                                 <bitcase>
1328                                         <enumref ref="MapPart">KeyTypes</enumref>
1329                                         <list name="types_rtrn" type="KeyType">
1330                                                 <fieldref>nTypes</fieldref>
1331                                         </list>
1332                                 </bitcase>
1333                                 <bitcase>
1334                                         <enumref ref="MapPart">KeySyms</enumref>
1335                                         <list name="syms_rtrn" type="KeySymMap">
1336                                                 <fieldref>nKeySyms</fieldref>
1337                                         </list>
1338                                 </bitcase>
1339                                 <bitcase>
1340                                         <enumref ref="MapPart">KeyActions</enumref>
1341                                         <list name="acts_rtrn_count" type="CARD8">
1342                                                 <fieldref>nKeyActions</fieldref>
1343                                         </list>
1344                                         <list type="CARD8" name="alignment_pad">
1345                                             <op op="-">
1346                                                 <op op="&amp;">
1347                                                     <op op="+">
1348                                                         <fieldref>nKeyActions</fieldref>
1349                                                         <value>3</value>
1350                                                     </op>
1351                                                     <unop op="~">
1352                                                         <value>3</value>
1353                                                     </unop>
1354                                                 </op>
1355                                                 <fieldref>nKeyActions</fieldref>
1356                                             </op>
1357                                         </list>
1358                                         <list name="acts_rtrn_acts" type="Action">
1359                                                 <fieldref>totalActions</fieldref>
1360                                         </list>
1361                                 </bitcase>
1362                                 <bitcase>
1363                                         <enumref ref="MapPart">KeyBehaviors</enumref>
1364                                         <list name="behaviors_rtrn" type="SetBehavior">
1365                                                 <fieldref>totalKeyBehaviors</fieldref>
1366                                         </list>
1367                                 </bitcase>
1368                                 <bitcase>
1369                                         <enumref ref="MapPart">VirtualMods</enumref>
1370                                         <list name="vmods_rtrn" type="CARD8" mask="ModMask">
1371                                                 <popcount><fieldref>virtualMods</fieldref></popcount>
1372                                         </list>
1373                                         <list type="CARD8" name="alignment_pad2">
1374                                             <op op="-">
1375                                                 <op op="&amp;">
1376                                                     <op op="+">
1377                                                         <popcount><fieldref>virtualMods</fieldref></popcount>
1378                                                         <value>3</value>
1379                                                     </op>
1380                                                     <unop op="~">
1381                                                         <value>3</value>
1382                                                     </unop>
1383                                                 </op>
1384                                                 <popcount><fieldref>virtualMods</fieldref></popcount>
1385                                             </op>
1386                                         </list>
1387                                 </bitcase>
1388                                 <bitcase>
1389                                         <enumref ref="MapPart">ExplicitComponents</enumref>
1390                                         <list name="explicit_rtrn" type="SetExplicit">
1391                                                 <fieldref>totalKeyExplicit</fieldref>
1392                                         </list>
1393                                         <list type="CARD16" name="alignment_pad3">
1394                                             <op op="-">
1395                                                 <op op="&amp;">
1396                                                     <op op="+">
1397                                                         <fieldref>totalKeyExplicit</fieldref>
1398                                                         <value>1</value>
1399                                                     </op>
1400                                                     <unop op="~">
1401                                                         <value>1</value>
1402                                                     </unop>
1403                                                 </op>
1404                                                 <fieldref>totalKeyExplicit</fieldref>
1405                                             </op>
1406                                         </list>
1407                                 </bitcase>
1408                                 <bitcase>
1409                                         <enumref ref="MapPart">ModifierMap</enumref>
1410                                         <list name="modmap_rtrn" type="KeyModMap">
1411                                                 <fieldref>totalModMapKeys</fieldref>
1412                                         </list>
1413                                         <list type="CARD16" name="alignment_pad4">
1414                                             <op op="-">
1415                                                 <op op="&amp;">
1416                                                     <op op="+">
1417                                                         <fieldref>totalModMapKeys</fieldref>
1418                                                         <value>1</value>
1419                                                     </op>
1420                                                     <unop op="~">
1421                                                         <value>1</value>
1422                                                     </unop>
1423                                                 </op>
1424                                                 <fieldref>totalModMapKeys</fieldref>
1425                                             </op>
1426                                         </list>
1427                                 </bitcase>
1428                                 <bitcase>
1429                                         <enumref ref="MapPart">VirtualModMap</enumref>
1430                                         <list name="vmodmap_rtrn" type="KeyVModMap">
1431                                                 <fieldref>totalVModMapKeys</fieldref>
1432                                         </list>
1433                                 </bitcase>
1434                         </switch>
1435                 </reply>
1436         </request>
1437
1438         <request name="SetMap" opcode="9">
1439                 <field name="deviceSpec" type="DeviceSpec" />
1440                 <field name="present" type="CARD16" mask="MapPart" />
1441                 <field name="flags" type="CARD16" mask="SetMapFlags" />
1442                 <field name="minKeyCode" type="KEYCODE" />
1443                 <field name="maxKeyCode" type="KEYCODE" />
1444                 <field name="firstType" type="CARD8" />
1445                 <field name="nTypes" type="CARD8" />
1446                 <field name="firstKeySym" type="KEYCODE" />
1447                 <field name="nKeySyms" type="CARD8" />
1448                 <field name="totalSyms" type="CARD16" />
1449                 <field name="firstKeyAction" type="KEYCODE" />
1450                 <field name="nKeyActions" type="CARD8" />
1451                 <field name="totalActions" type="CARD16" />
1452                 <field name="firstKeyBehavior" type="KEYCODE" />
1453                 <field name="nKeyBehaviors" type="CARD8" />
1454                 <field name="totalKeyBehaviors" type="CARD8" />
1455                 <field name="firstKeyExplicit" type="KEYCODE" />
1456                 <field name="nKeyExplicit" type="CARD8" />
1457                 <field name="totalKeyExplicit" type="CARD8" />
1458                 <field name="firstModMapKey" type="KEYCODE" />
1459                 <field name="nModMapKeys" type="CARD8" />
1460                 <field name="totalModMapKeys" type="CARD8" />
1461                 <field name="firstVModMapKey" type="KEYCODE" />
1462                 <field name="nVModMapKeys" type="CARD8" />
1463                 <field name="totalVModMapKeys" type="CARD8" />
1464                 <field name="virtualMods" type="CARD16" mask="VMod" />
1465                 <switch name="values">
1466                         <fieldref>present</fieldref>
1467                         <bitcase>
1468                                 <enumref ref="MapPart">KeyTypes</enumref>
1469                                 <list name="types" type="SetKeyType">
1470                                         <fieldref>nTypes</fieldref>
1471                                 </list>
1472                         </bitcase>
1473                         <bitcase>
1474                                 <enumref ref="MapPart">KeySyms</enumref>
1475                                 <list name="syms" type="KeySymMap">
1476                                         <fieldref>nKeySyms</fieldref>
1477                                 </list>
1478                         </bitcase>
1479                         <bitcase>
1480                                 <enumref ref="MapPart">KeyActions</enumref>
1481                                 <list name="actionsCount" type="CARD8">
1482                                         <fieldref>nKeyActions</fieldref>
1483                                 </list>
1484                                 <list name="actions" type="Action">
1485                                         <fieldref>totalActions</fieldref>
1486                                 </list>
1487                         </bitcase>
1488                         <bitcase>
1489                                 <enumref ref="MapPart">KeyBehaviors</enumref>
1490                                 <list name="behaviors" type="SetBehavior">
1491                                         <fieldref>totalKeyBehaviors</fieldref>
1492                                 </list>
1493                         </bitcase>
1494                         <bitcase>
1495                                 <enumref ref="MapPart">VirtualMods</enumref>
1496                                 <list name="vmods" type="CARD8">
1497                                         <popcount><fieldref>virtualMods</fieldref></popcount>
1498                                 </list>
1499                         </bitcase>
1500                         <bitcase>
1501                                 <enumref ref="MapPart">ExplicitComponents</enumref>
1502                                 <list name="explicit" type="SetExplicit">
1503                                         <fieldref>totalKeyExplicit</fieldref>
1504                                 </list>
1505                         </bitcase>
1506                         <bitcase>
1507                                 <enumref ref="MapPart">ModifierMap</enumref>
1508                                 <list name="modmap" type="KeyModMap">
1509                                         <fieldref>totalModMapKeys</fieldref>
1510                                 </list>
1511                         </bitcase>
1512                         <bitcase>
1513                                 <enumref ref="MapPart">VirtualModMap</enumref>
1514                                 <list name="vmodmap" type="KeyVModMap">
1515                                         <fieldref>totalVModMapKeys</fieldref>
1516                                 </list>
1517                         </bitcase>
1518                 </switch>
1519         </request>
1520
1521         <request name="GetCompatMap" opcode="10">
1522                 <field name="deviceSpec" type="DeviceSpec" />
1523                 <field name="groups" type="CARD8" mask="SetOfGroup" />
1524                 <field name="getAllSI" type="BOOL" />
1525                 <field name="firstSI" type="CARD16" />
1526                 <field name="nSI" type="CARD16" />
1527                 <reply>
1528                         <field name="deviceID" type="CARD8" />
1529                         <field name="groupsRtrn" type="CARD8" mask="SetOfGroup" />
1530                         <pad bytes="1" />
1531                         <field name="firstSIRtrn" type="CARD16" />
1532                         <field name="nSIRtrn" type="CARD16" />
1533                         <field name="nTotalSI" type="CARD16" />
1534                         <pad bytes="16" />
1535                         <list name="si_rtrn" type="SymInterpret">
1536                                 <fieldref>nSIRtrn</fieldref>
1537                         </list>
1538                         <list name="group_rtrn" type="ModDef">
1539                                 <popcount>
1540                                         <fieldref>groupsRtrn</fieldref>
1541                                 </popcount>
1542                         </list>
1543                 </reply>
1544         </request>
1545
1546         <request name="SetCompatMap" opcode="11">
1547                 <field name="deviceSpec" type="DeviceSpec" />
1548                 <pad bytes="1" />
1549                 <field name="recomputeActions" type="BOOL" />
1550                 <field name="truncateSI" type="BOOL" />
1551                 <field name="groups" type="CARD8" mask="SetOfGroup" />
1552                 <field name="firstSI" type="CARD16" />
1553                 <field name="nSI" type="CARD16" />
1554                 <pad bytes="2"/>
1555                 <list name="si" type="SymInterpret">
1556                         <fieldref>nSI</fieldref>
1557                 </list>
1558                 <list name="groupMaps" type="ModDef">
1559                         <popcount>
1560                                 <fieldref>groups</fieldref>
1561                         </popcount>
1562                 </list>
1563         </request>
1564
1565         <request name="GetIndicatorState" opcode="12">
1566                 <field name="deviceSpec" type="DeviceSpec" />
1567                 <pad bytes="2" />
1568                 <reply>
1569                         <field name="deviceID" type="CARD8" />
1570                         <field name="state" type="CARD32" />
1571                         <pad bytes="20" />
1572                 </reply>
1573         </request>
1574
1575         <request name="GetIndicatorMap" opcode="13">
1576                 <field name="deviceSpec" type="DeviceSpec" />
1577                 <pad bytes="2" />
1578                 <field name="which" type="CARD32" />
1579                 <reply>
1580                         <field name="deviceID" type="CARD8" />
1581                         <field name="which" type="CARD32" />
1582                         <field name="realIndicators" type="CARD32" />
1583                         <field name="nIndicators" type="CARD8" />
1584                         <pad bytes="15" />
1585                         <list name="maps" type="IndicatorMap">
1586                                 <popcount><fieldref>which</fieldref></popcount>
1587                         </list>
1588                 </reply>
1589         </request>
1590
1591         <request name="SetIndicatorMap" opcode="14">
1592                 <field name="deviceSpec" type="DeviceSpec" />
1593                 <pad bytes="2" />
1594                 <field name="which" type="CARD32" />
1595                 <list name="maps" type="IndicatorMap">
1596                         <popcount>
1597                                 <fieldref>which</fieldref>
1598                         </popcount>
1599                 </list>
1600         </request>
1601
1602         <request name="GetNamedIndicator" opcode="15">
1603                 <field name="deviceSpec" type="DeviceSpec" />
1604                 <field name="ledClass" type="LedClassSpec" enum="LedClass" />
1605                 <field name="ledID" type="IDSpec" altenum="ID" />
1606                 <pad bytes="2" />
1607                 <field name="indicator" type="ATOM" />
1608                 <reply>
1609                         <field name="deviceID" type="CARD8" />
1610                         <field name="indicator" type="ATOM" />
1611                         <field name="found" type="BOOL" />
1612                         <field name="on" type="BOOL" />
1613                         <field name="realIndicator" type="BOOL" />
1614                         <field name="ndx" type="CARD8" />
1615                         <field name="map_flags" type="CARD8" mask="IMFlag" />
1616                         <field name="map_whichGroups" type="CARD8" mask="IMGroupsWhich" />
1617                         <field name="map_groups" type="CARD8" mask="SetOfGroups" />
1618                         <field name="map_whichMods" type="CARD8" mask="IMModsWhich" />
1619                         <field name="map_mods" type="CARD8" mask="ModMask" />
1620                         <field name="map_realMods" type="CARD8" mask="ModMask" />
1621                         <field name="map_vmod" type="CARD16" mask="VMod" />
1622                         <field name="map_ctrls" type="CARD32" mask="BoolCtrl" />
1623                         <field name="supported" type="BOOL" />
1624                         <pad bytes="3" />
1625                 </reply>
1626         </request>
1627
1628         <request name="SetNamedIndicator" opcode="16" >
1629                 <field name="deviceSpec" type="DeviceSpec" />
1630                 <field name="ledClass" type="LedClassSpec" enum="LedClass" />
1631                 <field name="ledID" type="IDSpec" altenum="ID" />
1632                 <pad bytes="2" />
1633                 <field name="indicator" type="ATOM" />
1634                 <field name="setState" type="BOOL" />
1635                 <field name="on" type="BOOL" />
1636                 <field name="setMap" type="BOOL" />
1637                 <field name="createMap" type="BOOL" />
1638                 <pad bytes="1" />
1639                 <field name="map_flags" type="CARD8" mask="IMFlag" />
1640                 <field name="map_whichGroups" type="CARD8" mask="IMGroupsWhich" />
1641                 <field name="map_groups" type="CARD8" mask="SetOfGroups" />
1642                 <field name="map_whichMods" type="CARD8" mask="IMModsWhich" />
1643                 <field name="map_realMods" type="CARD8" mask="ModMask" />
1644                 <field name="map_vmods" type="CARD16" mask="VMod" />
1645                 <field name="map_ctrls" type="CARD32" mask="BoolCtrl" />
1646         </request>
1647
1648         <request name="GetNames" opcode="17">
1649                 <field name="deviceSpec" type="DeviceSpec" />
1650                 <pad bytes="2" />
1651                 <field name="which" type="CARD32" mask="NameDetail" />
1652                 <reply>
1653                         <field name="deviceID" type="CARD8" />
1654                         <field name="which" type="CARD32" mask="NameDetail" />
1655                         <field name="minKeyCode" type="KEYCODE" />
1656                         <field name="maxKeyCode" type="KEYCODE" />
1657                         <field name="nTypes" type="CARD8" />
1658                         <field name="groupNames" type="CARD8" mask="SetOfGroup" />
1659                         <field name="virtualMods" type="CARD16" mask="VMod" />
1660                         <field name="firstKey" type="KEYCODE" />
1661                         <field name="nKeys" type="CARD8" />
1662                         <field name="indicators" type="CARD32" />
1663                         <field name="nRadioGroups" type="CARD8" />
1664                         <field name="nKeyAliases" type="CARD8" />
1665                         <field name="nKTLevels" type="CARD16" />
1666                         <pad bytes="4" />
1667                         <switch name="valueList">
1668                                 <fieldref>which</fieldref>
1669                                 <bitcase>
1670                                         <enumref ref="NameDetail">Keycodes</enumref>
1671                                         <field name="keycodesName" type="ATOM" />
1672                                 </bitcase>
1673                                 <bitcase>
1674                                         <enumref ref="NameDetail">Geometry</enumref>
1675                                         <field name="geometryName" type="ATOM" />
1676                                 </bitcase>
1677                                 <bitcase>
1678                                         <enumref ref="NameDetail">Symbols</enumref>
1679                                         <field name="symbolsName" type="ATOM" />
1680                                 </bitcase>
1681                                 <bitcase>
1682                                         <enumref ref="NameDetail">PhysSymbols</enumref>
1683                                         <field name="physSymbolsName" type="ATOM" />
1684                                 </bitcase>
1685                                 <bitcase>
1686                                         <enumref ref="NameDetail">Types</enumref>
1687                                         <field name="typesName" type="ATOM" />
1688                                 </bitcase>
1689                                 <bitcase>
1690                                         <enumref ref="NameDetail">Compat</enumref>
1691                                         <field name="compatName" type="ATOM" />
1692                                 </bitcase>
1693                                 <bitcase>
1694                                         <enumref ref="NameDetail">KeyTypeNames</enumref>
1695                                         <list name="typeNames" type="ATOM">
1696                                                 <fieldref>nTypes</fieldref>
1697                                         </list>
1698                                 </bitcase>
1699                                 <bitcase>
1700                                         <enumref ref="NameDetail">KTLevelNames</enumref>
1701                                         <list name="nLevelsPerType" type="CARD8">
1702                                           <!-- Xlib uses NTypes here - 
1703                                                the spec says nKTLevels is correct, but
1704                                                it does not work in reality
1705                                                <fieldref>nKTLevels</fieldref> -->
1706                                                 <fieldref>nTypes</fieldref>
1707                                         </list>
1708                                         <list type="CARD8" name="alignment_pad">
1709                                             <op op="-">
1710                                                 <op op="&amp;">
1711                                                     <op op="+">
1712                                                         <fieldref>nTypes</fieldref>
1713                                                         <value>3</value>
1714                                                     </op>
1715                                                     <unop op="~">
1716                                                         <value>3</value>
1717                                                     </unop>
1718                                                 </op>
1719                                                 <fieldref>nTypes</fieldref>
1720                                             </op>
1721                                         </list>
1722                                         <list name="ktLevelNames" type="ATOM">
1723                                                 <sumof ref="nLevelsPerType" />
1724                                         </list>
1725                                 </bitcase>
1726                                 <bitcase>
1727                                         <enumref ref="NameDetail">IndicatorNames</enumref>
1728                                         <list name="indicatorNames" type="ATOM">
1729                                                 <popcount>
1730                                                         <fieldref>indicators</fieldref>
1731                                                 </popcount>
1732                                         </list>
1733                                 </bitcase>
1734                                 <bitcase>
1735                                         <enumref ref="NameDetail">VirtualModNames</enumref>
1736                                         <list name="virtualModNames" type="ATOM">
1737                                                 <popcount>
1738                                                         <fieldref>virtualMods</fieldref>
1739                                                 </popcount>
1740                                         </list>
1741                                 </bitcase>
1742                                 <bitcase>
1743                                         <enumref ref="NameDetail">GroupNames</enumref>
1744                                         <list name="groups" type="ATOM">
1745                                                 <popcount>
1746                                                         <fieldref>groupNames</fieldref>
1747                                                 </popcount>
1748                                         </list>
1749                                 </bitcase>
1750                                 <bitcase>
1751                                         <enumref ref="NameDetail">KeyNames</enumref>
1752                                         <list name="keyNames" type="KeyName">
1753                                                 <fieldref>nKeys</fieldref>
1754                                         </list>
1755                                 </bitcase>
1756                                 <bitcase>
1757                                         <enumref ref="NameDetail">KeyAliases</enumref>
1758                                         <list name="keyAliases" type="KeyAlias">
1759                                                 <fieldref>nKeyAliases</fieldref>
1760                                         </list>
1761                                 </bitcase>
1762                                 <bitcase>
1763                                         <enumref ref="NameDetail">RGNames</enumref>
1764                                         <list name="radioGroupNames" type="ATOM">
1765                                                 <fieldref>nRadioGroups</fieldref>
1766                                         </list>
1767                                 </bitcase>
1768                         </switch>
1769                 </reply>
1770         </request>
1771
1772         <request name="SetNames" opcode="18">
1773                 <field name="deviceSpec" type="DeviceSpec" />
1774                 <field name="virtualMods" type="CARD16" mask="VMod" />
1775                 <field name="which" type="CARD32" mask="NameDetail" />
1776                 <field name="firstType" type="CARD8" />
1777                 <field name="nTypes" type="CARD8" />
1778                 <field name="firstKTLevelt" type="CARD8" />
1779                 <field name="nKTLevels" type="CARD8" />
1780                 <field name="indicators" type="CARD32" />
1781                 <field name="groupNames" type="CARD8" mask="SetOfGroup" />
1782                 <field name="nRadioGroups" type="CARD8" />
1783                 <field name="firstKey" type="KEYCODE" />
1784                 <field name="nKeys" type="CARD8" />
1785                 <field name="nKeyAliases" type="CARD8"/>
1786                 <pad bytes="1" />
1787                 <field name="totalKTLevelNames" type="CARD16" />
1788                 <switch name="values">
1789                         <fieldref>which</fieldref>
1790                         <bitcase>
1791                                 <enumref ref="NameDetail">Keycodes</enumref>
1792                                 <field name="keycodesName" type="ATOM" />
1793                         </bitcase>
1794                         <bitcase>
1795                                 <enumref ref="NameDetail">Geometry</enumref>
1796                                 <field name="geometryName" type="ATOM" />
1797                         </bitcase>
1798                         <bitcase>
1799                                 <enumref ref="NameDetail">Symbols</enumref>
1800                                 <field name="symbolsName" type="ATOM" />
1801                         </bitcase>
1802                         <bitcase>
1803                                 <enumref ref="NameDetail">PhysSymbols</enumref>
1804                                 <field name="physSymbolsName" type="ATOM" />
1805                         </bitcase>
1806                         <bitcase>
1807                                 <enumref ref="NameDetail">Types</enumref>
1808                                 <field name="typesName" type="ATOM" />
1809                         </bitcase>
1810                         <bitcase>
1811                                 <enumref ref="NameDetail">Compat</enumref>
1812                                 <field name="compatName" type="ATOM" />
1813                         </bitcase>
1814                         <bitcase>
1815                                 <enumref ref="NameDetail">KeyTypeNames</enumref>
1816                                 <list name="typeNames" type="ATOM">
1817                                         <fieldref>nTypes</fieldref>
1818                                 </list>
1819                         </bitcase>
1820                         <bitcase>
1821                                 <enumref ref="NameDetail">KTLevelNames</enumref>
1822                                 <list name="nLevelsPerType" type="CARD8">
1823                                         <fieldref>nKTLevels</fieldref>
1824                                 </list>
1825                                 <list name="ktLevelNames" type="ATOM">
1826                                         <sumof ref="nLevelsPerType" />
1827                                 </list>
1828                         </bitcase>
1829                         <bitcase>
1830                                 <enumref ref="NameDetail">IndicatorNames</enumref>
1831                                 <list name="indicatorNames" type="ATOM">
1832                                         <popcount>
1833                                                 <fieldref>indicators</fieldref>
1834                                         </popcount>
1835                                 </list>
1836                         </bitcase>
1837                         <bitcase>
1838                                 <enumref ref="NameDetail">VirtualModNames</enumref>
1839                                 <list name="virtualModNames" type="ATOM">
1840                                         <popcount>
1841                                                 <fieldref>virtualMods</fieldref>
1842                                         </popcount>
1843                                 </list>
1844                         </bitcase>
1845                         <bitcase>
1846                                 <enumref ref="NameDetail">GroupNames</enumref>
1847                                 <list name="groups" type="ATOM">
1848                                         <popcount>
1849                                                 <fieldref>groupNames</fieldref>
1850                                         </popcount>
1851                                 </list>
1852                         </bitcase>
1853                         <bitcase>
1854                                 <enumref ref="NameDetail">KeyNames</enumref>
1855                                 <list name="keyNames" type="KeyName">
1856                                         <fieldref>nKeys</fieldref>
1857                                 </list>
1858                         </bitcase>
1859                         <bitcase>
1860                                 <enumref ref="NameDetail">KeyAliases</enumref>
1861                                 <list name="keyAliases" type="KeyAlias">
1862                                         <fieldref>nKeyAliases</fieldref>
1863                                 </list>
1864                         </bitcase>
1865                         <bitcase>
1866                                 <enumref ref="NameDetail">RGNames</enumref>
1867                                 <list name="radioGroupNames" type="ATOM">
1868                                         <fieldref>nRadioGroups</fieldref>
1869                                 </list>
1870                         </bitcase>
1871                 </switch>
1872         </request>
1873
1874         <request name="GetGeometry" opcode="19">
1875                 <field name="deviceSpec" type="DeviceSpec" />
1876                 <pad bytes="2" />
1877                 <field name="name" type="ATOM" />
1878                 <reply>
1879                         <field name="deviceID" type="CARD8" />
1880                         <field name="name" type="ATOM" />
1881                         <field name="found" type="BOOL" />
1882                         <pad bytes="1" />
1883                         <field name="widthMM" type="CARD16" />
1884                         <field name="heightMM" type="CARD16" />
1885                         <field name="nProperties" type="CARD16" />
1886                         <field name="nColors" type="CARD16" />
1887                         <field name="nShapes" type="CARD16" />
1888                         <field name="nSections" type="CARD16" />
1889                         <field name="nDoodads" type="CARD16" />
1890                         <field name="nKeyAliases" type="CARD16" />
1891                         <field name="baseColorNdx" type="CARD8" />
1892                         <field name="labelColorNdx" type="CARD8" />
1893                         <field name="labelFont" type="CountedString16" />
1894                         <list name="properties" type="Property">
1895                                 <fieldref>nProperties</fieldref>
1896                         </list>
1897                         <list name="colors" type="CountedString16">
1898                                 <fieldref>nColors</fieldref>
1899                         </list>
1900                         <list name="shapes" type="Shape">
1901                                 <fieldref>nShapes</fieldref>
1902                         </list>
1903                         <!-- XXX: doodads are broken
1904                         <list name="sections" type="Section">
1905                                 <fieldref>nSections</fieldref>
1906                         </list>
1907                         <list name="doodads" type="Doodad">
1908                                 <fieldref>nDoodads</fieldref>
1909                         </list>
1910                         <list name="keyAliases" type="KeyAlias">
1911                                 <fieldref>nKeyAliases</fieldref>
1912                         </list>
1913                         -->
1914                 </reply>
1915         </request>
1916
1917         <request name="SetGeometry" opcode="20">
1918                 <field name="deviceSpec" type="DeviceSpec" />
1919                 <field name="nShapes" type="CARD8" />
1920                 <field name="nSections" type="CARD8" />
1921                 <field name="name" type="ATOM" />
1922                 <field name="widthMM" type="CARD16" />
1923                 <field name="heightMM" type="CARD16" />
1924                 <field name="nProperties" type="CARD16" />
1925                 <field name="nColors" type="CARD16" />
1926                 <field name="nDoodads" type="CARD16" />
1927                 <field name="nKeyAliases" type="CARD16" />
1928                 <field name="baseColorNdx" type="CARD8" />
1929                 <field name="labelColorNdx" type="CARD8" />
1930                 <pad bytes="2" />
1931                 <field name="labelFont" type="CountedString16" />
1932                 <list name="properties" type="Property">
1933                         <fieldref>nProperties</fieldref>
1934                 </list>
1935                 <list name="colors" type="CountedString16">
1936                         <fieldref>nColors</fieldref>
1937                 </list>
1938                 <list name="shapes" type="Shape">
1939                         <fieldref>nShapes</fieldref>
1940                 </list>
1941                 <!-- XXX: doodads are broken
1942                 <list name="sections" type="Section">
1943                         <fieldref>nSections</fieldref>
1944                 </list>
1945                 <list name="doodads" type="Doodad">
1946                         <fieldref>nDoodads</fieldref>
1947                 </list>
1948                 <list name="keyAliases" type="KeyAlias">
1949                         <fieldref>nKeyAliases</fieldref>
1950                 </list>
1951                 -->
1952         </request>
1953
1954         <request name="PerClientFlags" opcode="21">
1955                 <field name="deviceSpec" type="DeviceSpec" />
1956                 <pad bytes="2" />
1957                 <field name="change" type="CARD32" mask="PerClientFlag" />
1958                 <field name="value" type="CARD32" mask="PerClientFlag" />
1959                 <field name="ctrlsToChange" type="CARD32" mask="BoolCtrl" />
1960                 <field name="autoCtrls" type="CARD32" mask="BoolCtrl" />
1961                 <field name="autoCtrlsValues" type="CARD32" mask="BoolCtrl" />
1962                 <reply>
1963                         <field name="deviceID" type="CARD8"/>
1964                         <field name="supported" type="CARD32" mask="PerClientFlag" />
1965                         <field name="value" type="CARD32" mask="PerClientFlag" />
1966                         <field name="autoCtrls" type="CARD32" mask="BoolCtrl" />
1967                         <field name="autoCtrlsValues" type="CARD32" mask="BoolCtrl" />
1968                         <pad bytes="8" />
1969                 </reply>
1970         </request>
1971
1972         <request name="ListComponents" opcode="22">
1973                 <field name="deviceSpec" type="DeviceSpec" />
1974                 <field name="maxNames" type="CARD16" />
1975                 <field name="keymapsSpecLen" type="CARD8" />
1976                 <list name="keymapsSpec" type="STRING8">
1977                         <fieldref>keymapsSpecLen</fieldref>
1978                 </list>
1979                 <field name="keycodesSpecLen" type="CARD8" />
1980                 <list name="keycodesSpec" type="STRING8">
1981                         <fieldref>keycodesSpecLen</fieldref>
1982                 </list>
1983                 <field name="typesSpecLen" type="CARD8" />
1984                 <list name="typesSpec" type="STRING8">
1985                         <fieldref>typesSpecLen</fieldref>
1986                 </list>
1987                 <field name="compatMapSpecLen" type="CARD8" />
1988                 <list name="compatMapSpec" type="STRING8">
1989                         <fieldref>compatMapSpecLen</fieldref>
1990                 </list>
1991                 <field name="symbolsSpecLen" type="CARD8" />
1992                 <list name="symbolsSpec" type="STRING8">
1993                         <fieldref>symbolsSpecLen</fieldref>
1994                 </list>
1995                 <field name="geometrySpecLen" type="CARD8" />
1996                 <list name="geometrySpec" type="STRING8">
1997                         <fieldref>geometrySpecLen</fieldref>
1998                 </list>
1999                 <reply>
2000                         <field name="deviceID" type="CARD8" />
2001                         <field name="nKeymaps" type="CARD16" />
2002                         <field name="nKeycodes" type="CARD16" />
2003                         <field name="nTypes" type="CARD16" />
2004                         <field name="nCompatMaps" type="CARD16" />
2005                         <field name="nSymbols" type="CARD16" />
2006                         <field name="nGeometries" type="CARD16" />
2007                         <field name="extra" type="CARD16" />
2008                         <pad bytes="10" />
2009                         <list name="keymaps" type="Listing">
2010                                 <fieldref>nKeymaps</fieldref>
2011                         </list>
2012                         <list name="keycodes" type="Listing">
2013                                 <fieldref>nKeycodes</fieldref>
2014                         </list>
2015                         <list name="types" type="Listing">
2016                                 <fieldref>nTypes</fieldref>
2017                         </list>
2018                         <list name="compatMaps" type="Listing">
2019                                 <fieldref>nCompatMaps</fieldref>
2020                         </list>
2021                         <list name="symbols" type="Listing">
2022                                 <fieldref>nSymbols</fieldref>
2023                         </list>
2024                         <list name="geometries" type="Listing">
2025                                 <fieldref>nGeometries</fieldref>
2026                         </list>
2027                 </reply>
2028         </request>
2029
2030         <request name="GetKbdByName" opcode="23">
2031                 <field name="deviceSpec" type="DeviceSpec" />
2032                 <field name="need" type="CARD16" mask="GBNDetail" />
2033                 <field name="want" type="CARD16" mask="GBNDetail" />
2034                 <field name="load" type="BOOL" />
2035                 <pad bytes="1" />
2036                 <field name="keymapsSpecLen" type="CARD8" />
2037                 <list name="keymapsSpec" type="STRING8">
2038                         <fieldref>keymapsSpecLen</fieldref>
2039                 </list>
2040                 <field name="keycodesSpecLen" type="CARD8" />
2041                 <list name="keycodesSpec" type="STRING8">
2042                         <fieldref>keycodesSpecLen</fieldref>
2043                 </list>
2044                 <field name="typesSpecLen" type="CARD8" />
2045                 <list name="typesSpec" type="STRING8">
2046                         <fieldref>typesSpecLen</fieldref>
2047                 </list>
2048                 <field name="compatMapSpecLen" type="CARD8" />
2049                 <list name="compatMapSpec" type="STRING8">
2050                         <fieldref>compatMapSpecLen</fieldref>
2051                 </list>
2052                 <field name="symbolsSpecLen" type="CARD8" />
2053                 <list name="symbolsSpec" type="STRING8">
2054                         <fieldref>symbolsSpecLen</fieldref>
2055                 </list>
2056                 <field name="geometrySpecLen" type="CARD8" />
2057                 <list name="geometrySpec" type="STRING8">
2058                         <fieldref>geometrySpecLen</fieldref>
2059                 </list>
2060                 <reply>
2061                         <field name="deviceID" type="CARD8" />
2062                         <field name="minKeyCode" type="KEYCODE" />
2063                         <field name="maxKeyCode" type="KEYCODE" />
2064                         <field name="loaded" type="BOOL" />
2065                         <field name="newKeyboard" type="BOOL" />
2066                         <field name="found" type="CARD16" mask="GBNDetail" />
2067                         <field name="reported" type="CARD16" mask="GBNDetail" />
2068                         <pad bytes="16" />
2069                         <switch name="replies">
2070                                 <fieldref>reported</fieldref>
2071                                 <bitcase name="types">
2072                                         <enumref ref="GBNDetail">Types</enumref>
2073                                         <enumref ref="GBNDetail">ClientSymbols</enumref>
2074                                         <enumref ref="GBNDetail">ServerSymbols</enumref>
2075                                         <!-- from the spec, this has to be a GetMap reply -->
2076                                         <field name="getmap_type" type="CARD8" />
2077                                         <!-- done 'emulating' GetMap reply header-->
2078                                         <field name="typeDeviceID" type="CARD8" />
2079                                         <!-- from the spec, this has to be a GetMap reply -->
2080                                         <field name="getmap_sequence" type="CARD16" />
2081                                         <field name="getmap_length" type="CARD32" />
2082                                         <!-- done 'emulating' GetMap reply header-->
2083                                         <pad bytes="2" />
2084                                         <field name="typeMinKeyCode" type="KEYCODE" />
2085                                         <field name="typeMaxKeyCode" type="KEYCODE" />
2086                                         <field name="present" type="CARD16" mask="MapPart" />
2087                                         <field name="firstType" type="CARD8" />
2088                                         <field name="nTypes" type="CARD8" />
2089                                         <field name="totalTypes" type="CARD8" />
2090                                         <field name="firstKeySym" type="KEYCODE" />
2091                                         <field name="totalSyms" type="CARD16" />
2092                                         <field name="nKeySyms" type="CARD8" />
2093                                         <field name="firstKeyAction" type="KEYCODE" />
2094                                         <field name="totalActions" type="CARD16" />
2095                                         <field name="nKeyActions" type="CARD8" />
2096                                         <field name="firstKeyBehavior" type="KEYCODE" />
2097                                         <field name="nKeyBehaviors" type="CARD8" />
2098                                         <field name="totalKeyBehaviors" type="CARD8" />
2099                                         <field name="firstKeyExplicit" type="KEYCODE" />
2100                                         <field name="nKeyExplicit" type="CARD8" />
2101                                         <field name="totalKeyExplicit" type="CARD8" />
2102                                         <field name="firstModMapKey" type="KEYCODE" />
2103                                         <field name="nModMapKeys" type="CARD8" />
2104                                         <field name="totalModMapKeys" type="CARD8" />
2105                                         <field name="firstVModMapKey" type="KEYCODE" />
2106                                         <field name="nVModMapKeys" type="CARD8" />
2107                                         <field name="totalVModMapKeys" type="CARD8" />
2108                                         <pad bytes="1" />
2109                                         <field name="virtualMods" type="CARD16" mask="VMod" />
2110                                         <switch name="map">
2111                                                 <fieldref>present</fieldref>
2112                                                 <bitcase>
2113                                                         <enumref ref="MapPart">KeyTypes</enumref>
2114                                                         <list name="types_rtrn" type="KeyType">
2115                                                                 <fieldref>nTypes</fieldref>
2116                                                         </list>
2117                                                 </bitcase>
2118                                                 <bitcase>
2119                                                         <enumref ref="MapPart">KeySyms</enumref>
2120                                                         <list name="syms_rtrn" type="KeySymMap">
2121                                                                 <fieldref>nKeySyms</fieldref>
2122                                                         </list>
2123                                                 </bitcase>
2124                                                 <bitcase>
2125                                                         <enumref ref="MapPart">KeyActions</enumref>
2126                                                         <list name="acts_rtrn_count" type="CARD8">
2127                                                                 <fieldref>nKeyActions</fieldref>
2128                                                         </list>
2129                                                         <list name="acts_rtrn_acts" type="Action">
2130                                                                 <fieldref>totalActions</fieldref>
2131                                                         </list>
2132                                                 </bitcase>
2133                                                 <bitcase>
2134                                                         <enumref ref="MapPart">KeyBehaviors</enumref>
2135                                                         <list name="behaviors_rtrn" type="SetBehavior">
2136                                                                 <fieldref>totalKeyBehaviors</fieldref>
2137                                                         </list>
2138                                                 </bitcase>
2139                                                 <bitcase>
2140                                                         <enumref ref="MapPart">VirtualMods</enumref>
2141                                                         <list name="vmods_rtrn" type="CARD8" mask="ModMask">
2142                                                                 <popcount><fieldref>virtualMods</fieldref></popcount>
2143                                                         </list>
2144                                                 </bitcase>
2145                                                 <bitcase>
2146                                                         <enumref ref="MapPart">ExplicitComponents</enumref>
2147                                                         <list name="explicit_rtrn" type="SetExplicit">
2148                                                                 <fieldref>totalKeyExplicit</fieldref>
2149                                                         </list>
2150                                                 </bitcase>
2151                                                 <bitcase>
2152                                                         <enumref ref="MapPart">ModifierMap</enumref>
2153                                                         <list name="modmap_rtrn" type="KeyModMap">
2154                                                                 <fieldref>totalModMapKeys</fieldref>
2155                                                         </list>
2156                                                 </bitcase>
2157                                                 <bitcase>
2158                                                         <enumref ref="MapPart">VirtualModMap</enumref>
2159                                                         <list name="vmodmap_rtrn" type="KeyVModMap">
2160                                                                 <fieldref>totalVModMapKeys</fieldref>
2161                                                         </list>
2162                                                 </bitcase>
2163                                         </switch>
2164                                 </bitcase>
2165                                 <bitcase name="compat_map">
2166                                         <enumref ref="GBNDetail">CompatMap</enumref>
2167                                         <!-- from the spec, this has to include a reply header -->
2168                                         <field name="compatmap_type" type="CARD8" />
2169                                         <field name="compatDeviceID" type="CARD8" />
2170                                         <field name="compatmap_sequence" type="CARD16" />
2171                                         <field name="compatmap_length" type="CARD32" />
2172                                         <!-- done 'emulating' reply header -->
2173                                         <field name="groupsRtrn" type="CARD8" mask="SetOfGroup" />
2174                                         <pad bytes="1" />
2175                                         <field name="firstSIRtrn" type="CARD16" />
2176                                         <field name="nSIRtrn" type="CARD16" />
2177                                         <field name="nTotalSI" type="CARD16" />
2178                                         <pad bytes="16" />
2179                                         <list name="si_rtrn" type="SymInterpret">
2180                                                 <fieldref>nSIRtrn</fieldref>
2181                                         </list>
2182                                         <list name="group_rtrn" type="ModDef">
2183                                                 <popcount>
2184                                                         <fieldref>groupsRtrn</fieldref>
2185                                                 </popcount>
2186                                         </list>
2187                                 </bitcase>
2188                                 <bitcase name="indicator_maps">
2189                                         <enumref ref="GBNDetail">IndicatorMaps</enumref>
2190                                         <!-- from the spec, this has to include a reply header -->
2191                                         <field name="indicatormap_type" type="CARD8" />
2192                                         <field name="indicatorDeviceID" type="CARD8" />
2193                                         <field name="indicatormap_sequence" type="CARD16" />
2194                                         <field name="indicatormap_length" type="CARD32" />
2195                                         <!-- done 'emulating' reply header -->
2196                                         <field name="which" type="CARD32" />
2197                                         <field name="realIndicators" type="CARD32" />
2198                                         <field name="nIndicators" type="CARD8" />
2199                                         <pad bytes="15" />
2200                                         <list name="maps" type="IndicatorMap">
2201                                                 <fieldref>nIndicators</fieldref>
2202                                         </list>
2203                                 </bitcase>
2204                                 <bitcase name="key_names">
2205                                         <enumref ref="GBNDetail">KeyNames</enumref>
2206                                         <enumref ref="GBNDetail">OtherNames</enumref>
2207                                         <!-- from the spec, this has to include a reply header -->
2208                                         <field name="keyname_type" type="CARD8" />
2209                                         <field name="keyDeviceID" type="CARD8" />
2210                                         <field name="keyname_sequence" type="CARD16" />
2211                                         <field name="keyname_length" type="CARD32" />
2212                                         <!-- done 'emulating' reply header -->
2213                                         <field name="which" type="CARD32" mask="NameDetail" />
2214                                         <field name="keyMinKeyCode" type="KEYCODE" />
2215                                         <field name="keyMaxKeyCode" type="KEYCODE" />
2216                                         <field name="nTypes" type="CARD8" />
2217                                         <field name="groupNames" type="CARD8" mask="SetOfGroup" />
2218                                         <field name="virtualMods" type="CARD16" mask="VMod" />
2219                                         <field name="firstKey" type="KEYCODE" />
2220                                         <field name="nKeys" type="CARD8" />
2221                                         <field name="indicators" type="CARD32" />
2222                                         <field name="nRadioGroups" type="CARD8" />
2223                                         <field name="nKeyAliases" type="CARD8" />
2224                                         <field name="nKTLevels" type="CARD16" />
2225                                         <pad bytes="4" />
2226                                         <switch name="valueList">
2227                                                 <fieldref>which</fieldref>
2228                                                 <bitcase>
2229                                                         <enumref ref="NameDetail">Keycodes</enumref>
2230                                                         <field name="keycodesName" type="ATOM" />
2231                                                 </bitcase>
2232                                                 <bitcase>
2233                                                         <enumref ref="NameDetail">Geometry</enumref>
2234                                                         <field name="geometryName" type="ATOM" />
2235                                                 </bitcase>
2236                                                 <bitcase>
2237                                                         <enumref ref="NameDetail">Symbols</enumref>
2238                                                         <field name="symbolsName" type="ATOM" />
2239                                                 </bitcase>
2240                                                 <bitcase>
2241                                                         <enumref ref="NameDetail">PhysSymbols</enumref>
2242                                                         <field name="physSymbolsName" type="ATOM" />
2243                                                 </bitcase>
2244                                                 <bitcase>
2245                                                         <enumref ref="NameDetail">Types</enumref>
2246                                                         <field name="typesName" type="ATOM" />
2247                                                 </bitcase>
2248                                                 <bitcase>
2249                                                         <enumref ref="NameDetail">Compat</enumref>
2250                                                         <field name="compatName" type="ATOM" />
2251                                                 </bitcase>
2252                                                 <bitcase>
2253                                                         <enumref ref="NameDetail">KeyTypeNames</enumref>
2254                                                         <list name="typeNames" type="ATOM">
2255                                                                 <fieldref>nTypes</fieldref>
2256                                                         </list>
2257                                                 </bitcase>
2258                                                 <bitcase>
2259                                                         <enumref ref="NameDetail">KTLevelNames</enumref>
2260                                                         <list name="nLevelsPerType" type="CARD8">
2261                                                                 <fieldref>nKTLevels</fieldref>
2262                                                         </list>
2263                                                         <list name="ktLevelNames" type="ATOM">
2264                                                                 <sumof ref="nLevelsPerType" />
2265                                                         </list>
2266                                                 </bitcase>
2267                                                 <bitcase>
2268                                                         <enumref ref="NameDetail">IndicatorNames</enumref>
2269                                                         <list name="indicatorNames" type="ATOM">
2270                                                                 <popcount>
2271                                                                         <fieldref>indicators</fieldref>
2272                                                                 </popcount>
2273                                                         </list>
2274                                                 </bitcase>
2275                                                 <bitcase>
2276                                                         <enumref ref="NameDetail">VirtualModNames</enumref>
2277                                                         <list name="virtualModNames" type="ATOM">
2278                                                                 <popcount>
2279                                                                         <fieldref>virtualMods</fieldref>
2280                                                                 </popcount>
2281                                                         </list>
2282                                                 </bitcase>
2283                                                 <bitcase>
2284                                                         <enumref ref="NameDetail">GroupNames</enumref>
2285                                                         <list name="groups" type="ATOM">
2286                                                                 <popcount>
2287                                                                         <fieldref>groupNames</fieldref>
2288                                                                 </popcount>
2289                                                         </list>
2290                                                 </bitcase>
2291                                                 <bitcase>
2292                                                         <enumref ref="NameDetail">KeyNames</enumref>
2293                                                         <list name="keyNames" type="KeyName">
2294                                                                 <fieldref>nKeys</fieldref>
2295                                                         </list>
2296                                                 </bitcase>
2297                                                 <bitcase>
2298                                                         <enumref ref="NameDetail">KeyAliases</enumref>
2299                                                         <list name="keyAliases" type="KeyAlias">
2300                                                                 <fieldref>nKeyAliases</fieldref>
2301                                                         </list>
2302                                                 </bitcase>
2303                                                 <bitcase>
2304                                                         <enumref ref="NameDetail">RGNames</enumref>
2305                                                         <list name="radioGroupNames" type="ATOM">
2306                                                                 <fieldref>nRadioGroups</fieldref>
2307                                                         </list>
2308                                                 </bitcase>
2309                                         </switch>
2310                                 </bitcase>
2311                                 <bitcase name="geometry">
2312                                         <enumref ref="GBNDetail">Geometry</enumref>
2313                                         <!-- from the spec, this has to include a reply header -->
2314                                         <field name="geometry_type" type="CARD8" />
2315                                         <field name="geometryDeviceID" type="CARD8" />
2316                                         <field name="geometry_sequence" type="CARD16" />
2317                                         <field name="geometry_length" type="CARD32" />
2318                                         <!-- done 'emulating' reply header -->
2319                                         <field name="name" type="ATOM" />
2320                                         <field name="geometryFound" type="BOOL" />
2321                                         <pad bytes="1" />
2322                                         <field name="widthMM" type="CARD16" />
2323                                         <field name="heightMM" type="CARD16" />
2324                                         <field name="nProperties" type="CARD16" />
2325                                         <field name="nColors" type="CARD16" />
2326                                         <field name="nShapes" type="CARD16" />
2327                                         <field name="nSections" type="CARD16" />
2328                                         <field name="nDoodads" type="CARD16" />
2329                                         <field name="nKeyAliases" type="CARD16" />
2330                                         <field name="baseColorNdx" type="CARD8" />
2331                                         <field name="labelColorNdx" type="CARD8" />
2332                                         <field name="labelFont" type="CountedString16" />
2333                                         <list name="properties" type="Property">
2334                                                 <fieldref>nProperties</fieldref>
2335                                         </list>
2336                                         <list name="colors" type="CountedString16">
2337                                                 <fieldref>nColors</fieldref>
2338                                         </list>
2339                                         <list name="shapes" type="Shape">
2340                                                 <fieldref>nShapes</fieldref>
2341                                         </list>
2342                                         <!-- XXX: doodads are broken
2343                                         <list name="sections" type="Section">
2344                                                 <fieldref>nSections</fieldref>
2345                                         </list>
2346                                         <list name="doodads" type="Doodad">
2347                                                 <fieldref>nDoodads</fieldref>
2348                                         </list>
2349                                         <list name="keyAliases" type="KeyAlias">
2350                                                 <fieldref>nKeyAliases</fieldref>
2351                                         </list>
2352                                         -->
2353                                 </bitcase>
2354                         </switch>
2355                 </reply>
2356         </request>
2357
2358         <request name="GetDeviceInfo" opcode="24">
2359                 <field name="deviceSpec" type="DeviceSpec" />
2360                 <field name="wanted" type="CARD16" mask="XIFeature" />
2361                 <field name="allButtons" type="BOOL" />
2362                 <field name="firstButton" type="CARD8" />
2363                 <field name="nButtons" type="CARD8" />
2364                 <pad bytes="1" />
2365                 <field name="ledClass" type="LedClassSpec" enum="LedClass" />
2366                 <field name="ledID" type="IDSpec" altenum="ID" />
2367                 <reply>
2368                         <field name="deviceID" type="CARD8" />
2369                         <field name="present" type="CARD16" mask="XIFeature" />
2370                         <field name="supported" type="CARD16" mask="XIFeature" />
2371                         <field name="unsupported" type="CARD16" mask="XIFeature" />
2372                         <field name="nDeviceLedFBs" type="CARD16" />
2373                         <field name="firstBtnWanted" type="CARD8" />
2374                         <field name="nBtnsWanted" type="CARD8" />
2375                         <field name="firstBtnRtrn" type="CARD8" />
2376                         <field name="nBtnsRtrn" type="CARD8" />
2377                         <field name="totalBtns" type="CARD8" />
2378                         <field name="hasOwnState" type="BOOL" />
2379                         <field name="dfltKbdFB" type="CARD16" altenum="ID" />
2380                         <field name="dfltLedFB" type="CARD16" altenum="ID" />
2381                         <pad bytes="2" />
2382                         <field name="devType" type="ATOM" />
2383                         <field name="nameLen" type="CARD16" />
2384                         <list name="name" type="STRING8">
2385                                 <fieldref>nameLen</fieldref>
2386                         </list>
2387                         <list name="btnActions" type="Action">
2388                                 <fieldref>nBtnsRtrn</fieldref>
2389                         </list>
2390                         <list name="leds" type="DeviceLedInfo">
2391                                 <fieldref>nDeviceLedFBs</fieldref>
2392                         </list>
2393                 </reply>
2394         </request>
2395
2396
2397         <request name="SetDeviceInfo" opcode="25">
2398                 <field name="deviceSpec" type="DeviceSpec" />
2399                 <field name="firstBtn" type="CARD8" />
2400                 <field name="nBtns" type="CARD8" />
2401                 <field name="change" type="CARD16" mask="XIFeature" />
2402                 <field name="nDeviceLedFBs" type="CARD16" />
2403                 <list name="btnActions" type="Action">
2404                         <fieldref>nBtns</fieldref>
2405                 </list>
2406                 <list name="leds" type="DeviceLedInfo">
2407                         <fieldref>nDeviceLedFBs</fieldref>
2408                 </list>
2409         </request>
2410
2411         <request name="SetDebuggingFlags" opcode="101">
2412                 <field name="msgLength" type="CARD16" />
2413                 <pad bytes="2" />
2414                 <field name="affectFlags" type="CARD32" />
2415                 <field name="flags" type="CARD32" />
2416                 <field name="affectCtrls" type="CARD32" />
2417                 <field name="ctrls" type="CARD32" />
2418                 <list name="message" type="STRING8">
2419                         <fieldref>msgLength</fieldref>
2420                 </list>
2421                 <reply>
2422                         <pad bytes="1" />
2423                         <field name="currentFlags" type="CARD32" />
2424                         <field name="currentCtrls" type="CARD32" />
2425                         <field name="supportedFlags" type="CARD32" />
2426                         <field name="supportedCtrls" type="CARD32" />
2427                         <pad bytes="8" />
2428                 </reply>
2429         </request>
2430
2431         <!-- Events -->
2432
2433         <event name="NewKeyboardNotify" number="0">
2434                 <field name="xkbType" type="CARD8" />
2435                 <field name="time" type="TIMESTAMP" />
2436                 <field name="deviceID" type="CARD8" />
2437                 <field name="oldDeviceID" type="CARD8" />
2438                 <field name="minKeyCode" type="KEYCODE" />
2439                 <field name="maxKeyCode" type="KEYCODE" />
2440                 <field name="oldMinKeyCode" type="KEYCODE" />
2441                 <field name="oldMaxKeyCode" type="KEYCODE" />
2442                 <field name="requestMajor" type="CARD8" />
2443                 <field name="requestMinor" type="CARD8" />
2444                 <field name="changed" type="CARD16" mask="NKNDetail" />
2445                 <pad bytes="14" />
2446         </event>
2447
2448         <event name="MapNotify" number="1">
2449                 <field name="xkbType" type="CARD8" />
2450                 <field name="time" type="TIMESTAMP" />
2451                 <field name="deviceID" type="CARD8" />
2452                 <field name="ptrBtnActions" type="CARD8" />
2453                 <field name="changed" type="CARD16" mask="MapPart" />
2454                 <field name="minKeyCode" type="KEYCODE" />
2455                 <field name="maxKeyCode" type="KEYCODE" />
2456                 <field name="firstType" type="CARD8" />
2457                 <field name="nTypes" type="CARD8" />
2458                 <field name="firstKeySym" type="KEYCODE" />
2459                 <field name="nKeySyms" type="CARD8" />
2460                 <field name="firstKeyAct" type="KEYCODE" />
2461                 <field name="nKeyActs" type="CARD8" />
2462                 <field name="firstKeyBehavior" type="KEYCODE" />
2463                 <field name="nKeyBehavior" type="CARD8" />
2464                 <field name="firstKeyExplicit" type="KEYCODE" />
2465                 <field name="nKeyExplicit" type="CARD8" />
2466                 <field name="firstModMapKey" type="KEYCODE" />
2467                 <field name="nModMapKeys" type="CARD8" />
2468                 <field name="firstVModMapKey" type="KEYCODE" />
2469                 <field name="nVModMapKeys" type="CARD8" />
2470                 <field name="virtualMods" type="CARD16" mask="VMod" />
2471                 <pad bytes="2" />
2472         </event>
2473
2474         <event name="StateNotify" number="2">
2475                 <field name="xkbType" type="CARD8" />
2476                 <field name="time" type="TIMESTAMP" />
2477                 <field name="deviceID" type="CARD8" />
2478                 <field name="mods" type="CARD8" mask="ModMask" />
2479                 <field name="baseMods" type="CARD8" mask="ModMask" />
2480                 <field name="latchedMods" type="CARD8" mask="ModMask" />
2481                 <field name="lockedMods" type="CARD8" mask="ModMask" />
2482                 <field name="group" type="CARD8" enum="Group" />
2483                 <field name="baseGroup" type="INT16" />
2484                 <field name="latchedGroup" type="INT16" />
2485                 <field name="lockedGroup" type="CARD8" enum="Group" />
2486                 <field name="compatState" type="CARD8" mask="ModMask" />
2487                 <field name="grabMods" type="CARD8" mask="ModMask" />
2488                 <field name="compatGrabMods" type="CARD8" mask="ModMask" />
2489                 <field name="lookupMods" type="CARD8" mask="ModMask" />
2490                 <field name="compatLoockupMods" type="CARD8" mask="ModMask" />
2491                 <field name="ptrBtnState" type="CARD16" mask="KeyButMask" />
2492                 <field name="changed" type="CARD16" mask="StatePart" />
2493                 <field name="keycode" type="KEYCODE" />
2494                 <field name="eventType" type="CARD8" />
2495                 <field name="requestMajor" type="CARD8" />
2496                 <field name="requestMinor" type="CARD8" />
2497         </event>
2498
2499         <event name="ControlsNotify" number="3">
2500                 <field name="xkbType" type="CARD8" />
2501                 <field name="time" type="TIMESTAMP" />
2502                 <field name="deviceID" type="CARD8" />
2503                 <field name="numGroups" type="CARD8" />
2504                 <pad bytes="2" />
2505                 <field name="changedControls" type="CARD32" mask="Control" />
2506                 <field name="enabledControls" type="CARD32" mask="BoolCtrl" />
2507                 <field name="enabledControlChanges" type="CARD32" mask="BoolCtrl" />
2508                 <field name="keycode" type="KEYCODE" />
2509                 <field name="eventType" type="CARD8" />
2510                 <field name="requestMajor" type="CARD8" />
2511                 <field name="requestMinor" type="CARD8" />
2512                 <pad bytes="4" />
2513         </event>
2514
2515         <event name="IndicatorStateNotify" number="4">
2516                 <field name="xkbType" type="CARD8" />
2517                 <field name="time" type="TIMESTAMP" />
2518                 <field name="deviceID" type="CARD8" />
2519                 <pad bytes="3" />
2520                 <field name="state" type="CARD32" />
2521                 <field name="stateChanged" type="CARD32" />
2522                 <pad bytes="12" />
2523         </event>
2524
2525         <event name="IndicatorMapNotify" number="5">
2526                 <field name="xkbType" type="CARD8" />
2527                 <field name="time" type="TIMESTAMP" />
2528                 <field name="deviceID" type="CARD8" />
2529                 <pad bytes="3" />
2530                 <field name="state" type="CARD32" />
2531                 <field name="mapChanged" type="CARD32" />
2532                 <pad bytes="12" />
2533         </event>
2534
2535         <event name="NamesNotify" number="6">
2536                 <field name="xkbType" type="CARD8" />
2537                 <field name="time" type="TIMESTAMP" />
2538                 <field name="deviceID" type="CARD8" />
2539                 <pad bytes="1" />
2540                 <field name="changed" type="CARD16" mask="NameDetail" />
2541                 <field name="firstType" type="CARD8" />
2542                 <field name="nTypes" type="CARD8" />
2543                 <field name="firstLevelName" type="CARD8" />
2544                 <field name="nLevelNames" type="CARD8" />
2545                 <pad bytes="1" />
2546                 <field name="nRadioGroups" type="CARD8" />
2547                 <field name="nKeyAliases" type="CARD8" />
2548                 <field name="changedGroupNames" type="CARD8" mask="SetOfGroup" />
2549                 <field name="changedVirtualMods" type="CARD16" mask="VMod" />
2550                 <field name="firstKey" type="KEYCODE" />
2551                 <field name="nKeys" type="CARD8" />
2552                 <field name="changedIndicators" type="CARD32" />
2553                 <pad bytes="4" />
2554         </event>
2555
2556         <event name="CompatMapNotify" number="7">
2557                 <field name="xkbType" type="CARD8" />
2558                 <field name="time" type="TIMESTAMP" />
2559                 <field name="deviceID" type="CARD8" />
2560                 <field name="changedGroups" type="CARD8" mask="SetOfGroup" />
2561                 <field name="firstSI" type="CARD16" />
2562                 <field name="nSI" type="CARD16" />
2563                 <field name="nTotalSI" type="CARD16" />
2564                 <pad bytes="16" />
2565         </event>
2566
2567         <event name="BellNotify" number="8">
2568                 <field name="xkbType" type="CARD8" />
2569                 <field name="time" type="TIMESTAMP" />
2570                 <field name="deviceID" type="CARD8" />
2571                 <field name="bellClass" type="CARD8" enum="BellClassResult" />
2572                 <field name="bellID" type="CARD8" />
2573                 <field name="percent" type="CARD8" />
2574                 <field name="pitch" type="CARD16" />
2575                 <field name="duration" type="CARD16" />
2576                 <field name="name" type="ATOM" />
2577                 <field name="window" type="WINDOW" />
2578                 <field name="eventOnly" type="BOOL" />
2579                 <pad bytes="7" />
2580         </event>
2581
2582         <event name="ActionMessage" number="9">
2583                 <field name="xkbType" type="CARD8" />
2584                 <field name="time" type="TIMESTAMP" />
2585                 <field name="deviceID" type="CARD8" />
2586                 <field name="keycode" type="KEYCODE" />
2587                 <field name="press" type="BOOL" />
2588                 <field name="keyEventFollows" type="BOOL" />
2589                 <field name="mods" type="CARD8" mask="ModMask" />
2590                 <field name="group" type="CARD8" enum="Group" />
2591                 <list name="message" type="STRING8">
2592                         <value>8</value>
2593                 </list>
2594                 <pad bytes="10" />
2595         </event>
2596
2597         <event name="AccessXNotify" number="10">
2598                 <field name="xkbType" type="CARD8" />
2599                 <field name="time" type="TIMESTAMP" />
2600                 <field name="deviceID" type="CARD8" />
2601                 <field name="keycode" type="KEYCODE" />
2602                 <field name="detailt" type="CARD16" mask="AXNDetail" />
2603                 <field name="slowKeysDelay" type="CARD16" />
2604                 <field name="debounceDelay" type="CARD16" />
2605                 <pad bytes="16" />
2606         </event>
2607
2608         <event name="ExtensionDeviceNotify" number="11">
2609                 <field name="xkbType" type="CARD8" />
2610                 <field name="time" type="TIMESTAMP" />
2611                 <field name="deviceID" type="CARD8" />
2612                 <pad bytes="1" />
2613                 <field name="reason" type="CARD16" mask="XIFeature" />
2614                 <field name="ledClass" type="CARD16" enum="LedClassResult" />
2615                 <field name="ledID" type="CARD16" />
2616                 <field name="ledsDefined" type="CARD32" />
2617                 <field name="ledState" type="CARD32" />
2618                 <field name="firstButton" type="CARD8" />
2619                 <field name="nButtons" type="CARD8" />
2620                 <field name="supported" type="CARD16" mask="XIFeature" />
2621                 <field name="unsupported" type="CARD16" mask="XIFeature" />
2622                 <pad bytes="2" />
2623         </event>
2624 </xcb>