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