1<appendix id="Input_Extension_Protocol_Encoding">
2<title>Input Extension Protocol Encoding</title>
3<para>
4<function>Syntactic Conventions</function>
5</para>
6<para>
7<!-- .LP -->
8All numbers are in decimal, 
9unless prefixed with #x, in which case they are in hexadecimal (base 16).
10</para>
11<para>
12<!-- .LP -->
13The general syntax used to describe requests, replies, errors, events, and
14compound types is:
15</para>
16<para>
17<!-- .LP -->
18<literallayout class="monospaced">
19<function>NameofThing</function>
20  encode-form
21  ...
22  encode-form
23</literallayout>
24Each encode-form describes a single component.
25</para>
26<para>
27<!-- .LP -->
28For components described in the protocol as:
29</para>
30<para>
31<!-- .LP -->
32<literallayout class="monospaced">
33name: TYPE
34</literallayout>
35the encode-form is:
36</para>
37<para>
38<!-- .LP -->
39<literallayout class="monospaced">
40<!-- .TA 1i 1.5i 2.5i -->
41<!-- .ta 1i 1.5i 2.5i -->
42N	TYPE	name
43</literallayout>
44N is the number of bytes occupied in the data stream, 
45and TYPE is the interpretation of those bytes.
46For example,
47</para>
48<para>
49<!-- .LP -->
50<literallayout class="monospaced">
51<!-- .TA 1i 1.5i -->
52<!-- .ta 1i 1.5i -->
53depth: CARD8
54</literallayout>
55becomes:
56</para>
57<para>
58<!-- .LP -->
59<literallayout class="monospaced">
60<!-- .TA 1i 1.5i 2.5i  -->
61<!-- .ta 1i 1.5i 2.5i -->
621	CARD8	depth
63</literallayout>
64For components with a static numeric value the encode-form is:
65</para>
66<para>
67<!-- .LP -->
68<literallayout class="monospaced">
69<!-- .TA 1i 1.5i 2.5i -->
70<!-- .ta 1i 1.5i 2.5i -->
71N	value	name
72</literallayout>
73The value is always interpreted as an N-byte unsigned integer.
74For example, 
75the first two bytes of a Window error are always zero (indicating an
76error in general) and three (indicating the Window error in particular):
77</para>
78<para>
79<!-- .LP -->
80<literallayout class="monospaced">
81<!-- .TA 1i 1.5i 2.5i -->
82<!-- .ta 1i 1.5i 2.5i -->
831	0	Error
841	3	code
85</literallayout>
86For components described in the protocol as:
87</para>
88<para>
89<!-- .LP -->
90<literallayout class="monospaced">
91name: <function>{Name1, ..., NameI}</function>
92</literallayout>
93</para>
94<para>
95<!-- .LP -->
96the encode-form is:
97</para>
98<para>
99<!-- .LP -->
100<literallayout class="monospaced">
101<!-- .TA 1i 1.5i 2.5i -->
102<!-- .ta 1i 1.5i 2.5i -->
103N		name
104	value1 Name1
105	...
106	valueI NameI
107</literallayout>
108The value is always interpreted as an N-byte unsigned integer.
109Note that the size of N is sometimes larger than that strictly required 
110to encode the values.
111For example:
112</para>
113<para>
114<!-- .LP -->
115<literallayout class="monospaced">
116class: <function>{InputOutput, InputOnly, CopyFromParent}</function>
117</literallayout>
118</para>
119<para>
120<!-- .LP -->
121becomes:
122</para>
123<para>
124<!-- .LP -->
125<literallayout class="monospaced">
126<!-- .TA 1i 1.5i 2.5i 3i -->
127<!-- .ta 1i 1.5i 2.5i 3i -->
1282			class
129	0	CopyFromParent
130	1	InputOutput
131	2	InputOnly
132</literallayout>
133For components described in the protocol as:
134</para>
135<para>
136<!-- .LP -->
137<literallayout class="monospaced">
138NAME: TYPE or <function>Alternative1 ... or AlternativeI</function>
139</literallayout>
140</para>
141<para>
142<!-- .LP -->
143the encode-form is:
144</para>
145<para>
146<!-- .LP -->
147<literallayout class="monospaced">
148<!-- .TA 1i 1.5i 2i 2.5i 3i -->
149<!-- .ta 1i 1.5i 2i 2.5i 3i -->
150N	TYPE			NAME
151	value1	Alternative1
152	...
153	valueI	AlternativeI
154</literallayout>
155The alternative values are guaranteed not to conflict with the encoding
156of TYPE.  
157For example:
158</para>
159<para>
160<!-- .LP -->
161<literallayout class="monospaced">
162destination: WINDOW or <function>PointerWindow</function> or <function>InputFocus</function>
163</literallayout>
164</para>
165<para>
166<!-- .LP -->
167becomes:
168</para>
169<para>
170<!-- .LP -->
171<literallayout class="monospaced">
172<!-- .TA 1i 1.5i 2.5i -->
173<!-- .ta 1i 1.5i 2.5i -->
1744	WINDOW		destination
175	0	PointerWindow
176	1	InputFocus
177</literallayout>
178For components described in the protocol as:
179</para>
180<para>
181<!-- .LP -->
182<literallayout class="monospaced">
183<!-- .TA 1i 1.5i -->
184<!-- .ta 1i 1.5i -->
185value-mask: BITMASK
186</literallayout>
187the encode-form is:
188</para>
189<para>
190<!-- .LP -->
191<literallayout class="monospaced">
192<!-- .TA 1i 1.5i 2i 2.5i  -->
193<!-- .ta 1i 1.5i 2i 2.5i -->
194N	BITMASK			value-mask
195	mask1	mask-name1
196	...
197	maskI	mask-nameI
198</literallayout>
199The individual bits in the mask are specified and named, 
200and N is 2 or 4.
201The most-significant bit in a BITMASK is reserved for use in defining
202chained (multiword) bitmasks, as extensions augment existing core requests.
203The precise interpretation of this bit is not yet defined here, 
204although a probable mechanism is that a 1-bit indicates that another N bytes 
205of bitmask follows, with bits within the overall mask still interpreted 
206from least-significant to most-significant with an N-byte unit, with N-byte units 
207interpreted in stream order, and with the overall mask being byte-swapped 
208in individual N-byte units.
209</para>
210<para>
211<!-- .LP -->
212For LISTofVALUE encodings, the request is followed by a section of the form:
213</para>
214<para>
215<!-- .LP -->
216<literallayout class="monospaced">
217<!-- .TA 1i 1.5i -->
218<!-- .ta 1i 1.5i -->
219VALUEs
220 encode-form
221 ...
222 encode-form
223</literallayout>
224listing an encode-form for each VALUE.
225The NAME in each encode-form keys to the corresponding BITMASK bit.
226The encoding of a VALUE always occupies four bytes, 
227but the number of bytes specified in the encoding-form indicates how
228many of the least-significant bytes are actually used; 
229the remaining bytes are unused and their values do not matter.
230</para>
231<para>
232<!-- .LP -->
233In various cases, the number of bytes occupied by a component will be specified
234by a lowercase single-letter variable name instead of a specific numeric
235value, and often some other component will have its value specified as a
236simple numeric expression involving these variables.
237Components specified with such expressions are always interpreted 
238as unsigned integers.
239The scope of such variables is always just the enclosing request, reply, 
240error, event, or compound type structure.
241For example:
242</para>
243<para>
244<!-- .LP -->
245<literallayout class="monospaced">
246<!-- .TA 1i 1.5i 2i 2.5i -->
247<!-- .ta 1i 1.5i 2i 2.5i -->
2482	3+n			request length
2494n	LISTofPOINT		points
250</literallayout>
251For unused bytes (the values of the bytes are undefined and do not matter),
252the encode-form is:
253</para>
254<para>
255<!-- .LP -->
256<literallayout class="monospaced">
257<!-- .TA 1i 1.5i 2i 2.5i -->
258<!-- .ta 1i 1.5i 2i 2.5i -->
259N			unused
260</literallayout>
261If the number of unused bytes is variable, the encode-form typically is:
262</para>
263<para>
264<!-- .LP -->
265<literallayout class="monospaced">
266<!-- .TA 1i 1.5i 2i 2.5i -->
267<!-- .ta 1i 1.5i 2i 2.5i -->
268p			unused, p=pad(E)
269</literallayout>
270where E is some expression,
271and pad(E) is the number of bytes needed to round E up to a multiple of four.
272</para>
273<para>
274<!-- .LP -->
275<literallayout class="monospaced">
276<!-- .TA 1i 1.5i 2i 2.5i -->
277<!-- .ta 1i 1.5i 2i 2.5i -->
278pad(E) = (4 - (E mod 4)) mod 4
279</literallayout>
280<!-- .ps +2 -->
281<function>Common Types</function>
282<!-- .ps -->
283</para>
284<para>
285<!-- .LP -->
286LISTofFOO
287</para>
288<itemizedlist>
289  <listitem>
290    <para>
291In this document the LISTof notation strictly means some number of repetitions
292of the FOO encoding; 
293the actual length of the list is encoded elsewhere.
294    </para>
295  </listitem>
296</itemizedlist>
297<para>
298<!-- .LP -->
299SETofFOO
300</para>
301<itemizedlist>
302  <listitem>
303    <para>
304A set is always represented by a bitmask, with a 1-bit indicating presence in
305the set.
306    </para>
307  </listitem>
308</itemizedlist>
309<para>
310<!-- .LP -->
311BITMASK: CARD32
312</para>
313<para>
314<!-- .LP -->
315WINDOW: CARD32
316</para>
317<para>
318<!-- .LP -->
319BYTE: 8-bit value
320</para>
321<para>
322<!-- .LP -->
323INT8: 8-bit signed integer
324</para>
325<para>
326<!-- .LP -->
327INT16: 16-bit signed integer
328</para>
329<para>
330<!-- .LP -->
331INT32: 32-bit signed integer
332</para>
333<para>
334<!-- .LP -->
335CARD8: 8-bit unsigned integer
336</para>
337<para>
338<!-- .LP -->
339CARD16: 16-bit unsigned integer
340</para>
341<para>
342<!-- .LP -->
343CARD32: 32-bit unsigned integer
344</para>
345<para>
346<!-- .LP -->
347TIMESTAMP: CARD32
348</para>
349<para>
350<!-- .LP -->
351EVENTCLASS: CARD32
352</para>
353<para>
354<!-- .LP -->
355<literallayout class="monospaced">
356<!-- .TA .75i 1.75i -->
357<!-- .ta .75i 1.75i -->
358INPUTCLASS
359	0	KeyClass
360	1	ButtonClass
361	2	ValuatorClass
362	3	FeedbackClass
363	4	ProximityClass
364	5	FocusClass
365	6	OtherClass
366</literallayout>
367</para>
368<para>
369<!-- .LP -->
370<literallayout class="monospaced">
371<!-- .TA .75i 1.75i -->
372<!-- .ta .75i 1.75i -->
373INPUTCLASS
374	0	KbdFeedbackClass
375	1	PtrFeedbackClass
376	2	StringFeedbackClass
377	3	IntegerFeedbackClass
378	4	LedFeedbackClass
379	5	BellFeedbackClass
380</literallayout>
381</para>
382<para>
383<!-- .LP -->
384<literallayout class="monospaced">
385<!-- .TA .75i 1.75i -->
386<!-- .ta .75i 1.75i -->
387INPUTINFO
388	0	KEYINFO
389	1	BUTTONINFO
390	2	VALUATORINFO
391</literallayout>
392</para>
393<para>
394<!-- .LP -->
395<literallayout class="monospaced">
396<!-- .TA .75i 1.75i -->
397<!-- .ta .75i 1.75i -->
398DEVICEMODE
399	0	Relative
400	1	Absolute
401</literallayout>
402</para>
403<para>
404<!-- .LP -->
405<literallayout class="monospaced">
406<!-- .TA .75i 1.75i -->
407<!-- .ta .75i 1.75i -->
408PROXIMITYSTATE
409	0	InProximity
410	1	OutOfProximity
411</literallayout>
412</para>
413<para>
414<!-- .LP -->
415<literallayout class="monospaced">
416<!-- .TA .75i 1.75i -->
417<!-- .ta .75i 1.75i -->
418BOOL
419	0	False
420	1	True
421</literallayout>
422</para>
423<para>
424<!-- .LP -->
425KEYSYM: CARD32
426</para>
427<para>
428<!-- .LP -->
429KEYCODE: CARD8
430</para>
431<para>
432<!-- .LP -->
433BUTTON: CARD8
434</para>
435<para>
436<!-- .LP -->
437<literallayout class="monospaced">
438<!-- .TA .75i 1.75i -->
439<!-- .ta .75i 1.75i -->
440SETofKEYBUTMASK
441	#x0001	Shift
442	#x0002	Lock
443	#x0004	Control
444	#x0008	Mod1
445	#x0010	Mod2
446	#x0020	Mod3
447	#x0040	Mod4
448	#x0080	Mod5
449	#x0100	Button1
450	#x0200	Button2
451	#x0400	Button3
452	#x0800	Button4
453	#x1000	Button5
454	#xe000	unused but must be zero
455</literallayout>
456</para>
457<para>
458<!-- .LP -->
459<literallayout class="monospaced">
460<!-- .TA .75i 1.75i -->
461<!-- .ta .75i 1.75i -->
462SETofKEYMASK
463	encodings are the same as for SETofKEYBUTMASK, except with
464	#xff00		unused but must be zero
465</literallayout>
466</para>
467<para>
468<!-- .LP -->
469STRING8: LISTofCARD8
470</para>
471<para>
472<!-- .LP -->
473<literallayout class="monospaced">
474<!-- .TA .2i .5i 1.5i 2.5i -->
475<!-- .ta .2i .5i 1.5i 2.5i -->
476STR
477	1	n		length of name in bytes
478	n	STRING8		name
479</literallayout>
480<!-- .ps +2 -->
481<function>Errors</function>
482<!-- .ps -->
483</para>
484<para>
485<!-- .LP -->
486<literallayout class="monospaced">
487<!-- .TA .2i .5i 1.5i 2.5i -->
488<!-- .ta .2i .5i 1.5i 2.5i -->
489Request
490	1	0		Error
491	1	1		code
492	2	CARD16		sequence number
493	4			unused
494	2	CARD16		minor opcode
495	1	CARD8		major opcode
496	21			unused
497</literallayout>
498</para>
499<para>
500<!-- .LP -->
501<literallayout class="monospaced">
502<!-- .TA .2i .5i 1.5i 2.5i -->
503<!-- .ta .2i .5i 1.5i 2.5i -->
504Value
505	1	0		Error
506	1	2		code
507	2	CARD16		sequence number
508	4	&lt;32-bits&gt;		bad value
509	2	CARD16		minor opcode
510	1	CARD8		major opcode
511	21			unused
512</literallayout>
513</para>
514<para>
515<!-- .LP -->
516<literallayout class="monospaced">
517<!-- .TA .2i .5i 1.5i 2.5i -->
518<!-- .ta .2i .5i 1.5i 2.5i -->
519Window
520	1	0		Error
521	1	3		code
522	2	CARD16		sequence number
523	4	CARD32		bad resource id
524	2	CARD16		minor opcode
525	1	CARD8		major opcode
526	21			unused
527</literallayout>
528</para>
529<para>
530<!-- .LP -->
531<literallayout class="monospaced">
532<!-- .TA .2i .5i 1.5i 2.5i -->
533<!-- .ta .2i .5i 1.5i 2.5i -->
534Match
535	1	0		Error
536	1	8		code
537	2	CARD16		sequence number
538	4			unused
539	2	CARD16		minor opcode
540	1	CARD8		major opcode
541	21			unused
542</literallayout>
543</para>
544<para>
545<!-- .LP -->
546<literallayout class="monospaced">
547<!-- .TA .2i .5i 1.5i 2.5i -->
548<!-- .ta .2i .5i 1.5i 2.5i -->
549Access
550	1	0		Error
551	1	10		code
552	2	CARD16		sequence number
553	4			unused
554	2	CARD16		minor opcode
555	1	CARD8		major opcode
556	21			unused
557</literallayout>
558</para>
559<para>
560<!-- .LP -->
561<literallayout class="monospaced">
562<!-- .TA .2i .5i 1.5i 2.5i -->
563<!-- .ta .2i .5i 1.5i 2.5i -->
564Alloc
565	1	0		Error
566	1	11		code
567	2	CARD16		sequence number
568	4			unused
569	2	CARD16		minor opcode
570	1	CARD8		major opcode
571	21			unused
572</literallayout>
573</para>
574<para>
575<!-- .LP -->
576<literallayout class="monospaced">
577<!-- .TA .2i .5i 1.5i 2.5i -->
578<!-- .ta .2i .5i 1.5i 2.5i -->
579Name
580	1	0		Error
581	1	15		code
582	2	CARD16		sequence number
583	4			unused
584	2	CARD16		minor opcode
585	1	CARD8		major opcode
586	21			unused
587</literallayout>
588</para>
589<para>
590<!-- .LP -->
591<literallayout class="monospaced">
592<!-- .TA .2i .5i 1.5i 2.5i -->
593<!-- .ta .2i .5i 1.5i 2.5i -->
594Device
595	1	0		Error
596	1	CARD8		code
597	2	CARD16		sequence number
598	4			unused
599	2	CARD16		minor opcode
600	1	CARD8		major opcode
601	21			unused
602</literallayout>
603</para>
604<para>
605<!-- .LP -->
606<literallayout class="monospaced">
607<!-- .TA .2i .5i 1.5i 2.5i -->
608<!-- .ta .2i .5i 1.5i 2.5i -->
609Event
610	1	0		Error
611	1	CARD8		code
612	2	CARD16		sequence number
613	4			unused
614	2	CARD16		minor opcode
615	1	CARD8		major opcode
616	21			unused
617</literallayout>
618</para>
619<para>
620<!-- .LP -->
621<literallayout class="monospaced">
622<!-- .TA .2i .5i 1.5i 2.5i -->
623<!-- .ta .2i .5i 1.5i 2.5i -->
624Mode
625	1	0		Error
626	1	CARD8		code
627	2	CARD16		sequence number
628	4			unused
629	2	CARD16		minor opcode
630	1	CARD8		major opcode
631	21			unused
632</literallayout>
633</para>
634<para>
635<!-- .LP -->
636<literallayout class="monospaced">
637<!-- .TA .2i .5i 1.5i 2.5i -->
638<!-- .ta .2i .5i 1.5i 2.5i -->
639Class
640	1	0		Error
641	1	CARD8		code
642	2	CARD16		sequence number
643	4			unused
644	2	CARD16		minor opcode
645	1	CARD8		major opcode
646	21			unused
647</literallayout>
648<!-- .ps +2 -->
649Keyboards
650<!-- .ps -->
651</para>
652<para>
653<!-- .LP -->
654KEYCODE values are always greater than 7 (and less than 256).
655</para>
656<para>
657<!-- .LP -->
658KEYSYM values with the bit #x10000000 set are reserved as vendor-specific.
659</para>
660<para>
661<!-- .LP -->
662The names and encodings of the standard KEYSYM values are contained in 
663<!-- .\"Appendix B, Keysym Encoding. -->
664appendix F.
665</para>
666<para>
667<!-- .LP -->
668<!-- .ps +2 -->
669Pointers
670<!-- .ps -->
671</para>
672<para>
673<!-- .LP -->
674BUTTON values are numbered starting with one.
675</para>
676<para>
677<!-- .LP -->
678<!-- .ps +2 -->
679Requests
680<!-- .ps -->
681</para>
682<para>
683<!-- .LP -->
684<literallayout class="monospaced">
685<!-- .TA .2i .5i 1.5i 2.5i -->
686<!-- .ta .2i .5i 1.5i 2.5i -->
687GetExtensionVersion
688	1	CARD8		input extension opcode
689	1	1		GetExtensionVersion opcode
690	2	2+(n+p)/4		request length
691	2	n		length of name
692	2			unused
693	n	STRING8		name
694	p			unused, p=pad(n)
695</literallayout>
696<literallayout class="monospaced">
697<!-- .TA .2i .5i 1.5i 2.5i -->
698<!-- .ta .2i .5i 1.5i 2.5i -->
699 =&gt;
700	1	1		Reply
701	1	1		GetExtensionVersion opcode
702	2	CARD16		sequence number
703	4	0		reply length
704	2	CARD16		major version
705	2	CARD16		minor version
706	1	BOOL		present
707	19			unused
708</literallayout>
709</para>
710<para>
711<!-- .LP -->
712<literallayout class="monospaced">
713<!-- .TA .2i .5i 1.5i 2.5i -->
714<!-- .ta .2i .5i 1.5i 2.5i -->
715ListInputDevices
716	1	CARD8		input extension opcode
717	1	2		ListInputDevices opcode
718	2	1		request length
719</literallayout>
720<literallayout class="monospaced">
721<!-- .TA .2i .5i 1.5i 2.5i -->
722<!-- .ta .2i .5i 1.5i 2.5i -->
723 =&gt;
724	1	1			Reply
725	1	2			ListInputDevices opcode
726	2	CARD16			sequence number
727	4	(n+p)/4			reply length
728	1	CARD8			number of input devices
729	23				unused
730	n	LISTofDEVICEINFO	info for each input device
731	p				unused, p=pad(n)
732</literallayout>
733</para>
734<para>
735<!-- .LP -->
736<literallayout class="monospaced">
737<!-- .TA .2i .5i 1.5i 2.5i -->
738<!-- .ta .2i .5i 1.5i 2.5i -->
739  DEVICEINFO
740	4	CARD32		device type
741	1	CARD8		device id
742	1	CARD8		number of input classes this device reports
743	1	CARD8		device use
744			0	IsXPointer
745			1	IsXKeyboard
746			2	IsXExtensionDevice
747	1			unused
748	n	LISTofINPUTINFO 		input info for each input class
749	m	STR			name
750	p				unused, p=pad(m)
751</literallayout>
752</para>
753<para>
754<!-- .LP -->
755<literallayout class="monospaced">
756<!-- .TA .2i .5i 1.5i 2.5i -->
757<!-- .ta .2i .5i 1.5i 2.5i -->
758  INPUTINFO	KEYINFO or BUTTONINFO or VALUATORINFO
759</literallayout>
760</para>
761<para>
762<!-- .LP -->
763<literallayout class="monospaced">
764<!-- .TA .2i .5i 1.5i 2.5i -->
765<!-- .ta .2i .5i 1.5i 2.5i -->
766  KEYINFO
767	1	0		class id
768	1	8		length
769	1	KEYCODE		minimum keycode
770	1	KEYCODE		maximum keycode
771	2	CARD16		number of keys
772	2			unused
773</literallayout>
774</para>
775<para>
776<!-- .LP -->
777<literallayout class="monospaced">
778<!-- .TA .2i .5i 1.5i 2.5i -->
779<!-- .ta .2i .5i 1.5i 2.5i -->
780BUTTONINFO
781	1	1		class id
782	1	4		length
783	2	CARD16		number of buttons
784</literallayout>
785</para>
786<para>
787<!-- .LP -->
788<literallayout class="monospaced">
789<!-- .TA .2i .75i 2.0i 3.0i -->
790<!-- .ta .2i .75i 2.0i 3.0i -->
791VALUATORINFO
792	1	2		class id
793	1	8+12n		length
794	1	n		number of axes
795	1	SETofDEVICEMODE			mode
796	4	CARD32		size of motion buffer
797	12n	LISTofAXISINFO		valuator limits
798</literallayout>
799</para>
800<para>
801<!-- .LP -->
802<literallayout class="monospaced">
803<!-- .TA .2i .5i 1.5i 2.5i -->
804<!-- .ta .2i .5i 1.5i 2.5i -->
805AXISINFO
806	4	CARD32		resolution
807	4	CARD32		minimum value
808	4	CARD32		maximum value
809</literallayout>
810</para>
811<para>
812<!-- .LP -->
813<literallayout class="monospaced">
814<!-- .TA .2i .5i 1.5i 2.5i -->
815<!-- .ta .2i .5i 1.5i 2.5i -->
816OpenDevice
817	1	CARD8		input extension opcode
818	1	3		OpenDevice opcode
819	2	2		request length
820	1	CARD8		device id
821	3			unused
822</literallayout>
823<literallayout class="monospaced">
824<!-- .TA .2i .5i 1.5i 3.5i -->
825<!-- .ta .2i .5i 1.5i 3.5i -->
826 =&gt;
827	1	1			Reply
828	1	3			OpenDevice opcode
829	2	CARD16			sequence number
830	4	(n+p)/4			reply length
831	1	CARD8			number of input classes
832	23				unused
833	n	LISTofINPUTCLASSINFO	input class information
834	p				unused, p=pad(n)
835</literallayout>
836</para>
837<para>
838<!-- .LP -->
839<literallayout class="monospaced">
840<!-- .TA .2i .5i 1.5i 2.5i -->
841<!-- .ta .2i .5i 1.5i 2.5i -->
842  INPUTCLASSINFO
843	1	CARD8		input class id
844		0	KEY
845		1	BUTTON
846		2	VALUATOR
847		3	FEEDBACK
848		4	PROXIMITY
849		5	FOCUS
850		6	OTHER
851	1	CARD8		event type base code for this class
852</literallayout>
853</para>
854<para>
855<!-- .LP -->
856<literallayout class="monospaced">
857<!-- .TA .2i .5i 1.5i 2.5i -->
858<!-- .ta .2i .5i 1.5i 2.5i -->
859CloseDevice
860	1	CARD8		input extension opcode
861	1	4		CloseDevice opcode
862	2	2		request length
863	1	CARD8		device id
864	3			unused
865</literallayout>
866</para>
867<para>
868<!-- .LP -->
869<literallayout class="monospaced">
870<!-- .TA .2i .5i 1.5i 2.5i -->
871<!-- .ta .2i .5i 1.5i 2.5i -->
872SetDeviceMode
873	1	CARD8		input extension opcode
874	1	5		SetDeviceMode opcode
875	2	2		request length
876	1	CARD8		device id
877	1	CARD8		mode
878	2			unused
879</literallayout>
880<literallayout class="monospaced">
881<!-- .TA .2i .5i 1.5i 3.5i -->
882<!-- .ta .2i .5i 1.5i 3.5i -->
883 =&gt;
884	1	1			Reply
885	1	5			SetDeviceMode opcode
886	2	CARD16			sequence number
887	4	0			reply length
888	1	CARD8			status
889		0		Success
890			1	AlreadyGrabbed
891		3 + first_error	DeviceBusy
892	23				unused
893</literallayout>
894</para>
895<para>
896<!-- .LP -->
897<literallayout class="monospaced">
898<!-- .TA .2i .5i 1.5i 2.5i -->
899<!-- .ta .2i .5i 1.5i 2.5i -->
900SelectExtensionEvent
901	1	CARD8			input extension opcode
902	1	6			SelectExtensionEvent opcode
903	2	3+n				request length
904	4	Window			event window
905	2	CARD16			count
906	2				unused
907	4n	LISTofEVENTCLASS	desired events
908</literallayout>
909</para>
910<para>
911<!-- .LP -->
912<literallayout class="monospaced">
913<!-- .TA .2i .5i 1.5i 2.5i -->
914<!-- .ta .2i .5i 1.5i 2.5i -->
915GetSelectedExtensionEvents
916	1	CARD8		input extension opcode
917	1	7		GetSelectedExtensionEvents opcode
918	2	2		request length
919	4	Window		event window
920</literallayout>
921<literallayout class="monospaced">
922<!-- .TA .2i .5i 1.5i 2.5i -->
923<!-- .ta .2i .5i 1.5i 2.5i -->
924 =&gt;
925	1	1		Reply
926	1	7		GetSelecteExtensionEvents opcode
927	2	CARD16		sequence number
928	4	n + m  		reply length
929	2	n     		this client count
930	2	m     		all clients count
931	20			unused
932	4n	LISTofEVENTCLASS	this client list
933	4m	LISTofEVENTCLASS	all clients list
934</literallayout>
935</para>
936<para>
937<!-- .LP -->
938<literallayout class="monospaced">
939<!-- .TA .2i .5i 1.5i 2.5i -->
940<!-- .ta .2i .5i 1.5i 2.5i -->
941ChangeDeviceDontPropagateList
942	1	CARD8			input extension opcode
943	1	8			ChangeDeviceDontPropagateList opcode
944	2	3+n				request length
945	4	Window			event window
946	2	n			count of events
947	1	mode
948		0	AddToList
949		1	DeleteFromList
950	1				unused
951	4n	LISTofEVENTCLASS	desired events
952</literallayout>
953</para>
954<para>
955<!-- .LP -->
956<literallayout class="monospaced">
957<!-- .TA .2i .5i 1.5i 2.5i -->
958<!-- .ta .2i .5i 1.5i 2.5i -->
959GetDeviceDontPropagateList
960	1	CARD8		input extension opcode
961	1	9		GetDeviceDontPropagateList opcode
962	2	2		request length
963	4	Window		event window
964</literallayout>
965<literallayout class="monospaced">
966<!-- .TA .2i .5i 1.5i 2.5i -->
967<!-- .ta .2i .5i 1.5i 2.5i -->
968 =&gt;
969	1	1			Reply
970	1	9			GetDeviceDontPropagateList opcode
971	2	CARD16			sequence number
972	4	n  			reply length
973	2	n			count of events
974	22				unused
975	4n	LISTofEVENTCLASS	don't propagate list
976</literallayout>
977</para>
978<para>
979<!-- .LP -->
980<literallayout class="monospaced">
981<!-- .TA .2i .5i 1.5i 2.5i -->
982<!-- .ta .2i .5i 1.5i 2.5i -->
983GetDeviceMotionEvents
984	1	CARD8		input extension opcode
985	1	10		GetDeviceMotionEvents opcode
986	2	4		request length
987	4	TIMESTAMP		start
988		0	CurrentTime
989	4	TIMESTAMP		stop
990		0	CurrentTime
991	1	CARD8		device id
992	3			unused
993</literallayout>
994<literallayout class="monospaced">
995<!-- .TA .2i .5i 1.5i 3.5i -->
996<!-- .ta .2i .5i 1.5i 3.5i -->
997 =&gt;
998	1		1		Reply
999	1		10	GetDeviceMotionEvents opcode
1000	2		CARD16	sequence number
1001	4		(m+1)n	reply length
1002	4		n		number of DEVICETIMECOORDs in events
1003	1		m		number of valuators per event
1004	1		CARD8		mode of the device
1005			0	Absolute
1006			1	Relative
1007	18				unused
1008	(4m+4)n	LISTofDEVICETIMECOORD	events
1009</literallayout>
1010</para>
1011<para>
1012<!-- .LP -->
1013<literallayout class="monospaced">
1014<!-- .TA .2i .5i 1.5i 2.5i -->
1015<!-- .ta .2i .5i 1.5i 2.5i -->
1016  DEVICETIMECOORD
1017	4	TIMESTAMP		time
1018	4m	LISTofINT32		valuators
1019</literallayout>
1020</para>
1021<para>
1022<!-- .LP -->
1023<literallayout class="monospaced">
1024<!-- .TA .2i .5i 1.5i 2.5i -->
1025<!-- .ta .2i .5i 1.5i 2.5i -->
1026ChangeKeyboardDevice
1027	1	CARD8		input extension opcode
1028	1	11		ChangeKeyboardDevice opcode
1029	2	2		request length
1030	1	CARD8		device id
1031	3			unused
1032</literallayout>
1033<literallayout class="monospaced">
1034<!-- .TA .2i .5i 1.5i 2.5i -->
1035<!-- .ta .2i .5i 1.5i 2.5i -->
1036 =&gt;
1037	1	1		Reply
1038	1	11		ChangeKeyboardDevice opcode
1039	2	CARD16		sequence number
1040	4	0		reply length
1041	1			status
1042		0	Success
1043		1	AlreadyGrabbed
1044		2	DeviceFrozen
1045	23			unused
1046</literallayout>
1047</para>
1048<para>
1049<!-- .LP -->
1050<literallayout class="monospaced">
1051<!-- .TA .2i .5i 1.5i 2.5i -->
1052<!-- .ta .2i .5i 1.5i 2.5i -->
1053ChangePointerDevice
1054	1	CARD8		input extension opcode
1055	1	12		ChangePointerDevice opcode
1056	2	2		request length
1057	1	CARD8		x-axis
1058	1	CARD8		y-axis
1059	1	CARD8		device id
1060	1			unused
1061</literallayout>
1062<literallayout class="monospaced">
1063<!-- .TA .2i .5i 1.5i 2.5i -->
1064<!-- .ta .2i .5i 1.5i 2.5i -->
1065 =&gt;
1066	1	1		Reply
1067	1	12		ChangePointerDevice opcode
1068	2	CARD16		sequence number
1069	4	0		reply length
1070	1			status
1071		0	Success
1072		1	AlreadyGrabbed
1073		2	DeviceFrozen
1074	23			unused
1075</literallayout>
1076</para>
1077<para>
1078<!-- .LP -->
1079<literallayout class="monospaced">
1080<!-- .TA .2i .5i 1.5i 2.5i -->
1081<!-- .ta .2i .5i 1.5i 2.5i -->
1082GrabDevice
1083	1	CARD8		input extension opcode
1084	1	13		GrabDevice opcode
1085	2	5+n			request length
1086	4	WINDOW		grab-window
1087	4	TIMESTAMP		time
1088		0	CurrentTime
1089	2	n		count of events
1090	1			this-device-mode
1091		0	Synchronous
1092		1	Asynchronous
1093	1			other-devices-mode
1094		0	Synchronous
1095		1	Asynchronous
1096	1	BOOL		owner-events
1097	1	CARD8		device id
1098	2			unused
1099	4n	LISTofEVENTCLASS	event list
1100</literallayout>
1101<literallayout class="monospaced">
1102<!-- .TA .2i .5i 1.5i 2.5i -->
1103<!-- .ta .2i .5i 1.5i 2.5i -->
1104 =&gt;
1105	1	1		Reply
1106	1	13		GrabDevice opcode
1107	2	CARD16		sequence number
1108	4	0		reply length
1109	1			status
1110		0	Success
1111		1	AlreadyGrabbed
1112		2	InvalidTime
1113		3	NotViewable
1114		4	Frozen
1115	23			unused
1116</literallayout>
1117</para>
1118<para>
1119<!-- .LP -->
1120<literallayout class="monospaced">
1121<!-- .TA .2i .5i 1.5i 2.5i -->
1122<!-- .ta .2i .5i 1.5i 2.5i -->
1123UngrabDevice
1124	1	CARD8		input extension opcode
1125	1	14		UngrabDevice opcode
1126	2	3		request length
1127	4	TIMESTAMP		time
1128		0	CurrentTime
1129	1	CARD8		device id
1130	3			unused
1131</literallayout>
1132</para>
1133<para>
1134<!-- .LP -->
1135<literallayout class="monospaced">
1136<!-- .TA .2i .5i 1.5i 2.5i -->
1137<!-- .ta .2i .5i 1.5i 2.5i -->
1138GrabDeviceKey
1139	1	CARD8		input extension opcode
1140	1	15		GrabDeviceKey opcode
1141	2	5+n		request length
1142	4	WINDOW		grab-window
1143	2	n		count of events
1144	2	SETofKEYMASK		modifiers
1145		#x8000	AnyModifier
1146	1	CARD8		modifier device
1147		#x0FF	UseXKeyboard
1148	1	CARD8		grabbed device
1149	1	KEYCODE			key
1150		0	AnyKey
1151	1			this-device-mode
1152		0	Synchronous
1153		1	Asynchronous
1154	1			other-devices-mode
1155		0	Synchronous
1156		1	Asynchronous
1157	1	BOOL		owner-events
1158	2			unused
1159	4n	LISTofEVENTCLASS	event list
1160</literallayout>
1161</para>
1162<para>
1163<!-- .LP -->
1164<literallayout class="monospaced">
1165<!-- .TA .2i .5i 1.5i 2.5i -->
1166<!-- .ta .2i .5i 1.5i 2.5i -->
1167UngrabDeviceKey
1168	1	CARD8		input extension opcode
1169	1	16		UngrabDeviceKey opcode
1170	2	4		request length
1171	4	WINDOW		grab-window
1172	2	SETofKEYMASK		modifiers
1173		#x8000	AnyModifier
1174	1	CARD8		modifier device
1175		#x0FF	UseXKeyboard
1176	1	KEYCODE			key
1177		0	AnyKey
1178	1	CARD8		grabbed device
1179	3			unused
1180
1181</literallayout>
1182</para>
1183<para>
1184<!-- .LP -->
1185<literallayout class="monospaced">
1186<!-- .TA .2i .5i 1.5i 2.5i -->
1187<!-- .ta .2i .5i 1.5i 2.5i -->
1188GrabDeviceButton
1189	1	CARD8		input extension opcode
1190	1	17		GrabDeviceButton opcode
1191	2	5+n		request length
1192	4	WINDOW		grab-window
1193	1	CARD8		grabbed device
1194	1	CARD8		modifier device
1195		#x0FF	UseXKeyboard
1196	2	n		count of desired events
1197	2	SETofKEYMASK		modifiers
1198	1			this-device-mode
1199		0	Synchronous
1200		1	Asynchronous
1201	1			other-device-mode
1202		0	Synchronous
1203		1	Asynchronous
1204	1	BUTTON		button
1205		0	AnyButton
1206	1	BOOL		owner-events
1207		#x8000	AnyModifier
1208	2			unused
1209	4n	LISTofEVENTCLASS	event list
1210</literallayout>
1211</para>
1212<para>
1213<!-- .LP -->
1214<literallayout class="monospaced">
1215<!-- .TA .2i .5i 1.5i 2.5i -->
1216<!-- .ta .2i .5i 1.5i 2.5i -->
1217UngrabDeviceButton
1218	1	CARD8		input extension opcode
1219	1	18		UngrabDeviceButton opcode
1220	2	4		request length
1221	4	WINDOW		grab-window
1222	2	SETofKEYMASK		modifiers
1223		#x8000	AnyModifier
1224	1	CARD8		modifier device
1225		#x0FF	UseXKeyboard
1226	1	BUTTON		button
1227		0	AnyButton
1228	1	CARD8		grabbed device
1229	3			unused
1230</literallayout>
1231</para>
1232<para>
1233<!-- .LP -->
1234<literallayout class="monospaced">
1235<!-- .TA .2i .5i 1.5i 2.5i -->
1236<!-- .ta .2i .5i 1.5i 2.5i -->
1237AllowDeviceEvents
1238	1	CARD8		input extension opcode
1239	1	19		AllowDeviceEvents opcode
1240	2	3		request length
1241	4	TIMESTAMP		time
1242		0	CurrentTime
1243	1			mode
1244		0	AsyncThisDevice
1245		1	SyncThisDevice
1246		2	ReplayThisDevice
1247		3	AsyncOtherDevices
1248		4	AsyncAll
1249		5	SyncAll
1250	1	CARD8		device id
1251	2			unused
1252</literallayout>
1253</para>
1254<para>
1255<!-- .LP -->
1256<literallayout class="monospaced">
1257<!-- .TA .2i .5i 1.5i 2.5i -->
1258<!-- .ta .2i .5i 1.5i 2.5i -->
1259GetDeviceFocus
1260	1	CARD8		input extension opcode
1261	1	20		GetDeviceFocus opcode
1262	2	2		request length
1263	1	CARD8		device
1264	3			unused
1265</literallayout>
1266<literallayout class="monospaced">
1267<!-- .TA .2i .5i 1.5i 2.5i -->
1268<!-- .ta .2i .5i 1.5i 2.5i -->
1269 =&gt;
1270	1	1		Reply
1271	1	20		GetDeviceFocus opcode
1272	2	CARD16		sequence number
1273	4	0		reply length
1274	4	WINDOW		focus
1275		0	None
1276		1	PointerRoot
1277		3	FollowKeyboard
1278	4	TIMESTAMP	focus time
1279	1			revert-to
1280		0	None
1281		1	PointerRoot
1282		2	Parent
1283		3	FollowKeyboard
1284	15			unused
1285</literallayout>
1286</para>
1287<para>
1288<!-- .LP -->
1289<literallayout class="monospaced">
1290<!-- .TA .2i .5i 1.5i 2.5i -->
1291<!-- .ta .2i .5i 1.5i 2.5i -->
1292SetDeviceFocus
1293	1	CARD8		input extension opcode
1294	1	21		SetDeviceFocus opcode
1295	2	4		request length
1296	4	WINDOW		focus
1297		0	None
1298		1	PointerRoot
1299		3	FollowKeyboard
1300	4	TIMESTAMP		time
1301		0	CurrentTime
1302	1			revert-to
1303		0	None
1304		1	PointerRoot
1305		2	Parent
1306		3	FollowKeyboard
1307	1	CARD8		device
1308	2			unused
1309</literallayout>
1310</para>
1311<para>
1312<!-- .LP -->
1313<literallayout class="monospaced">
1314<!-- .TA .2i .5i 1.5i 2.5i -->
1315<!-- .ta .2i .5i 1.5i 2.5i -->
1316GetFeedbackControl
1317	1	CARD8		input extension opcode
1318	1	22		GetFeedbackControl opcode
1319	2	2		request length
1320	1	CARD8		device id
1321	3			unused
1322</literallayout>
1323<literallayout class="monospaced">
1324<!-- .TA .2i .5i 1.5i 2.5i -->
1325<!-- .ta .2i .5i 1.5i 2.5i -->
1326 =&gt;
1327	1	1		Reply
1328	1	22		GetFeedbackControl opcode
1329	2	CARD16		sequence number
1330	4	m/4			reply length
1331	2	n		number of feedbacks supported
1332	22			unused
1333	m	LISTofFEEDBACKSTATE	feedbacks
1334</literallayout>
1335</para>
1336<para>
1337<!-- .LP -->
1338<literallayout class="monospaced">
1339<!-- .TA .2i .5i 1.5i 2.5i -->
1340<!-- .ta .2i .5i 1.5i 2.5i -->
1341  FEEDBACKSTATE	KBDFEEDBACKSTATE, PTRFEEDBACKSTATE, INTEGERFEEDBACKSTATE, 
1342  STRINGFEEDBACKSTATE, BELLFEEDBACKSTATE, or LEDFEEDBACKSTATE
1343</literallayout>
1344</para>
1345<para>
1346<!-- .LP -->
1347<literallayout class="monospaced">
1348<!-- .TA .2i .5i 1.5i 2.5i -->
1349<!-- .ta .2i .5i 1.5i 2.5i -->
1350  KBDFEEDBACKSTATE
1351	1	0		feedback class id
1352	1	CARD8		id of this feedback
1353	2	20		length
1354	2	CARD16		pitch
1355	2	CARD16		duration
1356	4	CARD32		led_mask
1357	4	CARD32		led_values
1358	1	    		global_auto_repeat
1359		0	Off
1360		1	On
1361	1	CARD8		click
1362	1	CARD8		percent
1363	1	    		unused
1364	32	LISTofCARD8	auto_repeats
1365</literallayout>
1366</para>
1367<para>
1368<!-- .LP -->
1369<literallayout class="monospaced">
1370<!-- .TA .2i .5i 1.5i 2.5i -->
1371<!-- .ta .2i .5i 1.5i 2.5i -->
1372  PTRFEEDBACKSTATE
1373	1	0		feedback class id
1374	1	CARD8		id of this feedback
1375	2	12		length
1376	2			unused
1377	2	CARD16		acceleration-numerator
1378	2	CARD16		acceleration-denominator
1379	2	CARD16		threshold
1380</literallayout>
1381</para>
1382<para>
1383<!-- .LP -->
1384<literallayout class="monospaced">
1385<!-- .TA .2i .5i 1.5i 2.5i -->
1386<!-- .ta .2i .5i 1.5i 2.5i -->
1387  INTEGERFEEDBACKSTATE
1388	1	0		feedback class id
1389	1	CARD8		id of this feedback
1390	2	16		length
1391	4	CARD32		resolution
1392	4	INT32		minimum value
1393	4	INT32		maximum value
1394</literallayout>
1395</para>
1396<para>
1397<!-- .LP -->
1398<literallayout class="monospaced">
1399<!-- .TA .2i .5i 1.5i 2.5i -->
1400<!-- .ta .2i .5i 1.5i 2.5i -->
1401  STRINGFEEDBACKSTATE
1402	1	1		feedback class id
1403	1	CARD8		id of this feedback
1404	2	4n+8		length
1405	2	CARD16		max_symbols
1406	2	n      		number of keysyms supported
1407	4n	LISTofKEYSYM		key symbols supported
1408</literallayout>
1409</para>
1410<para>
1411<!-- .LP -->
1412<literallayout class="monospaced">
1413<!-- .TA .2i .5i 1.5i 2.5i -->
1414<!-- .ta .2i .5i 1.5i 2.5i -->
1415  BELLFEEDBACKSTATE
1416	1	1		feedback class id
1417	1	CARD8		id of this feedback
1418	2	12		length
1419	1	CARD8		percent
1420	3			unused
1421	2	CARD16		pitch
1422	2	CARD16		duration
1423</literallayout>
1424</para>
1425<para>
1426<!-- .LP -->
1427<literallayout class="monospaced">
1428<!-- .TA .2i .5i 1.5i 2.5i -->
1429<!-- .ta .2i .5i 1.5i 2.5i -->
1430  LEDFEEDBACKSTATE
1431	1	1		feedback class id
1432	1	CARD8		id of this feedback
1433	2	12		length
1434	4	CARD32		led_mask
1435	4	BITMASK		led_values
1436		#x0001	On
1437		#x0002	Off
1438</literallayout>
1439</para>
1440<para>
1441<!-- .LP -->
1442<literallayout class="monospaced">
1443<!-- .TA .2i .5i 1.5i 2.5i -->
1444<!-- .ta .2i .5i 1.5i 2.5i -->
1445ChangeFeedbackControl
1446	1	CARD8		input extension opcode
1447	1	23		ChangeFeedbackControl opcode
1448	2	3+n/4		request length
1449	4	BITMASK		value-mask (has n bits set to 1)
1450		#x0001	keyclick-percent
1451		#x0002	bell-percent
1452		#x0004	bell-pitch
1453		#x0008	bell-duration
1454		#x0010	led
1455		#x0020	led-mode
1456		#x0040	key
1457		#x0080	auto-repeat-mode
1458		#x0001	string
1459		#x0001	integer
1460		#x0001	acceleration-numerator
1461		#x0002	acceleration-denominator
1462		#x0004	acceleration-threshold
1463	1	CARD8		device id
1464	1	CARD8		feedback class id
1465	2			unused
1466	n	FEEDBACKCLASS
1467</literallayout>
1468</para>
1469<para>
1470<!-- .LP -->
1471<literallayout class="monospaced">
1472<!-- .TA .2i .5i 1.5i 2.5i -->
1473<!-- .ta .2i .5i 1.5i 2.5i -->
1474  FEEDBACKCLASS	KBDFEEDBACKCTL, PTRFEEDBACKCTL, INTEGERFEEDBACKCTL, 
1475  STRINGFEEDBACKCTL, BELLFEEDBACKCTL, or LEDFEEDBACKCTL 
1476</literallayout>
1477</para>
1478<para>
1479<!-- .LP -->
1480<literallayout class="monospaced">
1481<!-- .TA .2i .5i 1.5i 2.5i -->
1482<!-- .ta .2i .5i 1.5i 2.5i -->
1483  KBDFEEDBACKCTL
1484	1	0		feedback class id
1485	1	CARD8		id of this feedback
1486	2	20		length
1487	1	KEYCODE		key
1488	1			auto-repeat-mode
1489		0	Off
1490		1	On
1491		2	Default
1492	1	INT8		key-click-percent
1493	1	INT8		bell-percent
1494	2	INT16		bell-pitch
1495	2	INT16		bell-duration
1496	4	CARD32		led_mask
1497	4	CARD32		led_values
1498</literallayout>
1499</para>
1500<para>
1501<!-- .LP -->
1502<literallayout class="monospaced">
1503<!-- .TA .2i .5i 1.5i 2.5i -->
1504<!-- .ta .2i .5i 1.5i 2.5i -->
1505  PTRFEEDBACKCTL
1506	1	1		feedback class id
1507	1	CARD8		id of this feedback
1508	2	12		length
1509	2			unused
1510	2	INT16		numerator
1511	2	INT16		denominator
1512	2	INT16		threshold
1513</literallayout>
1514</para>
1515<para>
1516<!-- .LP -->
1517<literallayout class="monospaced">
1518<!-- .TA .2i .5i 1.5i 2.5i -->
1519<!-- .ta .2i .5i 1.5i 2.5i -->
1520  STRINGCTL
1521	1	2		feedback class id
1522	1	CARD8		id of this feedback
1523	2	4n+8		length
1524	2			unused
1525	2	n		number of keysyms to display
1526	4n	LISTofKEYSYM		list of key symbols to display
1527</literallayout>
1528</para>
1529<para>
1530<!-- .LP -->
1531<literallayout class="monospaced">
1532<!-- .TA .2i .5i 1.5i 2.5i -->
1533<!-- .ta .2i .5i 1.5i 2.5i -->
1534  INTEGERCTL
1535	1	3		feedback class id
1536	1	CARD8		id of this feedback
1537	2	8		length
1538	4	INT32		integer to display
1539</literallayout>
1540</para>
1541<para>
1542<!-- .LP -->
1543<literallayout class="monospaced">
1544<!-- .TA .2i .5i 1.5i 2.5i -->
1545<!-- .ta .2i .5i 1.5i 2.5i -->
1546  LEDCTL
1547	1	4		feedback class id
1548	1	CARD8		id of this feedback
1549	2	12		length
1550	4	CARD32		led_mask
1551	4	BITMASK		led_values
1552		#x0001	On
1553		#x0002	Off
1554</literallayout>
1555</para>
1556<para>
1557<!-- .LP -->
1558<literallayout class="monospaced">
1559<!-- .TA .2i .5i 1.5i 2.5i -->
1560<!-- .ta .2i .5i 1.5i 2.5i -->
1561  BELLCTL
1562	1	5		feedback class id
1563	1	CARD8		id of this feedback
1564	2	8		length
1565	1	INT8		percent
1566	3			unused
1567	2	INT16		pitch
1568	2	INT16		duration
1569</literallayout>
1570</para>
1571<para>
1572<!-- .LP -->
1573<literallayout class="monospaced">
1574<!-- .TA .2i .5i 1.5i 2.5i -->
1575<!-- .ta .2i .5i 1.5i 2.5i -->
1576GetDeviceKeyMapping
1577	1	CARD8		input extension opcode
1578	1	24		GetDeviceKeyMapping opcode
1579	2	2		request length
1580	1	CARD8		device
1581	1	KEYCODE		first-keycode
1582	1	CARD8		count
1583	1			unused
1584</literallayout>
1585<literallayout class="monospaced">
1586<!-- .TA .2i .75i 2.0i 3.0i -->
1587<!-- .ta .2i .75i 2.0i 3.0i -->
1588 =&gt;
1589	1	1		Reply
1590	1	24		GetDeviceKeyMapping opcode
1591	2	CARD16		sequence number
1592	4	nm		reply length (m = count field from the request)
1593	1	n		keysyms-per-keycode
1594	23			unused
1595	4nm	LISTofKEYSYM		keysyms
1596</literallayout>
1597</para>
1598<para>
1599<!-- .LP -->
1600<literallayout class="monospaced">
1601<!-- .TA .2i .75i 2.0i 3.0i -->
1602<!-- .ta .2i .75i 2.0i 3.0i -->
1603ChangeDeviceKeyMapping
1604	1	CARD8		input extension opcode
1605	1	25		ChangeDeviceKeyMapping opcode
1606	2	2+nm		request length
1607	1	CARD8		device
1608	1	KEYCODE		first-keycode
1609	1	m		keysyms-per-keycode
1610	1	n		keycode-count
1611	4nm	LISTofKEYSYM		keysyms
1612</literallayout>
1613</para>
1614<para>
1615<!-- .LP -->
1616<literallayout class="monospaced">
1617<!-- .TA .2i .5i 1.5i 2.5i -->
1618<!-- .ta .2i .5i 1.5i 2.5i -->
1619GetDeviceModifierMapping
1620	1	CARD8		input extension opcode
1621	1	26		GetDeviceModifierMapping opcode
1622	2	2		request length
1623	1	CARD8		device
1624	3			unused
1625</literallayout>
1626<literallayout class="monospaced">
1627<!-- .TA .2i .5i 1.5i 2.5i -->
1628<!-- .ta .2i .5i 1.5i 2.5i -->
1629 =&gt;
1630	1	1		Reply
1631	1	26		GetDeviceModifierMapping opcode
1632	2	CARD16		sequence number
1633	4	2n		reply length
1634	1	n		keycodes-per-modifier
1635	23			unused
1636	8n	LISTofKEYCODE		keycodes
1637</literallayout>
1638</para>
1639<para>
1640<!-- .LP -->
1641<literallayout class="monospaced">
1642<!-- .TA .2i .5i 1.5i 2.5i -->
1643<!-- .ta .2i .5i 1.5i 2.5i -->
1644SetDeviceModifierMapping
1645	1	CARD8		input extension opcode
1646	1	27		SetDeviceModifier opcode
1647	2	2+2n		request length
1648	1	CARD8		device
1649	1	n		keycodes-per-modifier
1650	2			unused
1651	8n	LISTofKEYCODE		keycodes
1652</literallayout>
1653<literallayout class="monospaced">
1654<!-- .TA .2i .5i 1.5i 2.5i -->
1655<!-- .ta .2i .5i 1.5i 2.5i -->
1656 =&gt;
1657	1	1		Reply
1658	1	27		SetDeviceModifierMapping opcode
1659	2	CARD16		sequence number
1660	4	0		reply length
1661	1			status
1662		0	Success
1663		1	Busy
1664		2	Failed
1665	23			unused
1666</literallayout>
1667</para>
1668<para>
1669<!-- .LP -->
1670<literallayout class="monospaced">
1671<!-- .TA .2i .5i 1.5i 2.5i -->
1672<!-- .ta .2i .5i 1.5i 2.5i -->
1673GetDeviceButtonMapping
1674	1	CARD8		input extension opcode
1675	1	28		GetDeviceButtonMapping opcode
1676	2	2		request length
1677	1	CARD8		device
1678	3			unused
1679</literallayout>
1680<literallayout class="monospaced">
1681<!-- .TA .2i .5i 1.5i 2.5i -->
1682<!-- .ta .2i .5i 1.5i 2.5i -->
1683 =&gt;
1684	1	1		Reply
1685	1	28		GetDeviceButtonMapping opcode
1686	2	CARD16		sequence number
1687	4	(n+p)/4		reply length
1688	1	n		number of elements in map list
1689	23			unused
1690	n	LISTofCARD8			map
1691	p			unused, p=pad(n)
1692</literallayout>
1693</para>
1694<para>
1695<!-- .LP -->
1696<literallayout class="monospaced">
1697<!-- .TA .2i .5i 1.5i 2.5i -->
1698<!-- .ta .2i .5i 1.5i 2.5i -->
1699SetDeviceButtonMapping
1700	1	CARD8		input extension opcode
1701	1	29		SetDeviceButtonMapping opcode
1702	2	2+(n+p)/4		request length
1703	1	CARD8		device
1704	1	n		length of map
1705	2			unused
1706	n	LISTofCARD8			map
1707	p			unused, p=pad(n)
1708</literallayout>
1709<literallayout class="monospaced">
1710<!-- .TA .2i .5i 1.5i 2.5i -->
1711<!-- .ta .2i .5i 1.5i 2.5i -->
1712 =&gt;
1713	1	1		Reply
1714	1	29		SetDeviceButtonMapping opcode
1715	2	CARD16		sequence number
1716	4	0		reply length
1717	1			status
1718		0	Success
1719		1	Busy
1720	23			unused
1721</literallayout>
1722</para>
1723<para>
1724<!-- .LP -->
1725<literallayout class="monospaced">
1726<!-- .TA .2i .5i 1.5i 2.5i -->
1727<!-- .ta .2i .5i 1.5i 2.5i -->
1728QueryDeviceState
1729	1	CARD8		input extension opcode
1730	1	30		QueryDeviceState opcode
1731	2	2		request length
1732	1	CARD8		device
1733	3			unused
1734</literallayout>
1735<literallayout class="monospaced">
1736<!-- .TA .2i .5i 1.5i 2.5i -->
1737<!-- .ta .2i .5i 1.5i 2.5i -->
1738 =&gt;
1739	1	1			Reply
1740	1	30			QueryDeviceState opcode
1741	2	CARD16			sequence number
1742	4	m/4			reply length
1743	1	n     	 		number of input classes
1744	23				unused
1745	m	LISTofINPUTSTATE
1746</literallayout>
1747<literallayout class="monospaced">
1748<!-- .TA .2i .5i 1.5i 2.5i -->
1749<!-- .ta .2i .5i 1.5i 2.5i -->
1750  INPUTSTATE	KEYSTATE or BUTTONSTATE or VALUATORSTATE
1751</literallayout>
1752</para>
1753<para>
1754<!-- .LP -->
1755<literallayout class="monospaced">
1756<!-- .TA .2i .5i 1.5i 2.5i -->
1757<!-- .ta .2i .5i 1.5i 2.5i -->
1758  KEYSTATE
1759	1	CARD8		key input class id
1760	1	36		length
1761	1	CARD8		num_keys
1762	1			unused
1763	32	LISTofCARD8		status of keys
1764</literallayout>
1765<literallayout class="monospaced">
1766<!-- .TA .2i .5i 1.5i 2.5i -->
1767<!-- .ta .2i .5i 1.5i 2.5i -->
1768  BUTTONSTATE
1769	1	CARD8		button input class id
1770	1	36		length
1771	1	CARD8		num_buttons
1772	1			unused
1773	32	LISTofCARD8			status of buttons
1774</literallayout>
1775<literallayout class="monospaced">
1776<!-- .TA .2i .5i 1.5i 2.5i -->
1777<!-- .ta .2i .5i 1.5i 2.5i -->
1778  VALUATORSTATE
1779	1	CARD8		valuator input class id
1780	1	4n + 4		length
1781	1	n		number of valuators
1782	1			mode
1783		#x01	DeviceMode (0 = Relative, 1 = Absolute)
1784		#x02	ProximityState (0 = InProximity, 1 = OutOfProximity)
1785	4n	LISTofCARD32		status of valuators
1786</literallayout>
1787</para>
1788<para>
1789<!-- .LP -->
1790<literallayout class="monospaced">
1791<!-- .TA .2i .5i 1.5i 2.5i -->
1792<!-- .ta .2i .5i 1.5i 2.5i -->
1793SendExtensionEvent
1794	1	CARD8			input extension opcode
1795	1	31			SendExtensionEvent opcode
1796	2	4 + 8n + m		request length
1797	4	WINDOW			destination
1798	1	CARD8			device
1799	1	BOOL			propagate
1800	2	CARD16			eventclass count
1801	1	CARD8			num_events
1802	3				unused
1803	32n	LISTofEVENTS		events to send
1804	4m	LISTofEVENTCLASS	desired events
1805</literallayout>
1806</para>
1807<para>
1808<!-- .LP -->
1809<literallayout class="monospaced">
1810<!-- .TA .2i .5i 1.5i 2.5i -->
1811<!-- .ta .2i .5i 1.5i 2.5i -->
1812DeviceBell
1813	1	CARD8		input extension opcode
1814	1	32		DeviceBell opcode
1815	2	2		request length
1816	1	CARD8		device id
1817	1	CARD8		feedback id
1818	1	CARD8		feedback class
1819	1	INT8		percent
1820</literallayout>
1821</para>
1822<para>
1823<!-- .LP -->
1824<literallayout class="monospaced">
1825<!-- .TA .2i .5i 1.5i 2.5i -->
1826<!-- .ta .2i .5i 1.5i 2.5i -->
1827SetDeviceValuators
1828	1	CARD8		input extension opcode
1829	1	33		SetDeviceValuators opcode
1830	2	2 + n		request length
1831	1	CARD8		device id
1832	1	CARD8		first valuator
1833	1	n    		number of valuators
1834	1			unused
1835	4n	LISTofINT32	valuator values to set
1836</literallayout>
1837<literallayout class="monospaced">
1838<!-- .TA .2i .5i 1.5i 3.5i -->
1839<!-- .ta .2i .5i 1.5i 3.5i -->
1840 =&gt;
1841	1	1			Reply
1842	1	33			SetDeviceValuators opcode
1843	2	CARD16			sequence number
1844	4	0			reply length
1845	1	CARD8			status
1846		0	Success
1847		1	AlreadyGrabbed
1848	23				unused
1849</literallayout>
1850</para>
1851<para>
1852<!-- .LP -->
1853<literallayout class="monospaced">
1854<!-- .TA .2i .5i 1.5i 2.5i -->
1855<!-- .ta .2i .5i 1.5i 2.5i -->
1856GetDeviceControl
1857	1	CARD8		input extension opcode
1858	1	34		GetDeviceControl opcode
1859	2	2		request length
1860	2	CARD16		device control type
1861	1	CARD8		device id
1862	1			unused
1863</literallayout>
1864<literallayout class="monospaced">
1865<!-- .TA .2i .5i 1.5i 3.5i -->
1866<!-- .ta .2i .5i 1.5i 3.5i -->
1867 =&gt;
1868	1	1			Reply
1869	1	34			GetDeviceControl opcode
1870	2	CARD16			sequence number
1871	4	n/4			reply length
1872	1	CARD8			status
1873		0			Success
1874		1			AlreadyGrabbed
1875		3 + first_error		DeviceBusy
1876	23				unused
1877	n				DEVICESTATE
1878</literallayout>
1879<literallayout class="monospaced">
1880<!-- .TA .2i .5i 1.5i 2.5i -->
1881<!-- .ta .2i .5i 1.5i 2.5i -->
1882DEVICESTATE			DEVICERESOLUTIONSTATE
1883</literallayout>
1884</para>
1885<para>
1886<!-- .LP -->
1887<literallayout class="monospaced">
1888<!-- .TA .2i .5i 1.5i 2.5i -->
1889<!-- .ta .2i .5i 1.5i 2.5i -->
1890DEVICERESOLUTIONSTATE
1891 	2	0		control type
1892 	2	8 + 12n		length
1893 	4	n    		num_valuators
1894 	4n	LISTOfCARD32	resolution values
1895 	4n	LISTOfCARD32	resolution min_values
1896 	4n	LISTOfCARD32	resolution max_values
1897</literallayout>
1898</para>
1899<para>
1900<!-- .LP -->
1901</para>
1902<para>
1903<!-- .LP -->
1904<literallayout class="monospaced">
1905<!-- .TA .2i .5i 1.5i 2.5i -->
1906<!-- .ta .2i .5i 1.5i 2.5i -->
1907ChangeDeviceControl
1908 	1	CARD8		input extension opcode
1909 	1	35		ChangeDeviceControl opcode
1910 	2	2+n/4		request length
1911 	2	CARD16		control type
1912 	1	CARD8		device id
1913 	1			unused
1914 	n			DEVICECONTROL
1915</literallayout>
1916<literallayout class="monospaced">
1917<!-- .TA .2i .5i 1.5i 2.5i -->
1918<!-- .ta .2i .5i 1.5i 2.5i -->
1919DEVICECONTROL		DEVICERESOLUTIONCTL
1920</literallayout>
1921</para>
1922<para>
1923<!-- .LP -->
1924<literallayout class="monospaced">
1925<!-- .TA .2i .5i 1.5i 2.5i -->
1926<!-- .ta .2i .5i 1.5i 2.5i -->
1927DEVICERESOLUTIONCTL
1928 	2	1		control type
1929 	2	8 + 4n		length
1930 	1	CARD8		first_valuator
1931 	1	n    		num_valuators
1932 	2			unused
1933 	4n	LISTOfCARD32	resolution values
1934</literallayout>
1935</para>
1936<para>
1937<!-- .LP -->
1938<literallayout class="monospaced">
1939<!-- .TA .2i .5i 1.5i 3.5i -->
1940<!-- .ta .2i .5i 1.5i 3.5i -->
1941 =&gt;
1942 	1	1			Reply
1943 	1	35			ChangeDeviceControl opcode
1944 	2	CARD16			sequence number
1945 	4	0			reply length
1946 	1	CARD8			status
1947 		0			Success
1948 		1			AlreadyGrabbed
1949 		3 + first_error		DeviceBusy
1950 	23				unused
1951</literallayout>
1952<!-- .ps +2 -->
1953Events
1954<!-- .ps -->
1955</para>
1956<para>
1957<!-- .LP -->
1958DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress, DeviceButtonRelease,
1959ProximityIn, ProximityOut, and DeviceStateNotify  events may be followed by 
1960zero or more DeviceValuator events.  DeviceMotionNotify events will be 
1961followed by one or more DeviceValuator events.
1962</para>
1963<para>
1964<!-- .LP -->
1965<literallayout class="monospaced">
1966<!-- .TA .2i .5i 1.5i 2.5i -->
1967<!-- .ta .2i .5i 1.5i 2.5i -->
1968DeviceValuator
1969	1	CARD8		code
1970	1	CARD8		device id
1971	2	CARD16		sequence number
1972	2	SETofKEYBUTMASK		state
1973	1	n		number of valuators this device reports
1974	1	m		number of first valuator in this event
1975	24	LISTofINT32	valuators
1976</literallayout>
1977</para>
1978<para>
1979<!-- .LP -->
1980<literallayout class="monospaced">
1981<!-- .TA .2i .5i 1.5i 2.5i -->
1982<!-- .ta .2i .5i 1.5i 2.5i -->
1983DeviceKeyPress
1984	1	CARD8		code
1985	1	KEYCODE		detail
1986	2	CARD16		sequence number
1987	4	TIMESTAMP		time
1988	4	WINDOW		root
1989	4	WINDOW		event
1990	4	WINDOW		child
1991		0	None
1992	2	INT16		root-x
1993	2	INT16		root-y
1994	2	INT16		event-x
1995	2	INT16		event-y
1996	2	SETofKEYBUTMASK		state
1997	1	BOOL		same-screen
1998	1	CARD8		device id
1999		#x80		MORE_EVENTS follow
2000</literallayout>
2001</para>
2002<para>
2003<!-- .LP -->
2004<literallayout class="monospaced">
2005<!-- .TA .2i .5i 1.5i 2.5i -->
2006<!-- .ta .2i .5i 1.5i 2.5i -->
2007DeviceKeyRelease
2008	1	CARD8		code
2009	1	KEYCODE		detail
2010	2	CARD16		sequence number
2011	4	TIMESTAMP		time
2012	4	WINDOW		root
2013	4	WINDOW		event
2014	4	WINDOW		child
2015		0	None
2016	2	INT16		root-x
2017	2	INT16		root-y
2018	2	INT16		event-x
2019	2	INT16		event-y
2020	2	SETofKEYBUTMASK			state
2021	1	BOOL		same-screen
2022	1	CARD8		device id
2023		#x80		MORE_EVENTS follow
2024</literallayout>
2025</para>
2026<para>
2027<!-- .LP -->
2028<literallayout class="monospaced">
2029<!-- .TA .2i .5i 1.5i 2.5i -->
2030<!-- .ta .2i .5i 1.5i 2.5i -->
2031DeviceButtonPress
2032	1	CARD8		code
2033	1	BUTTON		detail
2034	2	CARD16		sequence number
2035	4	TIMESTAMP		time
2036	4	WINDOW		root
2037	4	WINDOW		event
2038	4	WINDOW		child
2039		0	None
2040	2	INT16		root-x
2041	2	INT16		root-y
2042	2	INT16		event-x
2043	2	INT16		event-y
2044	2	SETofKEYBUTMASK		state
2045	1	BOOL		same-screen
2046	1	CARD8		device id
2047		#x80		MORE_EVENTS follow
2048</literallayout>
2049</para>
2050<para>
2051<!-- .LP -->
2052<literallayout class="monospaced">
2053<!-- .TA .2i .5i 1.5i 2.5i -->
2054<!-- .ta .2i .5i 1.5i 2.5i -->
2055DeviceButtonRelease
2056	1	CARD8		code
2057	1	BUTTON		detail
2058	2	CARD16		sequence number
2059	4	TIMESTAMP		time
2060	4	WINDOW		root
2061	4	WINDOW		event
2062	4	WINDOW		child
2063		0	None
2064	2	INT16		root-x
2065	2	INT16		root-y
2066	2	INT16		event-x
2067	2	INT16		event-y
2068	2	SETofKEYBUTMASK		state
2069	1	BOOL		same-screen
2070	1	CARD8		device id
2071		#x80		MORE_EVENTS follow
2072</literallayout>
2073</para>
2074<para>
2075<!-- .LP -->
2076<literallayout class="monospaced">
2077<!-- .TA .2i .5i 1.5i 2.5i -->
2078<!-- .ta .2i .5i 1.5i 2.5i -->
2079DeviceMotionNotify
2080	1	CARD8		code
2081	1			detail
2082		0	Normal
2083		1	Hint
2084	2	CARD16		sequence number
2085	4	TIMESTAMP		time
2086	4	WINDOW		root
2087	4	WINDOW		event
2088	4	WINDOW		child
2089	 	0	None
2090	2	INT16		root-x
2091	2	INT16		root-y
2092	2	INT16		event-x
2093	2	INT16		event-y
2094	2	SETofKEYBUTMASK		state
2095	1	BOOL		same-screen
2096	1	CARD8		device id
2097		#x80		MORE_EVENTS follow
2098</literallayout>
2099<literallayout class="monospaced">
2100<!-- .TA .2i .5i 1.5i 2.5i -->
2101<!-- .ta .2i .5i 1.5i 2.5i -->
2102DeviceFocusIn
2103	1	CARD8		code
2104	1			detail
2105		0	Ancestor
2106		1	Virtual
2107		2	Inferior
2108		3	Nonlinear
2109		4	NonlinearVirtual
2110		5	Pointer
2111		6	PointerRoot
2112		7	None
2113	2	CARD16		sequence number
2114	4	TIMESTAMP		time
2115	4	WINDOW		event
2116	1			mode
2117		0	Normal
2118		1	Grab
2119		2	Ungrab
2120		3	WhileGrabbed
2121	1	CARD8		device id
2122	18			unused
2123</literallayout>
2124</para>
2125<para>
2126<!-- .LP -->
2127<literallayout class="monospaced">
2128<!-- .TA .2i .5i 1.5i 2.5i -->
2129<!-- .ta .2i .5i 1.5i 2.5i -->
2130DeviceFocusOut
2131	1	CARD8		code
2132	1			detail
2133		0	Ancestor
2134		1	Virtual
2135		2	Inferior
2136		3	Nonlinear
2137		4	NonlinearVirtual
2138		5	Pointer
2139		6	PointerRoot
2140		7	None
2141	2	CARD16		sequence number
2142	4	TIMESTAMP		time
2143	4	WINDOW		event
2144	1			mode
2145		0	Normal
2146		1	Grab
2147		2	Ungrab
2148		3	WhileGrabbed
2149	1	CARD8		device id
2150	18			unused
2151</literallayout>
2152</para>
2153<para>
2154<!-- .LP -->
2155<literallayout class="monospaced">
2156<!-- .TA .2i .5i 1.5i 2.5i -->
2157<!-- .ta .2i .5i 1.5i 2.5i -->
2158ProximityIn
2159	1	CARD8		code
2160	1			unused
2161	2	CARD16		sequence number
2162	4	TIMESTAMP		time
2163	4	WINDOW		root
2164	4	WINDOW		event
2165	4	WINDOW		child
2166		0	None
2167	2	INT16		root-x
2168	2	INT16		root-y
2169	2	INT16		event-x
2170	2	INT16		event-y
2171	2	SETofKEYBUTMASK			state
2172	1	BOOL		same-screen
2173	1	CARD8		device id
2174		#x80		MORE_EVENTS follow
2175</literallayout>
2176</para>
2177<para>
2178<!-- .LP -->
2179<literallayout class="monospaced">
2180<!-- .TA .2i .5i 1.5i 2.5i -->
2181<!-- .ta .2i .5i 1.5i 2.5i -->
2182ProximityOut
2183	1	CARD8		code
2184	1			unused
2185	2	CARD16		sequence number
2186	4	TIMESTAMP		time
2187	4	WINDOW		root
2188	4	WINDOW		event
2189	4	WINDOW		child
2190		0	None
2191	2	INT16		root-x
2192	2	INT16		root-y
2193	2	INT16		event-x
2194	2	INT16		event-y
2195	2	SETofKEYBUTMASK			state
2196	1	BOOL		same-screen
2197	1	CARD8		device id
2198		#x80		MORE_EVENTS follow
2199</literallayout>
2200</para>
2201<para>
2202<!-- .LP -->
2203DeviceStateNotify events may be immediately followed by zero or one
2204DeviceKeyStateNotify and/ or zero or more DeviceValuator events.
2205</para>
2206<para>
2207<!-- .LP -->
2208<literallayout class="monospaced">
2209<!-- .TA .2i .5i 1.5i 2.5i -->
2210<!-- .ta .2i .5i 1.5i 2.5i -->
2211DeviceStateNotify
2212	1	CARD8		code
2213	1	CARD8		device id
2214		#x80		MORE_EVENTS follow
2215	2	CARD16		sequence number
2216	4	TIMESTAMP		time
2217	1	CARD8		num_keys
2218	1	CARD8		num_buttons
2219	1	CARD8		num_valuators
2220 	1	CARD8		valuator mode and input classes reported
2221 		#x01	reporting keys
2222 		#x02	reporting buttons
2223 		#x04	reporting valuators
2224 		#x40	device mode (0 = Relative, 1 = Absolute)
2225 		#x80	proximity state (0 = InProximity, 1 = OutOfProximity)
2226	4	LISTofCARD8		first 32 keys (if reported)
2227	4	LISTofCARD8		first 32 buttons (if reported)
2228	12	LISTofCARD32		first 3 valuators (if reported)
2229</literallayout>
2230</para>
2231<para>
2232<!-- .LP -->
2233<literallayout class="monospaced">
2234<!-- .TA .2i .5i 1.5i 2.5i -->
2235<!-- .ta .2i .5i 1.5i 2.5i -->
2236DeviceKeyStateNotify
2237	1	CARD8		code
2238	1	CARD8		device id
2239		#x80		MORE_EVENTS follow
2240	2	CARD16		sequence number
2241	28	LISTofCARD8		state of keys 33-255
2242</literallayout>
2243</para>
2244<para>
2245<!-- .LP -->
2246<literallayout class="monospaced">
2247<!-- .TA .2i .5i 1.5i 2.5i -->
2248<!-- .ta .2i .5i 1.5i 2.5i -->
2249DeviceButtonStateNotify
2250	1	CARD8		code
2251	1	CARD8		device id
2252		#x80		MORE_EVENTS follow
2253	2	CARD16		sequence number
2254	28	LISTofCARD8		state of buttons 33-255
2255</literallayout>
2256</para>
2257<para>
2258<!-- .LP -->
2259<literallayout class="monospaced">
2260<!-- .TA .2i .5i 1.5i 2.5i -->
2261<!-- .ta .2i .5i 1.5i 2.5i -->
2262DeviceValuator
2263	1	CARD8		code
2264	1	CARD8		device id
2265	2	CARD16		sequence number
2266	2	SETofKEYBUTMASK		state
2267	1	n		number of valuators this device reports
2268	1	n		number of first valuator in this event
2269	24	LISTofINT32	valuators
2270</literallayout>
2271</para>
2272<para>
2273<!-- .LP -->
2274<literallayout class="monospaced">
2275<!-- .TA .2i .5i 1.5i 2.5i -->
2276<!-- .ta .2i .5i 1.5i 2.5i -->
2277DeviceMappingNotify
2278	1	CARD8		code
2279	1	CARD8		device id
2280	2	CARD16		sequence number
2281	1			request
2282		0	MappingModifier
2283		1	MappingKeyboard
2284		2	MappingPointer
2285	1	KEYCODE		first-keycode
2286	1	CARD8		count
2287	1			unused
2288	4	TIMESTAMP		time
2289	20			unused
2290</literallayout>
2291</para>
2292<!-- .LP -->
2293<literallayout class="monospaced">
2294<!-- .TA .2i .5i 1.5i 2.5i -->
2295<!-- .ta .2i .5i 1.5i 2.5i -->
2296ChangeDeviceNotify
2297	1	CARD8		code
2298	1	CARD8		id of device specified on change request
2299	2	CARD16		sequence number
2300	4	TIMESTAMP		time
2301	1			request
2302		0	NewPointer
2303		1	NewKeyboard
2304	23			unused
2305</literallayout>
2306<!-- .\" print Table of Contents -->
2307<!-- .if o .bp \" blank page to make count even -->
2308<!-- .bp 1 -->
2309<!-- .af PN i -->
2310<!-- .PX -->
2311
2312</appendix>
2313