ch02.xml revision eb411b4b
1<chapter id='Initialization_and_General_Programming_Information'>
2<title>Initialization and General Programming Information</title>
3<sect1 id='Extension_Header_Files'>
4<title>Extension Header Files</title>
5<para>
6The following include files are part of the Xkb standard:
7</para>
8<itemizedlist>
9  <listitem>
10    <para>
11<emphasis>&lt;X11/XKBlib.h&gt;</emphasis>
12    </para>
13    <para><emphasis>XKBlib.h</emphasis>
14is the main header file for Xkb; it declares constants, types, and
15functions.
16    </para>
17  </listitem>
18  <listitem>
19    <para>
20<emphasis>&lt;X11/extensions/XKBstr.h&gt;</emphasis>
21    </para>
22    <para>
23<emphasis>XKBstr.h</emphasis> declares types and
24constants for Xkb. It is included automatically from
25<emphasis>&lt;X11/XKBlib.h&gt;</emphasis>
26; you should never need to reference it directly in your application code.
27    </para>
28  </listitem>
29  <listitem>
30    <para>
31<emphasis>&lt;X11/extensions/XKB.h&gt;</emphasis>
32    </para>
33    <para>
34<emphasis>XKB.h</emphasis>
35defines constants for Xkb. It is included automatically from <emphasis>
36&lt;X11/XKBstr.h&gt;</emphasis>
37; you should never need to reference it directly in your application code.
38    </para>
39  </listitem>
40  <listitem>
41    <para>
42<emphasis>&lt;X11/extensions/XKBgeom.h&gt;</emphasis>
43   </para>
44   <para><emphasis>XKBgeom.h</emphasis>
45declares types, symbolic constants, and functions for manipulating
46keyboard geometry descriptions.
47    </para>
48  </listitem>
49</itemizedlist>
50</sect1>
51<sect1 id='Extension_Name'>
52<title>Extension Name</title>
53<para>
54The name of the Xkb extension is given in <emphasis>
55&lt;X11/extensions/Xkb.h&gt;:</emphasis>
56</para>
57
58<para>
59<emphasis>
60#define XkbName "XKEYBOARD"</emphasis>
61</para>
62
63<para>
64Most extensions to the X protocol are initialized by calling <emphasis>
65XInitExtension</emphasis>
66 and passing the extension name. However, as explained in section 2.4, Xkb
67requires a more complex initialization sequence, and a client program should
68not call <emphasis>
69XInitExtension</emphasis>
70 directly.
71</para>
72</sect1>
73<sect1 id='Determining_Library_Compatibility'>
74<title>Determining Library Compatibility</title>
75<para>
76If an application is dynamically linked, both the X server and the client-side
77X library must contain the Xkb extension in order for the client to use the Xkb
78extension capabilities. Therefore a dynamically linked application must check
79both the library and the server for compatibility before using Xkb function
80calls. A properly written program must check for compatibility between the
81version of the Xkb library that is dynamically loaded and the one used when the
82application was built. It must then check the server version for compatibility
83with the version of Xkb in the library.
84</para>
85<para>
86If your application is statically linked, you must still check for server
87compatibility and may check library compatibility. (It is possible to compile
88against one set of header files and link against a different, incompatible,
89version of the library, although this should not normally occur.)
90</para>
91<para>
92To determine the compatibility of a library at runtime, call <emphasis>
93XkbLibraryVersion</emphasis>.
94</para>
95<informaltable frame='none'>
96<?dbfo keep-together="always" ?>
97<tgroup cols='1' align='left' colsep='0' rowsep='0'>
98<colspec colname='c1' colwidth='1.0*'/>
99<tbody>
100  <row>
101    <entry role='functiondecl'>
102Bool <emphasis>
103XkbLibraryVersion</emphasis>
104(<emphasis>
105lib_major_in_out</emphasis>
106, <emphasis>
107lib_minor_in_out</emphasis>
108)
109    </entry>
110  </row>
111  <row>
112    <entry role='functionargdecl'>
113int *      <emphasis>
114lib_major_in_out;</emphasis>
115                  /* specifies and returns the major Xkb library version. */
116    </entry>
117  </row>
118  <row>
119    <entry role='functionargdecl'>
120int *      <emphasis>
121lib_minor_in_out;</emphasis>
122                  /* specifies and returns the minor Xkb library version. */
123    </entry>
124</row>
125</tbody>
126</tgroup>
127</informaltable>
128
129<para>
130Pass the symbolic value <emphasis>
131XkbMajorVersion</emphasis>
132 in <emphasis>
133lib_major_in_out</emphasis>
134 and <emphasis>
135XkbMinorVersion</emphasis>
136 in <emphasis>
137lib_minor_in_out</emphasis>
138. These arguments represent the version of the library used at compile time.
139The <emphasis>
140XkbLibraryVersion </emphasis>
141function backfills the major and minor version numbers of the library used at
142run time in <emphasis>
143lib_major_in_out</emphasis>
144 and <emphasis>
145lib_minor_in_out</emphasis>
146. If the versions of the compile time and run time libraries are compatible,
147<emphasis>
148XkbLibraryVersion </emphasis>
149returns <emphasis>
150True</emphasis>
151, otherwise, it returns <emphasis>
152False.</emphasis>
153</para>
154
155<para>
156In addition, in order to use the Xkb extension, you must ensure that the
157extension is present in the server and that the server supports the version of
158the extension expected by the client. Use <emphasis>
159XkbQueryExtension</emphasis>
160 to do this, as described in the next section.
161</para>
162
163</sect1>
164<sect1 id='Initializing_the_Keyboard_Extension'>
165<title>Initializing the Keyboard Extension</title>
166<para>
167Call <emphasis>
168XkbQueryExtension</emphasis>
169 to check for the presence and compatibility of the extension in the server and
170to initialize the extension. Because of potential version mismatches, you
171cannot use the generic extension mechanism functions (<emphasis>
172XQueryExtension </emphasis>
173and<emphasis>
174 XInitExtension</emphasis>
175) for checking for the presence of, and initializing the Xkb extension.
176</para>
177
178<para>
179You must call <emphasis>
180XkbQueryExtension</emphasis>
181 or <emphasis>
182XkbOpenDisplay</emphasis>
183 before using any other Xkb library interfaces, unless such usage is explicitly
184allowed in the interface description in this document. The exceptions are:
185<emphasis>
186XkbIgnoreExtension</emphasis>
187, <emphasis>
188XkbLibraryVersion</emphasis>
189, and a handful of audible-bell functions. You should not use any other Xkb
190functions if the extension is not present or is uninitialized. In general,
191calls to Xkb library functions made prior to initializing the Xkb extension
192cause <emphasis>
193BadAccess</emphasis>
194 protocol errors.
195</para>
196
197<para>
198<emphasis>
199XkbQueryExtension</emphasis>
200 both determines whether a compatible Xkb extension is present in the X server
201and initializes the extension when it is present.
202</para>
203
204<informaltable frame='none'>
205<?dbfo keep-together="always" ?>
206<tgroup cols='1' align='left' colsep='0' rowsep='0'>
207<colspec colname='c1' colwidth='1.0*'/>
208<tbody>
209  <row>
210    <entry role='functiondecl'>
211Bool <emphasis>
212XkbQueryExtension</emphasis>
213(<emphasis>
214dpy, opcode_rtrn, event_rtrn, error_rtrn, major_in_out, minor_in_out</emphasis>
215)
216    </entry>
217  </row>
218  <row>
219    <entry role='functionargdecl'>
220Display *      <emphasis>
221dpy;      </emphasis>
222      /* connection to the X server */
223    </entry>
224  </row>
225  <row>
226    <entry role='functionargdecl'>
227int *      <emphasis>
228opcode_rtrn</emphasis>
229;            /* backfilled with the major extension opcode */
230    </entry>
231  </row>
232  <row>
233    <entry role='functionargdecl'>
234int *      <emphasis>
235event_rtrn</emphasis>
236;            /* backfilled with the extension base event code */
237    </entry>
238  </row>
239  <row>
240    <entry role='functionargdecl'>
241int *      <emphasis>
242error_rtrn</emphasis>
243;            /* backfilled with the extension base error code */
244    </entry>
245  </row>
246  <row>
247    <entry role='functionargdecl'>
248int *      <emphasis>
249major_in_out</emphasis>
250;            /* compile time lib major version in, server major version out */
251    </entry>
252  </row>
253  <row>
254    <entry role='functionargdecl'>
255int *      <emphasis>
256minor_in_out;      </emphasis>
257      /* compile time lib min version in, server minor version out */
258    </entry>
259</row>
260</tbody>
261</tgroup>
262</informaltable>
263
264<para>
265The <emphasis>
266XkbQueryExtension</emphasis>
267 function determines whether a compatible version of the X Keyboard Extension
268is present in the server. If a compatible extension is present, <emphasis>
269XkbQueryExtension</emphasis>
270 returns <emphasis>
271True</emphasis>
272; otherwise, it returns <emphasis>
273False</emphasis>
274.
275</para>
276
277<para>
278If a compatible version of Xkb is present, <emphasis>
279XkbQueryExtension</emphasis>
280 initializes the extension. It backfills the major opcode for the keyboard
281extension in <emphasis>
282opcode_rtrn</emphasis>
283, the base event code in <emphasis>
284event_rtrn</emphasis>
285<emphasis>
286, the base error code</emphasis>
287 in <emphasis>
288error_rtrn</emphasis>
289, and the major and minor version numbers of the extension in <emphasis>
290major_in_out</emphasis>
291 and <emphasis>
292minor_in_out</emphasis>
293. The major opcode is reported in the <emphasis>
294req_major</emphasis>
295 fields of some Xkb events. For a discussion of the base event code, see
296section 4.1. <!-- xref -->
297</para>
298
299<para>
300As a convenience, you can use the function <emphasis>
301XkbOpenDisplay</emphasis>
302 to perform these three tasks at once: open a connection to an X server, check
303for a compatible version of the Xkb extension in both the library and the
304server, and initialize the extension for use.
305</para>
306
307<informaltable frame='none'>
308<?dbfo keep-together="always" ?>
309<tgroup cols='1' align='left' colsep='0' rowsep='0'>
310<colspec colname='c1' colwidth='1.0*'/>
311<tbody>
312  <row>
313    <entry role='functiondecl'>
314Display *<emphasis>
315XkbOpenDisplay</emphasis>
316(<emphasis>
317display_name, event_rtrn, error_rtrn, major_in_out, minor_in_out,
318reason_rtrn)</emphasis>
319    </entry>
320  </row>
321  <row>
322    <entry role='functionargdecl'>
323char *      <emphasis>
324display_name</emphasis>
325;      /* hardware display name, which determines the display and
326communications domain to be used */
327    </entry>
328  </row>
329  <row>
330    <entry role='functionargdecl'>
331int *      <emphasis>
332event_rtrn</emphasis>
333;      /* backfilled with the extension base event code */
334    </entry>
335  </row>
336  <row>
337    <entry role='functionargdecl'>
338int *      <emphasis>
339error_rtrn</emphasis>
340;      /* backfilled with the extension base error code */
341    </entry>
342  </row>
343  <row>
344    <entry role='functionargdecl'>
345int *      <emphasis>
346major_in_out</emphasis>
347;      /* compile time lib major version in, server major version out */
348    </entry>
349  </row>
350  <row>
351    <entry role='functionargdecl'>
352int *      <emphasis>
353minor_in_out</emphasis>
354;      /* compile time lib minor version in, server minor version out */
355    </entry>
356  </row>
357  <row>
358    <entry role='functionargdecl'>
359int *      <emphasis>
360reason_rtrn</emphasis>
361;      /* backfilled with a status code */
362    </entry>
363</row>
364</tbody>
365</tgroup>
366</informaltable>
367
368<para>
369<emphasis>
370XkbOpenDisplay </emphasis>
371is a convenience function that opens an X display connection and initializes
372the X keyboard extension. In all cases, upon return <emphasis>
373reason_rtrn</emphasis>
374 contains a status value indicating success or the type of failure. If
375<emphasis>
376major_in_out</emphasis>
377 and <emphasis>
378minor_in_out</emphasis>
379 are not <emphasis>
380NULL</emphasis>
381, <emphasis>
382XkbOpenDisplay</emphasis>
383 first calls <emphasis>
384XkbLibraryVersion</emphasis>
385 to determine whether the client library is compatible, passing it the values
386pointed to by <emphasis>
387major_in_out</emphasis>
388 and <emphasis>
389minor_in_out</emphasis>
390. If the library is incompatible, <emphasis>
391XkbOpenDisplay</emphasis>
392 backfills <emphasis>
393major_in_out</emphasis>
394 and <emphasis>
395minor_in_out</emphasis>
396 with the major and minor extension versions of the library being used and
397returns <emphasis>
398NULL</emphasis>
399. If the library is compatible,<emphasis>
400 XkbOpenDisplay </emphasis>
401next calls <emphasis>
402XOpenDisplay</emphasis>
403 with the <emphasis>
404display_name</emphasis>
405. If this fails, the function returns <emphasis>
406NULL</emphasis>
407. If successful, <emphasis>
408XkbOpenDisplay </emphasis>
409calls <emphasis>
410XkbQueryExtension</emphasis>
411 and<emphasis>
412 </emphasis>
413backfills the major and minor Xkb server extension version numbers in <emphasis>
414major_in_out</emphasis>
415 and <emphasis>
416minor_in_out</emphasis>
417.<emphasis>
418 </emphasis>
419If the server extension version is not compatible with the library extension
420version or if the server extension is not present, <emphasis>
421XkbOpenDisplay </emphasis>
422closes the display and returns <emphasis>
423NULL</emphasis>
424. When successful, the function returns the display connection<emphasis>
425.</emphasis>
426</para>
427
428<para>
429The possible values for <emphasis>
430reason_rtrn</emphasis> are:
431</para>
432
433<itemizedlist>
434<listitem>
435  <para>
436<emphasis>
437XkbOD_BadLibraryVersion</emphasis>
438 indicates <emphasis>
439XkbLibraryVersion </emphasis>
440returned <emphasis>
441False</emphasis>.
442  </para>
443</listitem>
444<listitem>
445  <para>
446<emphasis>
447XkbOD_ConnectionRefused</emphasis>
448 indicates the display could not be opened.
449  </para>
450</listitem>
451<listitem>
452  <para>
453<emphasis>
454XkbOD_BadServerVersion</emphasis>
455 indicates the library and the server have incompatible extension versions.
456  </para>
457</listitem>
458<listitem>
459  <para>
460<emphasis>
461XkbOD_NonXkbServer</emphasis>
462 indicates the extension is not present in the X server.
463  </para>
464</listitem>
465<listitem>
466  <para>
467<emphasis>
468XkbOD_Success</emphasis>
469 indicates that the function succeeded.
470  </para>
471</listitem>
472</itemizedlist>
473</sect1>
474
475<sect1 id='Disabling_the_Keyboard_Extension'>
476<title>Disabling the Keyboard Extension</title>
477<para>
478If a server supports the Xkb extension, the X library normally implements
479preXkb keyboard functions using the Xkb keyboard description and state. The
480server Xkb keyboard state may differ from the preXkb keyboard state. This
481difference does not affect most clients, but there are exceptions. To allow
482these clients to work properly, you may instruct the extension not to use Xkb
483functionality.
484</para>
485
486<para>
487Call <emphasis>
488XkbIgnoreExtension</emphasis>
489 to prevent core X library keyboard functions from using the X Keyboard
490Extension. You must call <emphasis>
491XkbIgnoreExtension</emphasis>
492 before you open a server connection; Xkb does not provide a way to enable or
493disable use of the extension once a connection is established.
494</para>
495
496<informaltable frame='none'>
497<?dbfo keep-together="always" ?>
498<tgroup cols='1' align='left' colsep='0' rowsep='0'>
499<colspec colname='c1' colwidth='1.0*'/>
500<tbody>
501  <row>
502    <entry role='functiondecl'>
503Bool<emphasis>
504 XkbIgnoreExtension</emphasis>
505(<emphasis>
506ignore</emphasis>
507)
508    </entry>
509  </row>
510  <row>
511    <entry role='functionargdecl'>
512Bool      <emphasis>
513ignore</emphasis>
514;      /* <emphasis>
515True</emphasis>
516 means ignore the extension */
517    </entry>
518</row>
519</tbody>
520</tgroup>
521</informaltable>
522
523<para>
524<emphasis>
525XkbIgnoreExtension</emphasis>
526 tells the X library whether to use the X Keyboard Extension on any
527subsequently opened X display connections. If ignore is <emphasis>
528True</emphasis>
529, the library does not initialize the Xkb extension when it opens a new
530display. This forces the X server to use compatibility mode and communicate
531with the client using only core protocol requests and events. If ignore is
532<emphasis>
533False</emphasis>
534, the library treats subsequent calls to <emphasis>
535XOpenDisplay</emphasis>
536 normally and uses Xkb extension requests, events, and state. Do not explicitly
537use Xkb on a connection for which it is disabled.<emphasis>
538 XkbIgnoreExtension</emphasis>
539 returns <emphasis>
540False</emphasis>
541 if it was unable to apply the ignore request.
542</para>
543
544</sect1>
545<sect1 id='Protocol_Errors'>
546<title>Protocol Errors</title>
547<para>
548Many of the Xkb extension library functions described in this document can
549cause the X server to report an error, referred to in this document as a
550<emphasis>
551BadXxx</emphasis>
552 protocol error, where <emphasis>
553Xxx</emphasis>
554 is some name. These errors are fielded in the normal manner, by the default
555Xlib error handler or one replacing it. Note that X protocol errors are not
556necessarily reported immediately because of the buffering of X protocol
557requests in Xlib and the server.
558</para>
559
560<para>
561Table 2.1 lists the protocol errors that can be generated, and their causes. <!-- xref -->
562</para>
563
564<table frame='topbot'>
565<title>Xkb Protocol Errors</title>
566<?dbfo keep-together="always" ?>
567<tgroup cols='2' align='left' colsep='0' rowsep='0'>
568<colspec colname='c1' colwidth='1.0*'/>
569<colspec colname='c2' colwidth='3.0*'/>
570<thead>
571  <row rowsep='1'>
572    <entry>Error</entry>
573    <entry>Cause</entry>
574  </row>
575</thead>
576<tbody>
577  <row>
578    <entry>BadAccess</entry>
579    <entry>
580<para>
581The Xkb extension has not been properly initialized
582</para>
583    </entry>
584  </row>
585  <row>
586    <entry>BadKeyboard</entry>
587    <entry>
588<para>
589The device specified was not a valid core or input extension device
590</para>
591    </entry>
592  </row>
593  <row>
594    <entry>BadImplementation</entry>
595    <entry>
596<para>
597Invalid reply from server
598</para>
599    </entry>
600  </row>
601  <row>
602    <entry>BadAlloc</entry>
603    <entry>
604<para>
605Unable to allocate storage
606</para>
607    </entry>
608  </row>
609  <row>
610    <entry>BadMatch</entry>
611    <entry>
612<para>
613A compatible version of Xkb was not available in the server or an argument has
614correct type and range, but is otherwise invalid
615</para>
616    </entry>
617  </row>
618  <row>
619    <entry>BadValue</entry>
620    <entry>
621<para>
622An argument is out of range
623</para>
624    </entry>
625  </row>
626  <row>
627    <entry>BadAtom</entry>
628    <entry>
629<para>
630A name is neither a valid Atom or <emphasis>
631None</emphasis>
632</para>
633    </entry>
634  </row>
635  <row>
636    <entry>BadDevice</entry>
637    <entry>
638<para>
639Device, Feedback Class, or Feedback ID invalid
640</para>
641    </entry>
642  </row>
643</tbody>
644</tgroup>
645</table>
646
647<para>
648The Xkb extension adds a single protocol error, <emphasis>
649BadKeyboard</emphasis>
650, to the core protocol error set. This error code will be reported as the
651<emphasis>
652error_rtrn</emphasis>
653 when <emphasis>
654XkbQueryExtension</emphasis>
655 is called. When a <emphasis>
656BadKeyboard</emphasis>
657 error is reported in an <emphasis>
658XErrorEvent</emphasis>
659, additional information is reported in the <emphasis>
660resource_id</emphasis>
661 field. The most significant byte of the <emphasis>
662resource_id</emphasis>
663 is a further refinement of the error cause, as defined in Table 2.2. The least
664significant byte will contain the device, class, or feedback ID as indicated in
665the table.
666</para>
667
668<table frame='topbot'>
669<title>BadKeyboard Protocol Error resource_id Values</title>
670<?dbfo keep-together="always" ?>
671<tgroup cols='4' align='left' colsep='0' rowsep='0'>
672<colspec colname='c1' colwidth='2.0*'/>
673<colspec colname='c2' colwidth='1.0*'/>
674<colspec colname='c3' colwidth='3.0*'/>
675<colspec colname='c4' colwidth='2.0*'/>
676<thead>
677  <row rowsep='1'>
678    <entry>high-order byte</entry>
679    <entry>value</entry>
680    <entry>meaning</entry>
681    <entry>low-order byte</entry>
682  </row>
683</thead>
684<tbody>
685  <row>
686    <entry>XkbErr_BadDevice</entry>
687    <entry>0xff</entry>
688    <entry>
689<para>
690device not found
691</para>
692    </entry>
693    <entry>device ID</entry>
694  </row>
695  <row>
696    <entry>XkbErr_BadClass</entry>
697    <entry>0xfe</entry>
698    <entry>
699<para>
700device found, but it is of the wrong class
701</para>
702    </entry>
703    <entry>class ID</entry>
704  </row>
705  <row>
706    <entry>XkbErr_BadId</entry>
707    <entry>0xfd</entry>
708    <entry>
709<para>
710device found, class ok, but device does not contain a feedback with the
711indicated ID
712</para>
713    </entry>
714    <entry>feedback ID</entry>
715  </row>
716</tbody>
717</tgroup>
718</table>
719</sect1>
720
721<sect1 id='Display_and_Device_Specifications_in_Function_Calls'>
722<title>Display and Device Specifications in Function Calls</title>
723<para>
724Where a connection to the server is passed as an argument (Display*) and an
725<emphasis>
726XkbDescPtr</emphasis>
727 is also passed as an argument, the Display* argument must match the <emphasis>
728dpy</emphasis>
729 field of the <emphasis>
730XkbDescRec</emphasis>
731 pointed to by the <emphasis>
732XkbDescPtr</emphasis>
733 argument, or else the <emphasis>
734dpy</emphasis>
735 field of the <emphasis>
736XkbDescRec</emphasis>
737 must be <emphasis>
738NULL</emphasis>
739. If they don’t match or the <emphasis>
740dpy</emphasis>
741 field is not <emphasis>
742NULL</emphasis>
743, a <emphasis>
744BadMatch</emphasis>
745 error is returned (either in the return value or a backfilled <emphasis>
746Status</emphasis>
747 variable). Upon successful return, the <emphasis>
748dpy</emphasis>
749 field of the <emphasis>
750XkbDescRec</emphasis>
751 always contains the Display* value passed in.
752</para>
753
754<para>
755The Xkb extension can communicate with the X input extension if it is present.
756Consequently, there can potentially be more than one input device connected to
757the server. Most Xkb library calls that require communicating with the server
758involve both a server connection (Display * <emphasis>
759dpy</emphasis>
760) and a device identifier (unsigned int <emphasis>
761device_spec</emphasis>
762). In some cases, the device identifier is implicit and is taken as the
763<emphasis>
764device_spec</emphasis>
765 field of an <emphasis>
766XkbDescRec</emphasis>
767 structure passed as an argument.
768</para>
769
770<para>
771The device identifier can specify any X input extension device with a <emphasis>
772KeyClass</emphasis>
773 component, or it can specify the constant, <emphasis>
774XkbUseCoreKbd</emphasis>
775. The use of <emphasis>
776XkbUseCoreKbd</emphasis>
777 allows applications to indicate the core keyboard without having to determine
778its device identifier.
779</para>
780
781<para>
782Where an Xkb device identifier is passed as an argument and an <emphasis>
783XkbDescPtr</emphasis>
784 is also passed as an argument, if either the argument or the <emphasis>
785XkbDescRec</emphasis>
786 <emphasis>
787device_spec</emphasis>
788 field is <emphasis>
789XkbUseCoreKbd</emphasis>
790, and if the function returns successfully, the <emphasis>
791XkbDescPtr</emphasis>
792 <emphasis>
793device_spec</emphasis>
794 field will have been converted from <emphasis>
795XkbUseCoreKbd</emphasis>
796 to a real Xkb device ID. If the function does not complete successfully, the
797<emphasis>
798device_spec</emphasis>
799 field remains unchanged. Subsequently, the device id argument must match the
800<emphasis>
801device_spec</emphasis>
802 field of the <emphasis>
803XkbDescPtr</emphasis>
804 argument. If they don’t match, a <emphasis>
805BadMatch</emphasis>
806 error is returned (either in the return value or a backfilled <emphasis>
807Status</emphasis>
808 variable).
809</para>
810
811<para>
812When the Xkb extension in the server hands an application a device identifier
813to use for the keyboard, that ID is the input extension identifier for the
814device if the server supports the X Input Extension. If the server does not
815support the input extension, the meaning of the identifier is undefined — the
816only guarantee is that when you use <emphasis>
817XkbUseCoreKbd</emphasis>
818, <emphasis>
819XkbUseCoreKbd</emphasis>
820 will work and the identifier returned by the server will refer to the core
821keyboard device.
822</para>
823</sect1>
824</chapter>
825