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