2011-10-07 22:52:30 -06:00
|
|
|
|
<chapter id='Initialization_and_General_Programming_Information'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>Initialization and General Programming Information</title>
|
2011-10-07 22:52:30 -06:00
|
|
|
|
<sect1 id='Extension_Header_Files'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>Extension Header Files</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
The following include files are part of the Xkb standard:
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
2014-07-06 12:15:23 -07:00
|
|
|
|
<filename class="headerfile"><X11/XKBlib.h></filename>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
2014-07-06 12:15:23 -07:00
|
|
|
|
<para><filename class="headerfile">XKBlib.h</filename>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
is the main header file for Xkb; it declares constants, types, and
|
|
|
|
|
|
functions.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
2014-07-06 12:15:23 -07:00
|
|
|
|
<filename class="headerfile"><X11/extensions/XKBstr.h></filename>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
2014-07-06 12:15:23 -07:00
|
|
|
|
<filename class="headerfile">XKBstr.h</filename> declares types and
|
2010-11-30 10:52:07 -05:00
|
|
|
|
constants for Xkb. It is included automatically from
|
2014-07-06 12:15:23 -07:00
|
|
|
|
<filename class="headerfile"><X11/XKBlib.h></filename>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
; you should never need to reference it directly in your application code.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
2014-07-06 12:15:23 -07:00
|
|
|
|
<filename class="headerfile"><X11/extensions/XKB.h></filename>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
2014-07-06 12:15:23 -07:00
|
|
|
|
<filename class="headerfile">XKB.h</filename>
|
|
|
|
|
|
defines constants for Xkb. It is included automatically from
|
|
|
|
|
|
<filename class="headerfile"><X11/XKBstr.h></filename>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
; you should never need to reference it directly in your application code.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
2014-07-06 12:15:23 -07:00
|
|
|
|
<filename class="headerfile"><X11/extensions/XKBgeom.h></filename>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
2014-07-06 12:15:23 -07:00
|
|
|
|
<para><filename class="headerfile">XKBgeom.h</filename>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
declares types, symbolic constants, and functions for manipulating
|
|
|
|
|
|
keyboard geometry descriptions.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
</sect1>
|
2011-10-07 22:52:30 -06:00
|
|
|
|
<sect1 id='Extension_Name'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>Extension Name</title>
|
|
|
|
|
|
<para>
|
2014-07-06 12:15:23 -07:00
|
|
|
|
The name of the Xkb extension is given in
|
|
|
|
|
|
<filename class="headerfile"><X11/extensions/Xkb.h></filename>:
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>#define XkbName "XKEYBOARD"</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
Most extensions to the X protocol are initialized by calling
|
|
|
|
|
|
<emphasis>XInitExtension</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
and passing the extension name. However, as explained in section 2.4, Xkb
|
|
|
|
|
|
requires a more complex initialization sequence, and a client program should
|
2014-07-06 20:25:46 -07:00
|
|
|
|
not call
|
|
|
|
|
|
<emphasis>XInitExtension</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
directly.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</sect1>
|
2011-10-07 22:52:30 -06:00
|
|
|
|
<sect1 id='Determining_Library_Compatibility'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>Determining Library Compatibility</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
If an application is dynamically linked, both the X server and the client-side
|
|
|
|
|
|
X library must contain the Xkb extension in order for the client to use the Xkb
|
|
|
|
|
|
extension capabilities. Therefore a dynamically linked application must check
|
|
|
|
|
|
both the library and the server for compatibility before using Xkb function
|
|
|
|
|
|
calls. A properly written program must check for compatibility between the
|
|
|
|
|
|
version of the Xkb library that is dynamically loaded and the one used when the
|
|
|
|
|
|
application was built. It must then check the server version for compatibility
|
|
|
|
|
|
with the version of Xkb in the library.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
If your application is statically linked, you must still check for server
|
|
|
|
|
|
compatibility and may check library compatibility. (It is possible to compile
|
|
|
|
|
|
against one set of header files and link against a different, incompatible,
|
|
|
|
|
|
version of the library, although this should not normally occur.)
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
To determine the compatibility of a library at runtime, call
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbLibraryVersion</function>.
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
2014-07-06 15:57:41 -07:00
|
|
|
|
<indexterm significance="preferred" zone="XkbLibraryVersion"><primary><function>XkbLibraryVersion</function></primary></indexterm>
|
|
|
|
|
|
<funcsynopsis id="XkbLibraryVersion">
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
|
<funcdef>Bool <function>XkbLibraryVersion</function></funcdef>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<!-- (
|
|
|
|
|
|
<emphasis>lib_major_in_out</emphasis>,
|
|
|
|
|
|
<emphasis>lib_minor_in_out</emphasis>
|
2014-07-06 15:57:41 -07:00
|
|
|
|
) -->
|
|
|
|
|
|
|
|
|
|
|
|
<paramdef>int *<parameter>lib_major_in_out</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>lib_minor_in_out</parameter></paramdef>
|
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>lib_major_in_out</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
specifies and returns the major Xkb library version.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>lib_minor_in_out</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
specifies and returns the minor Xkb library version.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
</variablelist>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
Pass the symbolic value
|
|
|
|
|
|
<emphasis>XkbMajorVersion</emphasis>
|
|
|
|
|
|
in
|
|
|
|
|
|
<emphasis>lib_major_in_out</emphasis>
|
|
|
|
|
|
and
|
|
|
|
|
|
<emphasis>XkbMinorVersion</emphasis>
|
|
|
|
|
|
in
|
|
|
|
|
|
<emphasis>lib_minor_in_out</emphasis>.
|
|
|
|
|
|
These arguments represent the version of the library used at compile time.
|
|
|
|
|
|
The
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbLibraryVersion</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
function backfills the major and minor version numbers of the library used at
|
2014-07-06 20:25:46 -07:00
|
|
|
|
run time in
|
|
|
|
|
|
<emphasis>lib_major_in_out</emphasis>
|
|
|
|
|
|
and
|
|
|
|
|
|
<emphasis>lib_minor_in_out</emphasis>.
|
|
|
|
|
|
If the versions of the compile time and run time libraries are compatible,
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbLibraryVersion</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
returns
|
|
|
|
|
|
<emphasis>True</emphasis>,
|
|
|
|
|
|
otherwise, it returns
|
|
|
|
|
|
<emphasis>False</emphasis>.
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
|
In addition, in order to use the Xkb extension, you must ensure that the
|
|
|
|
|
|
extension is present in the server and that the server supports the version of
|
2014-07-06 20:25:46 -07:00
|
|
|
|
the extension expected by the client. Use
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbQueryExtension</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
to do this, as described in the next section.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
</sect1>
|
2011-10-07 22:52:30 -06:00
|
|
|
|
<sect1 id='Initializing_the_Keyboard_Extension'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>Initializing the Keyboard Extension</title>
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
Call
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbQueryExtension</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
to check for the presence and compatibility of the extension in the server and
|
|
|
|
|
|
to initialize the extension. Because of potential version mismatches, you
|
2014-07-06 20:25:46 -07:00
|
|
|
|
cannot use the generic extension mechanism functions (
|
|
|
|
|
|
<emphasis>XQueryExtension </emphasis>
|
|
|
|
|
|
and
|
|
|
|
|
|
<emphasis>XInitExtension</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
) for checking for the presence of, and initializing the Xkb extension.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
You must call
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbQueryExtension</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
or
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbOpenDisplay</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
before using any other Xkb library interfaces, unless such usage is explicitly
|
|
|
|
|
|
allowed in the interface description in this document. The exceptions are:
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbIgnoreExtension</function>,
|
|
|
|
|
|
<function>XkbLibraryVersion</function>,
|
2014-07-06 20:25:46 -07:00
|
|
|
|
and a handful of audible-bell functions. You should not use any other Xkb
|
2010-11-30 10:52:07 -05:00
|
|
|
|
functions if the extension is not present or is uninitialized. In general,
|
|
|
|
|
|
calls to Xkb library functions made prior to initializing the Xkb extension
|
2014-07-06 20:25:46 -07:00
|
|
|
|
cause
|
|
|
|
|
|
<emphasis>BadAccess</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
protocol errors.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbQueryExtension</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
both determines whether a compatible Xkb extension is present in the X server
|
|
|
|
|
|
and initializes the extension when it is present.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
2014-07-06 15:57:41 -07:00
|
|
|
|
<indexterm significance="preferred" zone="XkbQueryExtension"><primary><function>XkbQueryExtension</function></primary></indexterm>
|
|
|
|
|
|
<funcsynopsis id="XkbQueryExtension">
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
|
<funcdef>Bool <function>XkbQueryExtension</function></funcdef>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<!-- (
|
|
|
|
|
|
<emphasis>dpy, opcode_rtrn, event_rtrn, error_rtrn, major_in_out, minor_in_out</emphasis>
|
2014-07-06 15:57:41 -07:00
|
|
|
|
) -->
|
|
|
|
|
|
|
|
|
|
|
|
<paramdef>Display *<parameter>dpy</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>opcode_rtrn</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>event_rtrn</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>error_rtrn</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>major_in_out</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>minor_in_out</parameter></paramdef>
|
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>dpy</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
connection to the X server
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>opcode_rtrn</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
backfilled with the major extension opcode
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>event_rtrn</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
backfilled with the extension base event code
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>error_rtrn</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
backfilled with the extension base error code
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>major_in_out</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
compile time lib major version in, server major version out
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>minor_in_out</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
compile time lib min version in, server minor version out
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
</variablelist>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
The
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbQueryExtension</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
function determines whether a compatible version of the X Keyboard Extension
|
2014-07-06 20:25:46 -07:00
|
|
|
|
is present in the server. If a compatible extension is present,
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbQueryExtension</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
returns
|
|
|
|
|
|
<emphasis>True</emphasis>
|
|
|
|
|
|
; otherwise, it returns
|
|
|
|
|
|
<emphasis>False</emphasis>.
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
If a compatible version of Xkb is present,
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbQueryExtension</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
initializes the extension. It backfills the major opcode for the keyboard
|
2014-07-06 20:25:46 -07:00
|
|
|
|
extension in
|
|
|
|
|
|
<emphasis>opcode_rtrn</emphasis>,
|
|
|
|
|
|
the base event code in
|
|
|
|
|
|
<emphasis>event_rtrn</emphasis>
|
|
|
|
|
|
<emphasis>,
|
|
|
|
|
|
the base error code</emphasis>
|
|
|
|
|
|
in
|
|
|
|
|
|
<emphasis>error_rtrn</emphasis>,
|
|
|
|
|
|
and the major and minor version numbers of the extension in
|
|
|
|
|
|
<emphasis>major_in_out</emphasis>
|
|
|
|
|
|
and
|
|
|
|
|
|
<emphasis>minor_in_out</emphasis>.
|
|
|
|
|
|
The major opcode is reported in the
|
|
|
|
|
|
<emphasis>req_major</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
fields of some Xkb events. For a discussion of the base event code, see
|
|
|
|
|
|
section 4.1. <!-- xref -->
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
As a convenience, you can use the function
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbOpenDisplay</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
to perform these three tasks at once: open a connection to an X server, check
|
|
|
|
|
|
for a compatible version of the Xkb extension in both the library and the
|
|
|
|
|
|
server, and initialize the extension for use.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
2014-07-06 15:57:41 -07:00
|
|
|
|
<indexterm significance="preferred" zone="XkbOpenDisplay"><primary><function>XkbOpenDisplay</function></primary></indexterm>
|
|
|
|
|
|
<funcsynopsis id="XkbOpenDisplay">
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
|
<funcdef>Display *<function>XkbOpenDisplay</function></funcdef>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<!-- (
|
|
|
|
|
|
<emphasis>display_name, event_rtrn, error_rtrn, major_in_out, minor_in_out,
|
2014-07-06 15:57:41 -07:00
|
|
|
|
reason_rtrn)</emphasis> -->
|
|
|
|
|
|
|
|
|
|
|
|
<paramdef>char *<parameter>display_name</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>event_rtrn</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>error_rtrn</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>major_in_out</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>minor_in_out</parameter></paramdef>
|
|
|
|
|
|
<paramdef>int *<parameter>reason_rtrn</parameter></paramdef>
|
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>display_name</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
hardware display name, which determines the display and
|
|
|
|
|
|
communications domain to be used
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>event_rtrn</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
backfilled with the extension base event code
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>error_rtrn</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
backfilled with the extension base error code
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>major_in_out</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
compile time lib major version in, server major version out
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>minor_in_out</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
compile time lib minor version in, server minor version out
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>reason_rtrn</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
backfilled with a status code
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
</variablelist>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbOpenDisplay</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
is a convenience function that opens an X display connection and initializes
|
2014-07-06 20:25:46 -07:00
|
|
|
|
the X keyboard extension. In all cases, upon return
|
|
|
|
|
|
<emphasis>reason_rtrn</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
contains a status value indicating success or the type of failure. If
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>major_in_out</emphasis>
|
|
|
|
|
|
and
|
|
|
|
|
|
<emphasis>minor_in_out</emphasis>
|
|
|
|
|
|
are not
|
|
|
|
|
|
<emphasis>NULL</emphasis>,
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbOpenDisplay</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
first calls
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbLibraryVersion</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
to determine whether the client library is compatible, passing it the values
|
2014-07-06 20:25:46 -07:00
|
|
|
|
pointed to by
|
|
|
|
|
|
<emphasis>major_in_out</emphasis>
|
|
|
|
|
|
and
|
|
|
|
|
|
<emphasis>minor_in_out</emphasis>.
|
|
|
|
|
|
If the library is incompatible,
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbOpenDisplay</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
backfills
|
|
|
|
|
|
<emphasis>major_in_out</emphasis>
|
|
|
|
|
|
and
|
|
|
|
|
|
<emphasis>minor_in_out</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
with the major and minor extension versions of the library being used and
|
2014-07-06 20:25:46 -07:00
|
|
|
|
returns
|
|
|
|
|
|
<emphasis>NULL</emphasis>.
|
|
|
|
|
|
If the library is compatible,
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbOpenDisplay</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
next calls
|
|
|
|
|
|
<emphasis>XOpenDisplay</emphasis>
|
|
|
|
|
|
with the
|
|
|
|
|
|
<emphasis>display_name</emphasis>.
|
|
|
|
|
|
If this fails, the function returns
|
|
|
|
|
|
<emphasis>NULL</emphasis>.
|
|
|
|
|
|
If successful,
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbOpenDisplay</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
calls
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbQueryExtension</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
and
|
|
|
|
|
|
backfills the major and minor Xkb server extension version numbers in
|
|
|
|
|
|
<emphasis>major_in_out</emphasis>
|
|
|
|
|
|
and
|
|
|
|
|
|
<emphasis>minor_in_out</emphasis>.
|
2010-11-30 10:52:07 -05:00
|
|
|
|
If the server extension version is not compatible with the library extension
|
2014-07-06 20:25:46 -07:00
|
|
|
|
version or if the server extension is not present,
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbOpenDisplay</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
closes the display and returns
|
|
|
|
|
|
<emphasis>NULL</emphasis>.
|
|
|
|
|
|
When successful, the function returns the display connection.
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
The possible values for
|
|
|
|
|
|
<emphasis>reason_rtrn</emphasis> are:
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>XkbOD_BadLibraryVersion</emphasis>
|
|
|
|
|
|
indicates
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbLibraryVersion</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
returned
|
|
|
|
|
|
<emphasis>False</emphasis>.
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>XkbOD_ConnectionRefused</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
indicates the display could not be opened.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>XkbOD_BadServerVersion</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
indicates the library and the server have incompatible extension versions.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>XkbOD_NonXkbServer</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
indicates the extension is not present in the X server.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>XkbOD_Success</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
indicates that the function succeeded.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
2011-10-07 22:52:30 -06:00
|
|
|
|
<sect1 id='Disabling_the_Keyboard_Extension'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>Disabling the Keyboard Extension</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
If a server supports the Xkb extension, the X library normally implements
|
|
|
|
|
|
preXkb keyboard functions using the Xkb keyboard description and state. The
|
|
|
|
|
|
server Xkb keyboard state may differ from the preXkb keyboard state. This
|
|
|
|
|
|
difference does not affect most clients, but there are exceptions. To allow
|
|
|
|
|
|
these clients to work properly, you may instruct the extension not to use Xkb
|
|
|
|
|
|
functionality.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
Call
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbIgnoreExtension</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
to prevent core X library keyboard functions from using the X Keyboard
|
2014-07-06 20:25:46 -07:00
|
|
|
|
Extension. You must call
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbIgnoreExtension</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
before you open a server connection; Xkb does not provide a way to enable or
|
|
|
|
|
|
disable use of the extension once a connection is established.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
2014-07-06 15:57:41 -07:00
|
|
|
|
<indexterm significance="preferred" zone="XkbIgnoreExtension"><primary><function>XkbIgnoreExtension</function></primary></indexterm>
|
|
|
|
|
|
<funcsynopsis id="XkbIgnoreExtension">
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
|
<funcdef>Bool <function>XkbIgnoreExtension</function></funcdef>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<!-- (
|
|
|
|
|
|
<emphasis>ignore</emphasis>
|
2014-07-06 15:57:41 -07:00
|
|
|
|
) -->
|
|
|
|
|
|
|
|
|
|
|
|
<paramdef>Bool <parameter>ignore</parameter></paramdef>
|
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
|
<varlistentry>
|
|
|
|
|
|
<term>
|
|
|
|
|
|
<parameter>ignore</parameter>
|
|
|
|
|
|
</term>
|
|
|
|
|
|
<listitem>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
<emphasis>True</emphasis> means ignore the extension
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</listitem>
|
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
</variablelist>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbIgnoreExtension</function>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
tells the X library whether to use the X Keyboard Extension on any
|
2014-07-06 20:25:46 -07:00
|
|
|
|
subsequently opened X display connections. If ignore is
|
|
|
|
|
|
<emphasis>True</emphasis>,
|
|
|
|
|
|
the library does not initialize the Xkb extension when it opens a new
|
2010-11-30 10:52:07 -05:00
|
|
|
|
display. This forces the X server to use compatibility mode and communicate
|
|
|
|
|
|
with the client using only core protocol requests and events. If ignore is
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>False</emphasis>,
|
|
|
|
|
|
the library treats subsequent calls to
|
|
|
|
|
|
<emphasis>XOpenDisplay</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
normally and uses Xkb extension requests, events, and state. Do not explicitly
|
2014-07-06 20:25:46 -07:00
|
|
|
|
use Xkb on a connection for which it is disabled.
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbIgnoreExtension</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
returns
|
|
|
|
|
|
<emphasis>False</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
if it was unable to apply the ignore request.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
</sect1>
|
2011-10-07 22:52:30 -06:00
|
|
|
|
<sect1 id='Protocol_Errors'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>Protocol Errors</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Many of the Xkb extension library functions described in this document can
|
|
|
|
|
|
cause the X server to report an error, referred to in this document as a
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>BadXxx</emphasis>
|
|
|
|
|
|
protocol error, where
|
|
|
|
|
|
<emphasis>Xxx</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
is some name. These errors are fielded in the normal manner, by the default
|
|
|
|
|
|
Xlib error handler or one replacing it. Note that X protocol errors are not
|
|
|
|
|
|
necessarily reported immediately because of the buffering of X protocol
|
|
|
|
|
|
requests in Xlib and the server.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Table 2.1 lists the protocol errors that can be generated, and their causes. <!-- xref -->
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<table frame='topbot'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>Xkb Protocol Errors</title>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<?dbfo keep-together="always" ?>
|
|
|
|
|
|
<tgroup cols='2' align='left' colsep='0' rowsep='0'>
|
|
|
|
|
|
<colspec colname='c1' colwidth='1.0*'/>
|
|
|
|
|
|
<colspec colname='c2' colwidth='3.0*'/>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<thead>
|
|
|
|
|
|
<row rowsep='1'>
|
|
|
|
|
|
<entry>Error</entry>
|
|
|
|
|
|
<entry>Cause</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>BadAccess</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
The Xkb extension has not been properly initialized
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
</row>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>BadKeyboard</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
The device specified was not a valid core or input extension device
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
</row>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>BadImplementation</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Invalid reply from server
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
</row>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>BadAlloc</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Unable to allocate storage
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
</row>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>BadMatch</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
A compatible version of Xkb was not available in the server or an argument has
|
|
|
|
|
|
correct type and range, but is otherwise invalid
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
</row>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>BadValue</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
An argument is out of range
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
</row>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>BadAtom</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
A name is neither a valid Atom or
|
|
|
|
|
|
<emphasis>None</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
</row>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>BadDevice</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Device, Feedback Class, or Feedback ID invalid
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</tgroup>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
The Xkb extension adds a single protocol error,
|
|
|
|
|
|
<emphasis>BadKeyboard</emphasis>,
|
|
|
|
|
|
to the core protocol error set. This error code will be reported as the
|
|
|
|
|
|
<emphasis>error_rtrn</emphasis>
|
|
|
|
|
|
when
|
2014-07-06 20:34:51 -07:00
|
|
|
|
<function>XkbQueryExtension</function>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
is called. When a
|
|
|
|
|
|
<emphasis>BadKeyboard</emphasis>
|
|
|
|
|
|
error is reported in an
|
|
|
|
|
|
<emphasis>XErrorEvent</emphasis>,
|
|
|
|
|
|
additional information is reported in the
|
|
|
|
|
|
<emphasis>resource_id</emphasis>
|
|
|
|
|
|
field. The most significant byte of the
|
|
|
|
|
|
<emphasis>resource_id</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
is a further refinement of the error cause, as defined in Table 2.2. The least
|
|
|
|
|
|
significant byte will contain the device, class, or feedback ID as indicated in
|
|
|
|
|
|
the table.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<table frame='topbot'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>BadKeyboard Protocol Error resource_id Values</title>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<?dbfo keep-together="always" ?>
|
|
|
|
|
|
<tgroup cols='4' align='left' colsep='0' rowsep='0'>
|
|
|
|
|
|
<colspec colname='c1' colwidth='2.0*'/>
|
|
|
|
|
|
<colspec colname='c2' colwidth='1.0*'/>
|
|
|
|
|
|
<colspec colname='c3' colwidth='3.0*'/>
|
|
|
|
|
|
<colspec colname='c4' colwidth='2.0*'/>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<thead>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row rowsep='1'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>high-order byte</entry>
|
|
|
|
|
|
<entry>value</entry>
|
|
|
|
|
|
<entry>meaning</entry>
|
|
|
|
|
|
<entry>low-order byte</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>XkbErr_BadDevice</entry>
|
|
|
|
|
|
<entry>0xff</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
device not found
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
<entry>device ID</entry>
|
|
|
|
|
|
</row>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>XkbErr_BadClass</entry>
|
|
|
|
|
|
<entry>0xfe</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
device found, but it is of the wrong class
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
<entry>class ID</entry>
|
|
|
|
|
|
</row>
|
2012-01-21 17:59:51 -07:00
|
|
|
|
<row>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<entry>XkbErr_BadId</entry>
|
|
|
|
|
|
<entry>0xfd</entry>
|
|
|
|
|
|
<entry>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
device found, class ok, but device does not contain a feedback with the
|
|
|
|
|
|
indicated ID
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</entry>
|
|
|
|
|
|
<entry>feedback ID</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</tgroup>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
2011-10-07 22:52:30 -06:00
|
|
|
|
<sect1 id='Display_and_Device_Specifications_in_Function_Calls'>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
<title>Display and Device Specifications in Function Calls</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Where a connection to the server is passed as an argument (Display*) and an
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>XkbDescPtr</emphasis>
|
|
|
|
|
|
is also passed as an argument, the Display* argument must match the
|
|
|
|
|
|
<emphasis>dpy</emphasis>
|
|
|
|
|
|
field of the
|
|
|
|
|
|
<emphasis>XkbDescRec</emphasis>
|
|
|
|
|
|
pointed to by the
|
|
|
|
|
|
<emphasis>XkbDescPtr</emphasis>
|
|
|
|
|
|
argument, or else the
|
|
|
|
|
|
<emphasis>dpy</emphasis>
|
|
|
|
|
|
field of the
|
|
|
|
|
|
<emphasis>XkbDescRec</emphasis>
|
|
|
|
|
|
must be
|
|
|
|
|
|
<emphasis>NULL</emphasis>.
|
|
|
|
|
|
If they don’t match or the
|
|
|
|
|
|
<emphasis>dpy</emphasis>
|
|
|
|
|
|
field is not
|
|
|
|
|
|
<emphasis>NULL</emphasis>,
|
|
|
|
|
|
a
|
|
|
|
|
|
<emphasis>BadMatch</emphasis>
|
|
|
|
|
|
error is returned (either in the return value or a backfilled
|
|
|
|
|
|
<emphasis>Status</emphasis>
|
|
|
|
|
|
variable). Upon successful return, the
|
|
|
|
|
|
<emphasis>dpy</emphasis>
|
|
|
|
|
|
field of the
|
|
|
|
|
|
<emphasis>XkbDescRec</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
always contains the Display* value passed in.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
|
The Xkb extension can communicate with the X input extension if it is present.
|
|
|
|
|
|
Consequently, there can potentially be more than one input device connected to
|
|
|
|
|
|
the server. Most Xkb library calls that require communicating with the server
|
2014-07-06 20:25:46 -07:00
|
|
|
|
involve both a server connection (Display *
|
|
|
|
|
|
<emphasis>dpy</emphasis>
|
|
|
|
|
|
) and a device identifier (unsigned int
|
|
|
|
|
|
<emphasis>device_spec</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
). In some cases, the device identifier is implicit and is taken as the
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>device_spec</emphasis>
|
|
|
|
|
|
field of an
|
|
|
|
|
|
<emphasis>XkbDescRec</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
structure passed as an argument.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
The device identifier can specify any X input extension device with a
|
|
|
|
|
|
<emphasis>KeyClass</emphasis>
|
|
|
|
|
|
component, or it can specify the constant,
|
|
|
|
|
|
<emphasis>XkbUseCoreKbd</emphasis>.
|
|
|
|
|
|
The use of
|
|
|
|
|
|
<emphasis>XkbUseCoreKbd</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
allows applications to indicate the core keyboard without having to determine
|
|
|
|
|
|
its device identifier.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
2014-07-06 20:25:46 -07:00
|
|
|
|
Where an Xkb device identifier is passed as an argument and an
|
|
|
|
|
|
<emphasis>XkbDescPtr</emphasis>
|
|
|
|
|
|
is also passed as an argument, if either the argument or the
|
|
|
|
|
|
<emphasis>XkbDescRec</emphasis>
|
|
|
|
|
|
<emphasis>device_spec</emphasis>
|
|
|
|
|
|
field is
|
|
|
|
|
|
<emphasis>XkbUseCoreKbd</emphasis>,
|
|
|
|
|
|
and if the function returns successfully, the
|
|
|
|
|
|
<emphasis>XkbDescPtr</emphasis>
|
|
|
|
|
|
<emphasis>device_spec</emphasis>
|
|
|
|
|
|
field will have been converted from
|
|
|
|
|
|
<emphasis>XkbUseCoreKbd</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
to a real Xkb device ID. If the function does not complete successfully, the
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>device_spec</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
field remains unchanged. Subsequently, the device id argument must match the
|
2014-07-06 20:25:46 -07:00
|
|
|
|
<emphasis>device_spec</emphasis>
|
|
|
|
|
|
field of the
|
|
|
|
|
|
<emphasis>XkbDescPtr</emphasis>
|
|
|
|
|
|
argument. If they don’t match, a
|
|
|
|
|
|
<emphasis>BadMatch</emphasis>
|
|
|
|
|
|
error is returned (either in the return value or a backfilled
|
|
|
|
|
|
<emphasis>Status</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
variable).
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
|
When the Xkb extension in the server hands an application a device identifier
|
|
|
|
|
|
to use for the keyboard, that ID is the input extension identifier for the
|
|
|
|
|
|
device if the server supports the X Input Extension. If the server does not
|
|
|
|
|
|
support the input extension, the meaning of the identifier is undefined — the
|
2014-07-06 20:25:46 -07:00
|
|
|
|
only guarantee is that when you use
|
|
|
|
|
|
<emphasis>XkbUseCoreKbd</emphasis>,
|
|
|
|
|
|
<emphasis>XkbUseCoreKbd</emphasis>
|
2010-11-30 10:52:07 -05:00
|
|
|
|
will work and the identifier returned by the server will refer to the core
|
|
|
|
|
|
keyboard device.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
</chapter>
|