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