2014-07-18 22:04:40 -07:00
<?xml version="1.0" encoding="UTF-8" ?>
< !DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
2011-10-07 22:52:30 -06:00
<chapter id= 'Xkb_Server_Keyboard_Mapping' >
2010-11-30 10:52:07 -05:00
<title > Xkb Server Keyboard Mapping</title>
2014-07-19 00:46:41 -07:00
<indexterm zone= "Xkb_Server_Keyboard_Mapping" >
<primary > server map</primary> </indexterm>
<indexterm zone= "Xkb_Server_Keyboard_Mapping" >
<primary > map</primary> <secondary > server</secondary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > server</structfield>
2014-07-19 23:53:48 -07:00
field of the complete Xkb keyboard description (see <link linkend= "The_XkbDescRec_Structure" > section 6.1</link> ) is a pointer
2010-11-30 10:52:07 -05:00
to the Xkb server map.
</para>
<para >
2014-07-07 22:22:28 -07:00
<link linkend= "figure16.1" > Figure 16.1</link> shows the relationships between elements in the server map:
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 22:22:28 -07:00
<figure id= 'figure16.1' >
<title > Server Map Relationships</title>
<mediaobject >
<imageobject > <imagedata format= "SVG" fileref= "XKBlib-16.svg" />
</imageobject>
</mediaobject>
</figure>
2010-11-30 10:52:07 -05:00
<!--
<H5 CLASS= "Figure" >
Server Map Relationships</H5>
-->
2014-07-19 00:46:41 -07:00
<para id= 'XkbServerMapRec' >
<indexterm significance= "preferred" zone= "XkbServerMapRec" >
<primary > <structname > XkbServerMapRec</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
The Xkb server map contains the information the server needs to interpret key
2014-07-06 20:25:46 -07:00
events and is of type
2014-07-19 00:48:02 -07:00
<structname > XkbServerMapRec</structname> :
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
#define XkbNumVirtualMods 16
2014-07-19 00:48:02 -07:00
typedef struct { /* Server Map */
unsigned short num_acts; /* # of occupied entries in <structfield > acts</structfield> */
unsigned short size_acts; /* # of entries in <structfield > acts</structfield> */
XkbAction * acts; /* linear 2d tables of key actions,
1 per keycode */
XkbBehavior * behaviors; /* key behaviors, 1 per keycode */
unsigned short * key_acts; /* index into <structfield > acts</structfield> , 1 per keycode */
unsigned char * explicit; /* explicit overrides of core
remapping, 1 per key */
unsigned char vmods[XkbNumVirtualMods]; /* real mods bound
to virtual mods */
unsigned short * vmodmap; /* virtual mods bound to key,
1 per keycode */
2014-07-08 23:34:29 -07:00
} <structname > XkbServerMapRec</structname> , *XkbServerMapPtr;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > num_acts</structfield> ,
<structfield > size_acts</structfield> ,
<structfield > acts</structfield> ,
2014-07-06 20:25:46 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > key_acts</structfield>
2014-07-19 23:53:48 -07:00
fields specify the key actions, defined in <link linkend= "Key_Actions" > section 16.1</link> . The
2014-07-10 11:08:14 -07:00
<structfield > behaviors</structfield>
2014-07-19 23:53:48 -07:00
field describes the behavior for each key and is defined in <link linkend= "Key_Behavior" > section 16.2</link> . The
2014-07-10 11:08:14 -07:00
<structfield > explicit</structfield>
2014-07-19 23:53:48 -07:00
field describes the explicit components for a key and is defined in
2014-07-18 23:18:52 -07:00
<link linkend= "Explicit_ComponentsAvoiding_Automatic_Remapping_by_the_Server" > section 16.3</link> . The
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
and the
2014-07-10 11:08:14 -07:00
<structfield > vmodmap</structfield>
2014-07-19 23:53:48 -07:00
fields describe the virtual modifiers and the per-key virtual modifier mapping
2014-07-06 21:29:59 -07:00
and are defined in <link linkend= "Virtual_Modifier_Mapping" > section 16.4</link> .
2010-11-30 10:52:07 -05:00
</para>
2011-10-07 22:52:30 -06:00
<sect1 id= 'Key_Actions' >
2010-11-30 10:52:07 -05:00
<title > Key Actions</title>
<para >
A key action defines the effect key presses and releases have on the internal
state of the server. For example, the expected key action associated with
2014-07-06 20:25:46 -07:00
pressing the
2014-07-06 20:40:18 -07:00
<symbol > Shift</symbol>
2014-07-19 23:53:48 -07:00
key is to set the
2014-07-06 20:40:18 -07:00
<symbol > Shift</symbol>
2014-07-19 23:53:48 -07:00
modifier. There is zero or one key action associated with each keysym bound to
2010-11-30 10:52:07 -05:00
each key.
</para>
<para >
Just as the entire list of key symbols for the keyboard mapping is held in the
2014-07-10 11:08:14 -07:00
<structfield > syms</structfield>
2014-07-19 23:53:48 -07:00
field of the client map, the entire list of key actions for the keyboard
2014-07-06 20:25:46 -07:00
mapping is held in the
2014-07-10 11:08:14 -07:00
<structfield > acts</structfield>
2014-07-19 23:53:48 -07:00
array of the server map. The total size of
2014-07-10 11:08:14 -07:00
<structfield > acts</structfield>
2014-07-19 23:53:48 -07:00
is specified by
2014-07-10 11:08:14 -07:00
<structfield > size_acts</structfield> ,
2014-07-06 20:25:46 -07:00
and the number of entries is specified by
2014-07-10 11:08:14 -07:00
<structfield > num_acts</structfield> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > key_acts</structfield>
2014-07-19 23:53:48 -07:00
array, indexed by keycode, describes the actions associated with a key. The
2014-07-10 11:08:14 -07:00
<structfield > key_acts</structfield>
2014-07-19 23:53:48 -07:00
array has
2014-07-10 11:08:14 -07:00
<structfield > min_key_code</structfield>
2014-07-19 23:53:48 -07:00
unused entries at the start to allow direct indexing using a keycode. If a
2014-07-10 11:08:14 -07:00
<structfield > key_acts</structfield>
2014-07-19 23:53:48 -07:00
entry is
2014-07-06 20:25:46 -07:00
<emphasis > zero</emphasis> ,
it means the key does not have any actions associated with it. If an entry is
not
<emphasis > zero</emphasis> ,
the entry represents an index into the
2014-07-10 11:08:14 -07:00
<structfield > acts</structfield>
2014-07-19 23:53:48 -07:00
field of the server map, much as the
2014-07-10 11:08:14 -07:00
<structfield > offset</structfield>
2014-07-19 23:53:48 -07:00
field of a
2014-07-08 23:34:29 -07:00
<structname > KeySymMapRec</structname>
2014-07-19 23:53:48 -07:00
structure is an index into the
2014-07-10 11:08:14 -07:00
<structfield > syms</structfield>
2014-07-19 23:53:48 -07:00
field of the client map.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The reason the
2014-07-10 11:08:14 -07:00
<structfield > acts</structfield>
2014-07-19 23:53:48 -07:00
field is a linear list of
2014-07-10 13:40:40 -07:00
<structname > XkbAction</structname> s
2014-07-19 23:53:48 -07:00
is to reduce the memory consumption associated with a keymap. Because Xkb
2010-11-30 10:52:07 -05:00
allows individual keys to have multiple shift levels and a different number of
2014-07-06 20:25:46 -07:00
groups per key, a single two-dimensional array of
2014-07-10 20:00:53 -07:00
<type > KeySym</type> s
2014-07-19 23:53:48 -07:00
would potentially be very large and sparse. Instead, Xkb provides a small
2014-07-06 20:25:46 -07:00
two-dimensional array of
2014-07-10 13:40:40 -07:00
<structname > XkbAction</structname> s
2014-07-19 23:53:48 -07:00
for each key. To store all of these individual arrays, Xkb concatenates each
2014-07-06 20:25:46 -07:00
array together in the
2014-07-10 11:08:14 -07:00
<structfield > acts</structfield>
2014-07-19 23:53:48 -07:00
field of the server map.
2010-11-30 10:52:07 -05:00
</para>
<para >
The key action structures consist only of fields of type char or unsigned char.
This is done to optimize data transfer when the server sends bytes over the
wire. If the fields are anything but bytes, the server has to sift through all
of the actions and swap any nonbyte fields. Because they consist of nothing but
bytes, it can just copy them out.
</para>
<para >
Xkb provides the following macros, to simplify accessing information pertaining
to key actions:
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbKeyHasActions" > <primary > <function > XkbKeyHasActions</function> </primary> </indexterm>
<funcsynopsis id= "XkbKeyHasActions" >
<funcprototype >
<funcdef > Bool <function > XkbKeyHasActions</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > xkb, keycode</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
<paramdef > KeyCode <parameter > keycode</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
Xkb description of interest
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > keycode</parameter>
</term>
<listitem >
<para >
keycode of interest
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbKeyHasActions</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<symbol > True</symbol>
2014-07-19 23:53:48 -07:00
if the key corresponding to
2014-07-08 22:22:29 -07:00
<parameter > keycode</parameter>
2014-07-19 23:53:48 -07:00
has any actions associated with it; otherwise, it returns
2014-07-06 20:40:18 -07:00
<symbol > False</symbol> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbKeyNumActions" > <primary > <function > XkbKeyNumActions</function> </primary> </indexterm>
<funcsynopsis id= "XkbKeyNumActions" >
<funcprototype >
<funcdef > int <function > XkbKeyNumActions</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > xkb, keycode</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
<paramdef > KeyCode <parameter > keycode</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
Xkb description of interest
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > keycode</parameter>
</term>
<listitem >
<para >
keycode of interest
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbKeyNumActions</function>
2014-07-19 23:53:48 -07:00
computes the number of actions associated with the key corresponding to
2014-07-08 22:22:29 -07:00
<parameter > keycode</parameter> .
2014-07-06 20:25:46 -07:00
This should be the same value as the result of
2014-07-06 20:34:51 -07:00
<function > XkbKeyNumSyms</function>
2014-07-19 23:53:48 -07:00
(see <link linkend= "Key_Width" > section 15.3.3</link> ).
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbKeyActionsPtr" > <primary > <function > XkbKeyActionsPtr</function> </primary> </indexterm>
<funcsynopsis id= "XkbKeyActionsPtr" >
<funcprototype >
<funcdef > XkbKeyActionPtr <function > XkbKeyActionsPtr</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > xkb, keycode</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
<paramdef > KeyCode <parameter > keycode</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
Xkb description of interest
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > keycode</parameter>
</term>
<listitem >
<para >
keycode of interest
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbKeyActionsPtr</function>
2014-07-19 23:53:48 -07:00
returns a pointer to the two-dimensional array of key actions associated with
2014-07-06 20:25:46 -07:00
the key corresponding to
2014-07-08 22:22:29 -07:00
<parameter > keycode</parameter> .
2014-07-06 20:25:46 -07:00
Use
2014-07-06 20:34:51 -07:00
<function > XkbKeyActionsPtr</function>
2014-07-19 23:53:48 -07:00
only if the key actually has some actions associated with it, that is,
2014-07-06 20:34:51 -07:00
<function > XkbKeyNumActions</function>
2010-11-30 10:52:07 -05:00
(xkb, keycode) returns something greater than zero.
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbKeyAction" > <primary > <function > XkbKeyAction</function> </primary> </indexterm>
<funcsynopsis id= "XkbKeyAction" >
<funcprototype >
<funcdef > XkbAction <function > XkbKeyAction</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > xkb, keycode, idx</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
<paramdef > KeyCode <parameter > keycode</parameter> </paramdef>
<paramdef > int <parameter > idx</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
Xkb description of interest
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > keycode</parameter>
</term>
<listitem >
<para >
keycode of interest
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > idx</parameter>
</term>
<listitem >
<para >
index for group and shift level
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbKeyAction</function>
2014-07-19 23:53:48 -07:00
returns the key action indexed by
2014-07-08 22:22:29 -07:00
<parameter > idx</parameter>
2014-07-19 23:53:48 -07:00
in the two-dimensional array of key actions associated with the key
2014-07-06 20:25:46 -07:00
corresponding to
2014-07-08 22:22:29 -07:00
<parameter > keycode</parameter> .
<parameter > idx</parameter>
2014-07-19 23:53:48 -07:00
may be computed from the group and shift level of interest as follows:
2010-11-30 10:52:07 -05:00
</para>
<literallayout >
idx = group_index * key_width + shift_level
</literallayout>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbKeyActionEntry" > <primary > <function > XkbKeyActionEntry</function> </primary> </indexterm>
<funcsynopsis id= "XkbKeyActionEntry" >
<funcprototype >
<funcdef > XkbAction <function > XkbKeyActionEntry</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > xkb, keycode, shift, grp</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
<paramdef > KeyCode <parameter > keycode</parameter> </paramdef>
<paramdef > int <parameter > shift</parameter> </paramdef>
<paramdef > int <parameter > grp</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
Xkb description of interest
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > keycode</parameter>
</term>
<listitem >
<para >
keycode of interest
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > shift</parameter>
</term>
<listitem >
<para >
shift level within group
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > grp</parameter>
</term>
<listitem >
<para >
group index for group of interest
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbKeyActionEntry</function>
2014-07-19 23:53:48 -07:00
returns the key action corresponding to group
2014-07-08 22:22:29 -07:00
<parameter > grp</parameter>
2014-07-19 23:53:48 -07:00
and shift level
2014-07-10 15:00:30 -07:00
<parameter > shift</parameter>
2014-07-19 23:53:48 -07:00
from the two-dimensional table of key actions associated with the key
2014-07-06 20:25:46 -07:00
corresponding to
2014-07-08 22:22:29 -07:00
<parameter > keycode</parameter> .
2010-11-30 10:52:07 -05:00
</para>
2011-10-07 22:52:30 -06:00
<sect2 id= 'The_XkbAction_Structure' >
2010-11-30 10:52:07 -05:00
<title > The XkbAction Structure</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "The_XkbAction_Structure" >
<primary > <structname > XkbAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
The description for an action is held in an
2014-07-10 11:08:14 -07:00
<structname > XkbAction</structname>
2014-07-19 23:53:48 -07:00
structure, which is a union of all possible Xkb action types:
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef union _XkbAction {
2014-07-19 00:48:02 -07:00
XkbAnyAction any;
XkbModAction mods;
XkbGroupAction group;
XkbISOAction iso;
XkbPtrAction ptr;
XkbPtrBtnAction btn;
XkbPtrDfltAction dflt;
XkbSwitchScreenAction screen;
XkbCtrlsAction ctrls;
XkbMessageAction msg;
XkbRedirectKeyAction redirect;
XkbDeviceBtnAction devbtn;
XkbDeviceValuatorAction devval;
unsigned char type;
2014-07-10 11:08:14 -07:00
} <structname > XkbAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field is provided for convenience and is the same as the type field in the
2010-11-30 10:52:07 -05:00
individual structures. The following sections describe the individual
structures for each action in detail.
</para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'The_XkbAnyAction_Structure' >
2010-11-30 10:52:07 -05:00
<title > The XkbAnyAction Structure</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "The_XkbAnyAction_Structure" >
<primary > <structname > XkbAnyAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structname > XkbAnyAction</structname>
2014-07-19 23:53:48 -07:00
structure is a convenience structure that refers to any of the actions:
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
#define XkbAnyActionDataSize 7
typedef struct _XkbAnyAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* type of action; determines interpretation for data */
unsigned char data[XkbAnyActionDataSize];
2014-07-10 11:08:14 -07:00
} <structname > XkbAnyAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > data</structfield>
2014-07-19 23:53:48 -07:00
field represents a structure for an action, and its interpretation depends on
2014-07-06 20:25:46 -07:00
the
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field. The valid values for the
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field, and the data structures associated with them are shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.1" > Table 16.1</link> :
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.1' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Action Types</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= '1.8*' />
<colspec colname= 'c2' colwidth= '2.0*' />
<colspec colname= 'c3' colwidth= '1.5*' />
<colspec colname= 'c4' colwidth= '1.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 > Type</entry>
<entry > Structure for Data</entry>
<entry > XkbAction Union Member</entry>
<entry > Section</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_NoAction</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_NoAction</symbol>
2014-07-19 23:53:48 -07:00
means the server does not perform an action for the key; this action does not
2010-11-30 10:52:07 -05:00
have an associated data structure.
</entry>
<entry > any</entry>
<entry > </entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry >
2014-07-08 23:29:49 -07:00
<para > <symbol > XkbSA_SetMods</symbol> </para>
<para > <symbol > XkbSA_LatchMods</symbol> </para>
<para > <symbol > XkbSA_LockMods</symbol> </para>
2010-11-30 10:52:07 -05:00
</entry>
2014-07-10 11:08:14 -07:00
<entry > <para > <structname > XkbModAction</structname> </para> </entry>
2010-11-30 10:52:07 -05:00
<entry > mods</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Changing_Modifiers_State" > 16.1.3</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry >
2014-07-08 23:29:49 -07:00
<para > <symbol > XkbSA_SetGroup</symbol> </para>
<para > <symbol > XkbSA_LatchGroup</symbol> </para>
<para > <symbol > XkbSA_LockGroup</symbol> </para>
2010-11-30 10:52:07 -05:00
</entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbGroupAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > group</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Changing_Group_State" > 16.1.4</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_MovePtr</symbol> </entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbPtrAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > ptr</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Moving_the_Pointer" > 16.1.5</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry >
2014-07-09 23:26:37 -07:00
<para > <symbol > XkbSA_PtrBtn</symbol> </para>
2014-07-08 23:29:49 -07:00
<para > <symbol > XkbSA_LockPtrBtn</symbol> </para>
2010-11-30 10:52:07 -05:00
</entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbPtrBtnAction</structname> </entry> <entry > btn</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Simulating_Pointer_Button_Press_and_Release" > 16.1.6</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SetPtrDflt</symbol> </entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbPtrDfltAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > dflt</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Changing_the_Pointer_Button_Simulated" > 16.1.7</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISOLock</symbol> </entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbISOAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > iso</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Locking_Modifiers_and_Group" > 16.1.8</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SwitchScreen</symbol> </entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbSwitchScreenAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > screen</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Changing_the_Active_Screen" > 16.1.9</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry >
2014-07-08 23:29:49 -07:00
<para > <symbol > XkbSA_SetControls</symbol> </para>
<para > <symbol > XkbSA_LockControls</symbol> </para>
2010-11-30 10:52:07 -05:00
</entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbCtrlsAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > ctrls</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Changing_Boolean_Controls_State" > 16.1.10</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ActionMessage</symbol> </entry>
2014-07-10 13:40:40 -07:00
<entry > <structname > XkbMessageAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > msg</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Generating_Messages" > 16.1.11</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_RedirectKey</symbol> </entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbRedirectKeyAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > redirect</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Generating_a_Different_Keycode" > 16.1.12</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry >
2014-07-08 23:29:49 -07:00
<para > <symbol > XkbSA_DeviceBtn</symbol> </para>
2014-07-09 23:26:37 -07:00
<para > <symbol > XkbSA_LockDeviceBtn</symbol> </para>
2010-11-30 10:52:07 -05:00
</entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbDeviceBtnAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > devbtn</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Generating_DeviceButtonPress_and_DeviceButtonRelease" > 16.1.13</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_DeviceValuator</symbol> </entry>
2014-07-10 11:08:14 -07:00
<entry > <structname > XkbDeviceValuatorAction</structname> </entry>
2010-11-30 10:52:07 -05:00
<entry > devval</entry>
2014-07-18 22:52:16 -07:00
<entry > <link linkend= "Actions_for_Simulating_Events_from_Device_Valuators" > 16.1.14</link> </entry>
2010-11-30 10:52:07 -05:00
</row>
</tbody>
</tgroup>
</table>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Changing_Modifiers_State' >
2010-11-30 10:52:07 -05:00
<title > Actions for Changing Modifiers’ State</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Changing_Modifiers_State" >
<primary > <structname > XkbModAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 11:08:14 -07:00
<structname > XkbModAction</structname>
2014-07-19 23:53:48 -07:00
structure change the state of the modifiers when keys are pressed and released
2014-07-06 21:17:18 -07:00
(see <xref linkend= "Virtual_Modifiers" /> for a discussion of modifiers):
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbModAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_{Set|Latch|Lock}Mods</symbol> */
unsigned char flags; /* with <structfield > type</structfield> , controls the effect
on modifiers */
unsigned char mask; /* same as <structfield > mask</structfield> field of
a modifier description */
unsigned char real_mods; /* same as <structfield > real_mods</structfield> field of
a modifier description */
unsigned char vmods1; /* derived from <structfield > vmods</structfield> field of
a modifier description */
unsigned char vmods2; /* derived from <structfield > vmods</structfield> field of
a modifier description */
2014-07-10 11:08:14 -07:00
} <structname > XkbModAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
In the following description, the term
2014-07-18 21:09:24 -07:00
<firstterm > action modifiers</firstterm>
<indexterm significance= "preferred" zone= "Actions_for_Changing_Modifiers_State" >
<primary > action modifiers</primary> </indexterm>
<indexterm significance= "preferred" zone= "Actions_for_Changing_Modifiers_State" >
<primary > modifiers</primary> <secondary > action</secondary> </indexterm>
2014-07-19 23:53:48 -07:00
means the real modifier bits associated with this action. Depending on the
2014-07-06 20:25:46 -07:00
value of
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
(see <link linkend= "table16.3" > Table 16.3</link> ),
these are designated either in the
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield>
2014-07-19 23:53:48 -07:00
field of the
2014-07-10 11:08:14 -07:00
<structname > XkbModAction</structname>
2014-07-19 23:53:48 -07:00
structure itself or the real modifiers bound to the key for which the action
2014-07-06 20:25:46 -07:00
is being used. In the latter case, this is the client
2014-07-19 11:55:51 -07:00
<structfield > map</structfield> -> <structfield > modmap</structfield>
2014-07-06 20:25:46 -07:00
[
2014-07-08 22:22:29 -07:00
<parameter > keycode</parameter>
2010-11-30 10:52:07 -05:00
] field.
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field can have any of the values shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.2" > Table 16.2</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.2' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Modifier Action Types</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= '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 > Type</entry>
<entry > Effect</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SetMods</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
A key press adds any action modifiers to the keyboard’ s base modifiers.
</para>
</listitem>
<listitem >
<para >
A key release clears any action modifiers in the keyboard’ s base modifiers,
provided no other key affecting the same modifiers is logically down.
</para>
</listitem>
<listitem >
<para >
If no other keys are physically depressed when this key is released, and
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ClearLocks</symbol>
2014-07-19 23:53:48 -07:00
is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, the key release unlocks any action modifiers.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
</itemizedlist>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LatchMods</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
Key press and key release events have the same effect as for
2014-07-19 09:01:26 -07:00
<symbol > XkbSA_SetMods</symbol> ;
2014-07-19 23:53:48 -07:00
if no keys are physically depressed when this key is released, key release
2010-11-30 10:52:07 -05:00
events have the following additional effects:
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
Modifiers unlocked due to
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ClearLocks</symbol>
2014-07-19 23:53:48 -07:00
have no further effect.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LatchToLock</symbol>
2014-07-19 23:53:48 -07:00
is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, a key release locks and then unlatches any remaining action modifiers
2010-11-30 10:52:07 -05:00
that are already latched.
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
A key release latches any action modifiers not used by the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ClearLocks</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LatchToLock</symbol>
2014-07-19 23:53:48 -07:00
flags.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
</itemizedlist>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockMods</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
A key press sets the base state of any action modifiers. If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoLock</symbol>
2014-07-19 23:53:48 -07:00
is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, a key press also sets the locked state of any action modifiers.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
A key release clears any action modifiers in the keyboard’ s base modifiers,
2014-07-06 20:25:46 -07:00
provided no other key that affects the same modifiers is down. If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoUnlock</symbol>
2014-07-19 23:53:48 -07:00
is not set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, and any of the action modifiers were locked before the corresponding
2010-11-30 10:52:07 -05:00
key press occurred, a key release unlocks them.
</para>
</listitem>
</itemizedlist>
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field is composed of the bitwise inclusive OR of the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.3" > Table 16.3</link> .
2014-07-19 23:53:48 -07:00
A general meaning is given in the table, but the exact meaning depends on
2014-07-10 11:08:14 -07:00
the action <structfield > type</structfield> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.3' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Modifier Action Flags</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_UseModMapMods</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
If set, the action modifiers are determined by the modifiers bound by the
modifier mapping of the key. Otherwise, the action modifiers are set to the
2014-07-06 20:25:46 -07:00
modifiers specified by the
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield> ,
<structfield > real_mods</structfield> ,
2014-07-10 13:40:40 -07:00
<structfield > vmods1</structfield> ,
2014-07-06 20:25:46 -07:00
and
2014-07-10 13:40:40 -07:00
<structfield > vmods2</structfield>
2014-07-19 23:53:48 -07:00
fields.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ClearLocks</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
If set and no keys are physically depressed when this key transition
occurs, the server unlocks any action modifiers.
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LatchToLock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action type is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LatchMods</symbol> ,
2014-07-06 20:25:46 -07:00
the server locks the action modifiers if they are already latched.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoLock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action type is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockMods</symbol> ,
2014-07-06 20:25:46 -07:00
the server only unlocks the action modifiers.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoUnlock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockMods</symbol> ,
2014-07-06 20:25:46 -07:00
the server only locks the action modifiers.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_UseModMapMods</symbol>
2014-07-19 23:53:48 -07:00
is not set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, the
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield> ,
<structfield > real_mods</structfield> ,
<structfield > vmods1</structfield> ,
2014-07-06 20:25:46 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods2</structfield>
2010-11-30 10:52:07 -05:00
fields are used to determine the action modifiers. Otherwise they are ignored
2014-07-06 20:25:46 -07:00
and the modifiers bound to the key (client
2014-07-19 11:55:51 -07:00
<structfield > map</structfield> -> <structfield > modmap</structfield>
2014-07-06 20:25:46 -07:00
[
2014-07-08 22:22:29 -07:00
<parameter > keycode</parameter>
2010-11-30 10:52:07 -05:00
]) are used instead.
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield> ,
<structfield > real_mods</structfield> ,
<structfield > vmods1</structfield> ,
2014-07-06 20:25:46 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods2</structfield>
2014-07-19 23:53:48 -07:00
fields represent the components of an Xkb modifier description
2014-07-06 21:29:59 -07:00
(see <link linkend= "Modifier_Definitions" > section 7.2</link> ). While the
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > real_mods</structfield>
2014-07-19 23:53:48 -07:00
fields correspond directly to the
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > real_mods</structfield>
2014-07-19 23:53:48 -07:00
fields of an Xkb modifier description, the
2014-07-10 11:08:14 -07:00
<structfield > vmods1</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods2</structfield>
2014-07-19 23:53:48 -07:00
fields are combined to correspond to the
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
field of an Xkb modifier description. Xkb provides the following macros, to
2010-11-30 10:52:07 -05:00
convert between the two formats:
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbModActionVMods" > <primary > <function > XkbModActionVMods</function> </primary> </indexterm>
<funcsynopsis id= "XkbModActionVMods" >
<funcprototype >
<funcdef > unsigned short <function > XkbModActionVMods</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbAction <parameter > act</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to extract virtual mods
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbModActionVMods</function>
2014-07-19 23:53:48 -07:00
returns the
2014-07-10 11:08:14 -07:00
<structfield > vmods1</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods2</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
converted to the
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
format of an Xkb modifier description.
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSetModActionVMods" > <primary > <function > XkbSetModActionVMods</function> </primary> </indexterm>
<funcsynopsis id= "XkbSetModActionVMods" >
<funcprototype >
<funcdef > void <function > XkbSetModActionVMods</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act, vmods</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbAction <parameter > act</parameter> </paramdef>
<paramdef > unsigned short <parameter > vmods</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action in which to set vmods
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > vmods</parameter>
</term>
<listitem >
<para >
virtual mods to set
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSetModActionVMods</function>
2014-07-19 23:53:48 -07:00
sets the
2014-07-10 11:08:14 -07:00
<structfield > vmods1</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods2</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
using the
2014-07-08 22:22:29 -07:00
<parameter > vmods</parameter>
2014-07-19 23:53:48 -07:00
format of an Xkb modifier description.
2010-11-30 10:52:07 -05:00
</para>
<note > <para > Despite the fact that the first parameter of these two macros is of
2014-07-06 20:25:46 -07:00
type XkbAction, these macros may be used only with Actions of type
2014-07-10 11:08:14 -07:00
<structname > XkbModAction</structname>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structname > XkbISOAction</structname> .
2014-07-06 20:25:46 -07:00
</para> </note>
2010-11-30 10:52:07 -05:00
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Changing_Group_State' >
2010-11-30 10:52:07 -05:00
<title > Actions for Changing Group State</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Changing_Group_State" >
<primary > <structname > XkbGroupAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 11:08:14 -07:00
<structname > XkbGroupAction</structname>
2014-07-19 23:53:48 -07:00
structure change the current group state when keys are pressed and released
2014-07-06 21:17:18 -07:00
(see <xref linkend= "Keyboard_State" /> for a description of groups and keyboard state):
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbGroupAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_{Set|Latch|Lock}Group</symbol> */
unsigned char flags; /* with <structfield > type</structfield> , controls the effect on groups */
char group_XXX; /* represents a group index or delta */
2014-07-10 11:08:14 -07:00
} <structname > XkbGroupAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field can have any of the following values:
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.4' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Group Action Types</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= '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 > Type</entry>
<entry > Effect</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SetGroup</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_GroupAbsolute</symbol>
2014-07-19 23:53:48 -07:00
bit is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, key press events change the base keyboard group to the group specified
2014-07-06 20:25:46 -07:00
by the
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field. Otherwise, key press events change the base keyboard group by adding
2014-07-06 20:25:46 -07:00
the
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field to the base keyboard group. In either case, the resulting effective
2010-11-30 10:52:07 -05:00
keyboard group is brought back into range depending on the value of the
2014-07-10 11:08:14 -07:00
<structfield > groups_wrap</structfield>
2014-07-19 23:53:48 -07:00
field of the controls structure (see <link linkend= "The_GroupsWrap_Control" > section 10.7.1</link> ).
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If a key with an
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action (see <link linkend= "Actions_for_Locking_Modifiers_and_Group" > section 16.1.8</link> ) is pressed while this key is down, the key release
2010-11-30 10:52:07 -05:00
of this key has no effect. Otherwise, the key release cancels the effects of
the key press.
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ClearLocks</symbol>
2014-07-19 23:53:48 -07:00
bit is set in the flags field, and no keys are physically depressed when this
2010-11-30 10:52:07 -05:00
key is released, the key release also sets the locked keyboard group to
2014-07-06 20:25:46 -07:00
<emphasis > Group1</emphasis> .
</para>
2010-11-30 10:52:07 -05:00
</listitem>
</itemizedlist>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LatchGroup</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
Key press and key release events have the same effect as for
2014-07-19 09:01:26 -07:00
<symbol > XkbSA_SetGroup</symbol> ;
2014-07-19 23:53:48 -07:00
if no keys are physically depressed when this key is released, key release
2010-11-30 10:52:07 -05:00
events have the following additional effects.
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LatchToLock</symbol>
2014-07-19 23:53:48 -07:00
bit is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field and the latched keyboard group index is nonzero, the key release adds
2010-11-30 10:52:07 -05:00
the delta applied by the corresponding key press to the locked keyboard group
and subtracts it from the latched keyboard group. The locked and effective
keyboard group are brought back into range according to the value of the
2014-07-10 11:08:14 -07:00
<structfield > groups_wrap</structfield>
2014-07-19 23:53:48 -07:00
field of the controls structure.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
Otherwise, the key press adds the key press delta to the latched keyboard group.
</para>
</listitem>
</itemizedlist>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockGroup</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_GroupAbsolute</symbol>
2014-07-19 23:53:48 -07:00
is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, key press events set the locked keyboard group to the group specified
2014-07-06 20:25:46 -07:00
by the
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field. Otherwise, key press events add the group specified by the
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field to the locked keyboard group. In either case, the resulting locked and
2010-11-30 10:52:07 -05:00
effective keyboard groups are brought back into range depending on the value of
2014-07-06 20:25:46 -07:00
the
2014-07-10 11:08:14 -07:00
<structfield > groups_wrap</structfield>
2014-07-19 23:53:48 -07:00
field of the controls structure.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
A key release has no effect.
</para>
</listitem>
</itemizedlist>
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field is composed of the bitwise inclusive OR of the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.5" > Table 16.5</link> .
2014-07-19 23:53:48 -07:00
A general meaning is given in the table, but the exact meaning depends on
2014-07-06 20:25:46 -07:00
the action
2014-07-10 11:08:14 -07:00
<structfield > type</structfield> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.5' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Group Action Flags</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ClearLocks</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
If set and no keys are physically depressed when this key transition occurs,
2014-07-06 20:25:46 -07:00
the server sets the locked keyboard group to
<emphasis > Group1</emphasis>
2014-07-19 23:53:48 -07:00
on a key release.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LatchToLock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action type is
2014-07-09 23:26:37 -07:00
<symbol > XkbSA_LatchGroup</symbol> ,
2014-07-06 20:25:46 -07:00
the server locks the action group if it is already latched.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_GroupAbsolute</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, the
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field represents an absolute group number. Otherwise, it represents a group
2010-11-30 10:52:07 -05:00
delta to be added to the current group to determine the new group number.
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field represents a signed character. Xkb provides the following macros to
2010-11-30 10:52:07 -05:00
convert between a signed integer value and a signed character:
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSAGroup" > <primary > <function > XkbSAGroup</function> </primary> </indexterm>
<funcsynopsis id= "XkbSAGroup" >
<funcprototype >
<funcdef > int <function > XkbSAGroup</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbAction <parameter > act</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to extract group
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSAGroup</function>
2014-07-19 23:53:48 -07:00
returns the
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
converted to a signed int.
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSASetGroup" > <primary > <function > XkbSASetGroup</function> </primary> </indexterm>
<funcsynopsis id= "XkbSASetGroup" >
<funcprototype >
<funcdef > void <function > XkbSASetGroup</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act, grp</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbAction <parameter > act</parameter> </paramdef>
<paramdef > int <parameter > grp</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to set group
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > grp</parameter>
</term>
<listitem >
<para >
2014-07-10 11:08:14 -07:00
group index to set in <structfield > group_XXX</structfield>
2014-07-06 15:57:41 -07:00
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSASetGroup</function>
2014-07-19 23:53:48 -07:00
sets the
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
from the group index
2014-07-08 22:22:29 -07:00
<parameter > grp</parameter> .
2010-11-30 10:52:07 -05:00
</para>
<note > <para > Despite the fact that the first parameter of these two macros is of
2014-07-06 20:25:46 -07:00
type XkbAction, these macros may only be used with Actions of type
2014-07-10 11:08:14 -07:00
<structname > XkbGroupAction</structname>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structname > XkbISOAction</structname> .
2014-07-06 20:25:46 -07:00
</para> </note>
2010-11-30 10:52:07 -05:00
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Moving_the_Pointer' >
2010-11-30 10:52:07 -05:00
<title > Actions for Moving the Pointer</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Moving_the_Pointer" >
<primary > <structname > XkbPtrAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 11:08:14 -07:00
<structname > XkbPtrAction</structname>
2014-07-19 23:53:48 -07:00
structure move the pointer when keys are pressed and released:
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbPtrAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_MovePtr</symbol> */
unsigned char flags; /* determines type of pointer motion */
unsigned char high_XXX; /* x coordinate, high bits */
unsigned char low_XXX; /* y coordinate, low bits */
unsigned char high_YYY; /* x coordinate, high bits */
unsigned char low_YYY; /* y coordinate, low bits */
2014-07-10 11:08:14 -07:00
} <structname > XkbPtrAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
If the
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
control is not enabled (see <link linkend= "The_MouseKeys_Control" > section 10.5.1</link> ),
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
events are treated as though the action is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_NoAction</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
If the
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
control is enabled, a server action of type
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_MovePtr</symbol>
2014-07-19 23:53:48 -07:00
instructs the server to generate core pointer
2014-07-06 20:40:18 -07:00
<symbol > MotionNotify</symbol>
2014-07-19 23:53:48 -07:00
events rather than the usual
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
event, and the corresponding
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
event disables any mouse keys timers that were created as a result of handling
2014-07-06 20:25:46 -07:00
the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_MovePtr</symbol>
2014-07-19 23:53:48 -07:00
action.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field of the
2014-07-10 11:08:14 -07:00
<structname > XkbPtrAction</structname>
2014-07-19 23:53:48 -07:00
structure is always
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_MovePtr</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field is a bitwise inclusive OR of the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.6" > Table 16.6</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.6' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Pointer Action Types</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= '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 > Action Type</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_NoAcceleration</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If not set, and the
<emphasis > MouseKeysAccel</emphasis>
2014-07-19 23:53:48 -07:00
control is enabled (see <link linkend= "The_MouseKeysAccel_Control" > section 10.5.2</link> ), the
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
initiates a mouse keys timer for this key; every time the timer expires, the
2010-11-30 10:52:07 -05:00
cursor moves.
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_MoveAbsoluteX</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry > If set, the X portion of the structure specifies the new pointer X
coordinate. Otherwise, the X portion is added to the current pointer X
coordinate to determine the new pointer X coordinate.
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_MoveAbsoluteY</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
If set, the Y portion of the structure specifies the new
pointer Y coordinate. Otherwise, the Y portion is added
to the current pointer Y coordinate to determine the new pointer Y coordinate.
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-19 12:34:28 -07:00
Each of the X and Y coordinates of the
2014-07-10 11:08:14 -07:00
<structname > XkbPtrAction</structname>
2014-07-19 23:53:48 -07:00
structure is composed of two signed 16-bit values, that is, the X coordinate
2014-07-06 20:25:46 -07:00
is composed of
2014-07-10 11:08:14 -07:00
<structfield > high_XXX</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > low_XXX</structfield> ,
2014-07-06 20:25:46 -07:00
and similarly for the Y coordinate. Xkb provides the following macros, to
convert between a signed integer and two signed 16-bit values in
2014-07-10 11:08:14 -07:00
<structname > XkbPtrAction</structname>
2014-07-19 23:53:48 -07:00
structures:
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbPtrActionX" > <primary > <function > XkbPtrActionX</function> </primary> </indexterm>
<funcsynopsis id= "XkbPtrActionX" >
<funcprototype >
<funcdef > int <function > XkbPtrActionX</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbPtrAction <parameter > act</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to extract X
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbPtrActionX</function>
2014-07-19 23:53:48 -07:00
returns the
2014-07-10 11:08:14 -07:00
<structfield > high_XXX</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > low_XXX</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
converted to a signed int.
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbPtrActionY" > <primary > <function > XkbPtrActionY</function> </primary> </indexterm>
<funcsynopsis id= "XkbPtrActionY" >
<funcprototype >
<funcdef > int <function > XkbPtrActionY</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbPtrAction <parameter > act</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to extract Y
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbPtrActionY</function>
2014-07-19 23:53:48 -07:00
returns the
2014-07-10 11:08:14 -07:00
<structfield > high_YYY</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > low_YYY</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
converted to a signed int.
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSetPtrActionX" > <primary > <function > XkbSetPtrActionX</function> </primary> </indexterm>
<funcsynopsis id= "XkbSetPtrActionX" >
<funcprototype >
<funcdef > void <function > XkbSetPtrActionX</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter> ,
<parameter > x</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbPtrAction <parameter > act</parameter> </paramdef>
<paramdef > int <parameter > x</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action in which to set X
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > x</parameter>
</term>
<listitem >
<para >
new value to set
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSetPtrActionX</function>
2014-07-19 23:53:48 -07:00
sets the
2014-07-10 11:08:14 -07:00
<structfield > high_XXX</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > low_XXX</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
from the signed integer value
2014-07-08 22:22:29 -07:00
<parameter > x</parameter> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSetPtrActionY" > <primary > <function > XkbSetPtrActionY</function> </primary> </indexterm>
<funcsynopsis id= "XkbSetPtrActionY" >
<funcprototype >
<funcdef > void <function > XkbSetPtrActionY</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act, y</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbPtrAction <parameter > act</parameter> </paramdef>
<paramdef > int <parameter > y</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action in which to set Y
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > y</parameter>
</term>
<listitem >
<para >
new value to set
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSetPtrActionX</function>
2014-07-19 23:53:48 -07:00
sets the
2014-07-10 11:08:14 -07:00
<structfield > high_YYY</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > low_YYY</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
from the signed integer value
2014-07-08 22:22:29 -07:00
<parameter > y</parameter> .
2010-11-30 10:52:07 -05:00
</para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Simulating_Pointer_Button_Press_and_Release' >
2010-11-30 10:52:07 -05:00
<title > Actions for Simulating Pointer Button Press and Release</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Simulating_Pointer_Button_Press_and_Release" >
<primary > <structname > XkbPtrBtnAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 11:08:14 -07:00
<structname > XkbPtrBtnAction</structname>
2014-07-19 23:53:48 -07:00
structure simulate the press and release of pointer buttons when keys are
2010-11-30 10:52:07 -05:00
pressed and released:
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbPtrBtnAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_PtrBtn</symbol> , <symbol > XkbSA_LockPtrBtn</symbol> */
unsigned char flags; /* with <structfield > type</structfield> , controls the effect
on pointer buttons */
unsigned char count; /* controls number of ButtonPress and
ButtonRelease events */
unsigned char button; /* pointer button to simulate */
2014-07-10 11:08:14 -07:00
} <structname > XkbPtrBtnAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
If the
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
(see <link linkend= "The_MouseKeys_Control" > section 10.5.1</link> ) control is not enabled,
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
events are treated as though the action is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_NoAction</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field can have any one of the values shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.7" > Table 16.7</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.7' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Pointer Button Action Types</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= '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 > Type</entry>
<entry > Effect</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_PtrBtn</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_UseDfltButton</symbol>
2014-07-19 23:53:48 -07:00
is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, the event is generated for the pointer button specified by the
2014-07-10 11:08:14 -07:00
<structfield > mk_dflt_btn</structfield>
2014-07-19 23:53:48 -07:00
attribute of the
2014-07-06 20:25:46 -07:00
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
control (see <link linkend= "The_MouseKeys_Control" > section 10.5.1</link> ). Otherwise, the event is generated for the button
2014-07-06 20:25:46 -07:00
specified by the
2014-07-10 11:08:14 -07:00
<structfield > button</structfield>
2014-07-19 23:53:48 -07:00
field.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
If the mouse button specified for this action is logically down, the key press
and corresponding key release are ignored and have no effect. Otherwise, a key
press causes one or more core pointer button events instead of the usual
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
event. If
2014-07-10 11:08:14 -07:00
<structfield > count</structfield>
2014-07-19 23:53:48 -07:00
is
2014-07-06 20:25:46 -07:00
<emphasis > zero</emphasis> ,
a key press generates a single
2014-07-06 20:40:18 -07:00
<symbol > ButtonPress</symbol>
2014-07-19 23:53:48 -07:00
event; if
2014-07-10 11:08:14 -07:00
<structfield > count</structfield>
2014-07-19 23:53:48 -07:00
is greater than
2014-07-06 20:25:46 -07:00
<emphasis > zero</emphasis> ,
a key press generates
2014-07-10 11:08:14 -07:00
<structfield > count</structfield>
2014-07-19 23:53:48 -07:00
pairs of
2014-07-06 20:40:18 -07:00
<symbol > ButtonPress</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-06 20:40:18 -07:00
<symbol > ButtonRelease</symbol>
2014-07-19 23:53:48 -07:00
events.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If
2014-07-10 11:08:14 -07:00
<structfield > count</structfield>
2014-07-19 23:53:48 -07:00
is
2014-07-06 20:25:46 -07:00
<emphasis > zero</emphasis> ,
a key release generates a core pointer
2014-07-06 20:40:18 -07:00
<symbol > ButtonRelease</symbol>
2014-07-19 23:53:48 -07:00
that matches the event generated by the corresponding
2014-07-19 09:01:26 -07:00
<symbol > KeyPress</symbol> ;
2014-07-19 23:53:48 -07:00
if
2014-07-10 11:08:14 -07:00
<structfield > count</structfield>
2014-07-19 23:53:48 -07:00
is nonzero, a key release does not cause a
2014-07-06 20:40:18 -07:00
<symbol > ButtonRelease</symbol>
2014-07-19 23:53:48 -07:00
event. A key release never generates a key
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
event.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
</itemizedlist>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockPtrBtn</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If the button specified by the
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
default button
2014-07-06 20:25:46 -07:00
or
2014-07-10 11:08:14 -07:00
<structfield > button</structfield>
2014-07-19 23:53:48 -07:00
is not locked, a key press causes a
2014-07-06 20:40:18 -07:00
<symbol > ButtonPress</symbol>
2014-07-19 23:53:48 -07:00
event instead of a
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
event and locks the button. If the button is already locked or if
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoUnlock</symbol>
2014-07-19 23:53:48 -07:00
is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, a key press is ignored and has no effect.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If the corresponding key press was ignored, and if
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoLock</symbol>
2014-07-19 23:53:48 -07:00
is not set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, a key release generates a
2014-07-06 20:40:18 -07:00
<symbol > ButtonRelease</symbol>
2014-07-19 23:53:48 -07:00
event instead of a
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
event and unlocks the specified button. If the corresponding key press locked
2010-11-30 10:52:07 -05:00
a button, the key release is ignored and has no effect.
</para>
</listitem>
</itemizedlist>
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field is composed of the bitwise inclusive OR of the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.8" > Table 16.8</link> .
2014-07-19 23:53:48 -07:00
A general meaning is given in the table, but the exact meaning depends on
2014-07-06 20:25:46 -07:00
the action
2014-07-10 13:40:40 -07:00
<structfield > type</structfield> :
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.8' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Pointer Button Action Flags</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_UseDfltButton</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, the action uses the pointer button specified by the
2014-07-10 11:08:14 -07:00
<structfield > mk_dflt_btn</structfield>
2014-07-19 23:53:48 -07:00
attribute of the
2014-07-06 20:25:46 -07:00
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
control (see <link linkend= "The_MouseKeys_Control" > section 10.5.1</link> ). Otherwise, the action uses the pointer button
2014-07-06 20:25:46 -07:00
specified by the
2014-07-10 11:08:14 -07:00
<structfield > button</structfield>
2010-11-30 10:52:07 -05:00
field.
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoLock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action type is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockPtrBtn</symbol> ,
2014-07-06 20:25:46 -07:00
the server only unlocks the pointer button.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoUnlock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action type is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockPtrBtn</symbol> ,
2014-07-06 20:25:46 -07:00
the server only locks the pointer button.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Changing_the_Pointer_Button_Simulated' >
2010-11-30 10:52:07 -05:00
<title > Actions for Changing the Pointer Button Simulated</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Changing_the_Pointer_Button_Simulated" >
<primary > <structname > XkbPtrDfltAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 11:08:14 -07:00
<structname > XkbPtrDfltAction</structname>
2014-07-19 23:53:48 -07:00
structure change the
2014-07-10 11:08:14 -07:00
<structfield > mk_dflt_btn</structfield>
2014-07-19 23:53:48 -07:00
attribute of the
2014-07-06 20:25:46 -07:00
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
control (see <link linkend= "The_MouseKeys_Control" > section 10.5.1</link> ):
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbPtrDfltAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_SetPtrDflt</symbol> */
unsigned char flags; /* controls the pointer button number */
unsigned char affect; /* <symbol > XkbSA_AffectDfltBtn</symbol> */
char valueXXX; /* new default button member */
2014-07-10 11:08:14 -07:00
} <structname > XkbPtrDfltAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
If the
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
control is not enabled,
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
events are treated as though the action is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_NoAction</symbol> .
2014-07-06 20:25:46 -07:00
Otherwise, this action changes the
2014-07-10 11:08:14 -07:00
<structfield > mk_dflt_btn</structfield>
2014-07-19 23:53:48 -07:00
attribute of the
2014-07-06 20:25:46 -07:00
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
control.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field of the
2014-07-10 11:08:14 -07:00
<structname > XkbPtrDfltAction</structname>
2014-07-19 23:53:48 -07:00
structure should always be
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetPtrDflt</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field is composed of the bitwise inclusive OR of the values shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.9" > Table 16.9</link>
2014-07-19 23:53:48 -07:00
(currently there is only one value defined).
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.9' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Pointer Default Flags</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_DfltBtnAbsolute</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, the
2014-07-10 11:08:14 -07:00
<structfield > value</structfield>
2014-07-19 23:53:48 -07:00
field represents an absolute pointer button. Otherwise, the
2014-07-10 11:08:14 -07:00
<structfield > value</structfield>
2014-07-19 23:53:48 -07:00
field represents the amount to be added to the current default button.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > affect</structfield>
2014-07-19 23:53:48 -07:00
field specifies what changes as a result of this action. The only valid value
2014-07-06 20:25:46 -07:00
for the
2014-07-10 11:08:14 -07:00
<structfield > affect</structfield>
2014-07-19 23:53:48 -07:00
field is <symbol > XkbSA_AffectDfltBtn</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > valueXXX</structfield>
2014-07-19 23:53:48 -07:00
field is a signed character that represents the new button value for the
2014-07-10 11:08:14 -07:00
<structfield > mk_dflt_btn</structfield>
2014-07-19 23:53:48 -07:00
attribute of the
2014-07-06 20:25:46 -07:00
<emphasis > MouseKeys</emphasis>
2014-07-19 23:53:48 -07:00
control (see <link linkend= "The_MouseKeys_Control" > section 10.5.1</link> ). If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_DfltBtnAbsolute</symbol>
2014-07-19 23:53:48 -07:00
is set in
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield> ,
<structfield > valueXXX</structfield>
2014-07-19 23:53:48 -07:00
specifies the button to be used; otherwise,
2014-07-10 11:08:14 -07:00
<structfield > valueXXX</structfield>
2014-07-19 23:53:48 -07:00
specifies the amount to be added to the current default button. In either
2010-11-30 10:52:07 -05:00
case, illegal button choices are wrapped back around into range. Xkb provides
the following macros, to convert between the integer and signed character
2014-07-06 20:25:46 -07:00
values in
2014-07-10 11:08:14 -07:00
<structname > XkbPtrDfltAction</structname>
2014-07-19 23:53:48 -07:00
structures:
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSAPtrDfltValue" > <primary > <function > XkbSAPtrDfltValue</function> </primary> </indexterm>
<funcsynopsis id= "XkbSAPtrDfltValue" >
<funcprototype >
<funcdef > int <function > XkbSAPtrDfltValue</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbAction <parameter > act</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to extract group
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSAPtrDfltValue</function>
2014-07-19 23:53:48 -07:00
returns the
2014-07-10 11:08:14 -07:00
<structfield > valueXXX</structfield>
2014-07-19 23:53:48 -07:00
field of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
converted to a signed int.
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSASetPtrDfltValue" > <primary > <function > XkbSASetPtrDfltValue</function> </primary> </indexterm>
<funcsynopsis id= "XkbSASetPtrDfltValue" >
<funcprototype >
<funcdef > void <function > XkbSASetPtrDfltValue</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act, val</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbPtrDfltAction <parameter > act</parameter> </paramdef>
<paramdef > int <parameter > val</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
2014-07-10 11:08:14 -07:00
action in which to set <structfield > valueXXX</structfield>
2014-07-06 15:57:41 -07:00
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > val</parameter>
</term>
<listitem >
<para >
2014-07-10 11:08:14 -07:00
value to set in <structfield > valueXXX</structfield>
2014-07-06 15:57:41 -07:00
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSASetPtrDfltValue</function>
2014-07-19 23:53:48 -07:00
sets the
2014-07-10 11:08:14 -07:00
<structfield > valueXXX</structfield>
2014-07-19 23:53:48 -07:00
field of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
from
2014-07-08 22:22:29 -07:00
<parameter > val</parameter> .
2010-11-30 10:52:07 -05:00
</para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Locking_Modifiers_and_Group' >
2010-11-30 10:52:07 -05:00
<title > Actions for Locking Modifiers and Group</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Locking_Modifiers_and_Group" >
<primary > <structname > XkbISOAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 11:08:14 -07:00
<structname > XkbISOAction</structname>
2014-07-19 23:53:48 -07:00
structure lock modifiers and the group according to the ISO9995 specification.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
Operated by itself, the
2014-07-10 11:08:14 -07:00
<structname > XkbISOAction</structname>
2014-07-19 23:53:48 -07:00
is just a caps lock. Operated simultaneously with another modifier key, it
2014-07-06 20:25:46 -07:00
transforms the other key into a locking key. For example, press
2014-07-08 22:46:03 -07:00
<keysym > ISO_Lock</keysym> ,
2014-07-06 20:25:46 -07:00
press and release
2014-07-08 22:46:03 -07:00
<keysym > Control_L</keysym> ,
2014-07-06 20:25:46 -07:00
release
2014-07-08 22:46:03 -07:00
<keysym > ISO_Lock</keysym>
2014-07-19 23:53:48 -07:00
ends up locking the
2014-07-06 20:40:18 -07:00
<symbol > Control</symbol>
2014-07-19 23:53:48 -07:00
modifier.
2010-11-30 10:52:07 -05:00
</para>
<para >
The default behavior is to convert:
2014-07-18 23:56:29 -07:00
<simplelist type= 'vert' columns= '1' >
<member > {Set,Latch}Mods to: LockMods</member>
<member > {Set,Latch}Group to: LockGroup</member>
<member > SetPtrBtn to: LockPtrBtn</member>
<member > SetControls to: LockControls</member>
</simplelist>
</para>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
The
<emphasis > affects</emphasis>
2014-07-19 23:53:48 -07:00
field allows you to turn those effects on or off individually. Set
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISONoAffectMods</symbol>
2014-07-19 23:53:48 -07:00
to disable the first,
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISONoAffectGroup</symbol>
2014-07-19 23:53:48 -07:00
to disable the second, and so forth.
2010-11-30 10:52:07 -05:00
</para>
<para > <programlisting >
typedef struct _XkbISOAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_ISOLock</symbol> */
unsigned char flags; /* controls changes to group or
modifier state */
unsigned char mask; /* same as <structfield > mask</structfield> field of
a modifier description */
unsigned char real_mods; /* same as <structfield > real_mods</structfield> field of
a modifier description */
char group_XXX; /* group index or delta group */
unsigned char affect; /* specifies whether to affect
mods, group, ptrbtn, or controls */
unsigned char vmods1; /* derived from <structfield > vmods</structfield> field of
a modifier description */
unsigned char vmods2; /* derived from <structfield > vmods</structfield> field of
a modifier description */
2014-07-10 11:08:14 -07:00
} <structname > XkbISOAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field of the
2014-07-10 11:08:14 -07:00
<structname > XkbISOAction</structname>
2014-07-19 23:53:48 -07:00
structure should always be
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The interpretation of the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field depends on whether the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISODfltIsGroup</symbol>
2014-07-19 23:53:48 -07:00
is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field or not.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISODfltIsGroup</symbol>
2014-07-19 23:53:48 -07:00
is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, the action is used to change the group state. The remaining valid bits
2014-07-06 20:25:46 -07:00
of the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field are composed of a bitwise inclusive OR using the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.10" > Table 16.10</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.10' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > ISO Action Flags when XkbSA_ISODfltIsGroup is Set</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISODfltIsGroup</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<para >
If set, the action is used to change the base group state. Must be set for the
remaining bits in this table to carry their interpretations.
</para>
<para >
2014-07-06 20:25:46 -07:00
A key press sets the base group as specified by the
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field and the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_GroupAbsolute</symbol>
2014-07-19 23:53:48 -07:00
bit of the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field (see section Note). If no other actions are transformed by the
2014-07-09 23:26:37 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action, a key release locks the group. Otherwise, a key release clears group
2010-11-30 10:52:07 -05:00
set by the key press.
</para>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_GroupAbsolute</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, the
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field represents an absolute group number. Otherwise, it represents a group
2010-11-30 10:52:07 -05:00
delta to be added to the current group to determine the new group number.
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectMods</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If not set, any
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetMods</symbol>
2014-07-19 23:53:48 -07:00
or
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LatchMods</symbol>
2014-07-19 23:53:48 -07:00
actions that occur simultaneously with the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action are treated as
2014-07-09 23:26:37 -07:00
<symbol > XkbSA_LockMods</symbol>
2014-07-19 23:53:48 -07:00
actions instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectGroup</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If not set, any
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetGroup</symbol>
2014-07-19 23:53:48 -07:00
or
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LatchGroup</symbol>
2014-07-19 23:53:48 -07:00
actions that occur simultaneously with the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action are treated as
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockGroup</symbol>
2014-07-19 23:53:48 -07:00
actions instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectPtr</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If not set, any
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_PtrBtn</symbol>
2014-07-19 23:53:48 -07:00
actions that occur simultaneously with the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action are treated as
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockPtrBtn</symbol>
2014-07-19 23:53:48 -07:00
actions instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectCtrls</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If not set, any
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetControls</symbol>
2014-07-19 23:53:48 -07:00
actions that occur simultaneously with the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action are treated as
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockControls</symbol>
2014-07-19 23:53:48 -07:00
actions instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISODfltIsGroup</symbol>
2014-07-19 23:53:48 -07:00
is not set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, the action is used to change the modifier state and the remaining valid
2014-07-06 20:25:46 -07:00
bits of the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field are composed of a bitwise inclusive OR using the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.11" > Table 16.11</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.11' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > ISO Action Flags when XkbSA_ISODfltIsGroup is Not Set</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISODfltIsGroup</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<para >
If not set, action is used to change the base modifier state. Must not be set
for the remaining bits in this table to carry their interpretations.
</para>
<para >
A key press sets the action modifiers in the keyboard’ s base modifiers using
2014-07-06 20:25:46 -07:00
the
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield> ,
<structfield > real_mods</structfield> ,
<structfield > vmods1</structfield> ,
2014-07-06 20:25:46 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods2</structfield>
2014-07-06 21:29:59 -07:00
fields (see <link linkend= "Actions_for_Changing_Modifiers_State" > section 16.1.3</link> ). If no other actions are transformed by the
2014-07-09 23:26:37 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action, a key release locks the action modifiers. Otherwise, a key release
2010-11-30 10:52:07 -05:00
clears the base modifiers set by the key press.
</para>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_UseModMapMods</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
If set, the action modifiers are determined by the modifiers bound by the
modifier mapping of the key. Otherwise, the action modifiers are set to the
2014-07-06 20:25:46 -07:00
modifiers specified by the
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield> ,
<structfield > real_mods</structfield> ,
2014-07-10 13:40:40 -07:00
<structfield > vmods1</structfield> ,
2014-07-06 20:25:46 -07:00
and
2014-07-10 13:40:40 -07:00
<structfield > vmods2</structfield>
2014-07-19 23:53:48 -07:00
fields.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoLock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry > If set, the server only unlocks the action modifiers.</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoUnlock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry > If set, the server only locks the action modifiers. </entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectMods</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If not set, any
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetMods</symbol>
2014-07-19 23:53:48 -07:00
or
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LatchMods</symbol>
2014-07-19 23:53:48 -07:00
actions that occur simultaneously with the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action are treated as
2014-07-09 23:26:37 -07:00
<symbol > XkbSA_LockMods</symbol>
2014-07-19 23:53:48 -07:00
actions instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectGroup</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If not set, any
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetGroup</symbol>
2014-07-19 23:53:48 -07:00
or
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LatchGroup</symbol>
2014-07-19 23:53:48 -07:00
actions that occur simultaneously with the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action are treated as
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockGroup</symbol>
2014-07-19 23:53:48 -07:00
actions instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectPtr</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If not set, any
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_PtrBtn</symbol>
2014-07-19 23:53:48 -07:00
actions that occur simultaneously with the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action are treated as
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockPtrBtn</symbol>
2014-07-19 23:53:48 -07:00
actions instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectCtrls</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If not set, any
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetControls</symbol>
2014-07-19 23:53:48 -07:00
actions that occur simultaneously with the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISOLock</symbol>
2014-07-19 23:53:48 -07:00
action are treated as
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockControls</symbol>
2014-07-19 23:53:48 -07:00
actions instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > group_XXX</structfield>
2014-07-19 23:53:48 -07:00
field represents a signed character. Xkb provides macros to convert between a
2010-11-30 10:52:07 -05:00
signed integer value and a signed character as shown in section Note.
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield> ,
<structfield > real_mods</structfield> ,
<structfield > vmods1</structfield> ,
2014-07-06 20:25:46 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods2</structfield>
2014-07-19 23:53:48 -07:00
fields represent the components of an Xkb modifier description
(see <link linkend= "Modifier_Definitions" > section 7.2</link> ). While the
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > real_mods</structfield>
2014-07-19 23:53:48 -07:00
fields correspond directly to the
2014-07-10 11:08:14 -07:00
<structfield > mask</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > real_mods</structfield>
2014-07-19 23:53:48 -07:00
fields of an Xkb modifier description, the
2014-07-10 11:08:14 -07:00
<structfield > vmods1</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods2</structfield>
2014-07-19 23:53:48 -07:00
fields are combined to correspond to the
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
field of an Xkb modifier description. Xkb provides macros to convert between
2014-07-06 21:29:59 -07:00
the two formats as shown in <link linkend= "Actions_for_Changing_Modifiers_State" > section 16.1.3</link> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > affect</structfield>
2014-07-19 23:53:48 -07:00
field is composed of a bitwise inclusive OR using the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.11" > Table 16.11</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.12' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > ISO Action Affect Field Values</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= '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 > Affect</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-09 23:26:37 -07:00
<entry > <symbol > XkbSA_ISONoAffectMods</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISONoAffectMods</symbol>
2014-07-19 23:53:48 -07:00
is not set, any
2014-07-06 20:25:46 -07:00
<emphasis > SA_SetMods</emphasis>
2014-07-19 23:53:48 -07:00
or
2014-07-06 20:25:46 -07:00
<emphasis > SA_LatchMods</emphasis>
2014-07-19 23:53:48 -07:00
actions occurring simultaneously with the
2014-07-10 11:08:14 -07:00
<structname > XkbISOAction</structname>
2014-07-19 23:53:48 -07:00
are treated as
2014-07-06 20:25:46 -07:00
<emphasis > SA_LockMods</emphasis>
2014-07-19 23:53:48 -07:00
instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectGroup</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISONoAffectGroup</symbol>
2014-07-19 23:53:48 -07:00
is not set, any
2014-07-06 20:25:46 -07:00
<emphasis > SA_SetGroup</emphasis>
2014-07-19 23:53:48 -07:00
or
2014-07-06 20:25:46 -07:00
<emphasis > SA_LatchGroup</emphasis>
2014-07-19 23:53:48 -07:00
actions occurring simultaneously with the
2014-07-10 11:08:14 -07:00
<structname > XkbISOAction</structname>
2014-07-19 23:53:48 -07:00
are treated as
2014-07-06 20:25:46 -07:00
<emphasis > SA_LockGroup</emphasis>
2014-07-19 23:53:48 -07:00
instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectPtr</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISONoAffectPtr</symbol>
2014-07-19 23:53:48 -07:00
is not set, any
2014-07-06 20:25:46 -07:00
<emphasis > SA_PtrBtn</emphasis>
2014-07-19 23:53:48 -07:00
actions occurring simultaneously with the
2014-07-10 11:08:14 -07:00
<structname > XkbISOAction</structname>
2014-07-19 23:53:48 -07:00
are treated as
2014-07-06 20:25:46 -07:00
<emphasis > SA_LockPtrBtn</emphasis>
2014-07-19 23:53:48 -07:00
instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_ISONoAffectCtrls</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ISONoAffectCtrls</symbol>
2014-07-19 23:53:48 -07:00
is not set, any
2014-07-06 20:25:46 -07:00
<emphasis > SA_SetControls</emphasis>
2014-07-19 23:53:48 -07:00
actions occurring simultaneously with the
2014-07-10 11:08:14 -07:00
<structname > XkbISOAction</structname>
2014-07-19 23:53:48 -07:00
are treated as
2014-07-06 20:25:46 -07:00
<emphasis > SA_LockControls</emphasis>
2014-07-19 23:53:48 -07:00
instead.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Changing_the_Active_Screen' >
2010-11-30 10:52:07 -05:00
<title > Actions for Changing the Active Screen</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Changing_the_Active_Screen" >
<primary > <structname > XkbSwitchScreenAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 13:40:40 -07:00
<structname > XkbSwitchScreenAction</structname>
2014-07-19 23:53:48 -07:00
action structure change the active screen on a multiscreen display:
2010-11-30 10:52:07 -05:00
</para>
<note > <para > This action is optional. Servers are free to ignore the action or
any of its flags if they do not support the requested behavior. If the action
2014-07-06 20:25:46 -07:00
is ignored, it behaves like
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_NoAction</symbol> .
2014-07-06 20:25:46 -07:00
Otherwise, key press and key release events do not generate an event.
2010-11-30 10:52:07 -05:00
</para> </note>
<para > <programlisting >
typedef struct _XkbSwitchScreenAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_SwitchScreen</symbol> */
unsigned char flags; /* controls screen switching */
char screenXXX; /* screen number or delta */
2014-07-10 11:08:14 -07:00
} <structname > XkbSwitchScreenAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field of the
2014-07-10 11:08:14 -07:00
<structname > XkbSwitchScreenAction</structname>
2014-07-19 23:53:48 -07:00
structure should always be
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SwitchScreen</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field is composed of the bitwise inclusive OR of the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.13" > Table 16.13</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.13' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Switch Screen Action Flags</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SwitchAbsolute</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, the
2014-07-10 11:08:14 -07:00
<structfield > screenXXX</structfield>
2014-07-19 23:53:48 -07:00
field represents the index of the new screen. Otherwise, it represents an
2010-11-30 10:52:07 -05:00
offset from the current screen to the new screen.
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SwitchApplication</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
If not set, the action should switch to another screen on the same
server. Otherwise, it should switch to another X server or application that
shares the same physical display.
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > screenXXX</structfield>
2014-07-19 23:53:48 -07:00
field is a signed character value that represents either the relative or
2014-07-06 20:25:46 -07:00
absolute screen index, depending on the state of the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SwitchAbsolute</symbol>
2014-07-19 23:53:48 -07:00
bit in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field. Xkb provides the following macros to convert between the integer and
2014-07-06 20:25:46 -07:00
signed character value for screen numbers in
2014-07-10 11:08:14 -07:00
<structname > XkbSwitchScreenAction</structname>
2014-07-19 23:53:48 -07:00
structures:
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSAScreen" > <primary > <function > XkbSAScreen</function> </primary> </indexterm>
<funcsynopsis id= "XkbSAScreen" >
<funcprototype >
<funcdef > int <function > XkbSAScreen</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbSwitchScreenAction <parameter > act</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to extract screen
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSAScreen</function>
2014-07-19 23:53:48 -07:00
returns the
2014-07-10 11:08:14 -07:00
<structfield > screenXXX</structfield>
2014-07-19 23:53:48 -07:00
field of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
converted to a signed int.
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSASetScreen" > <primary > <function > XkbSASetScreen</function> </primary> </indexterm>
<funcsynopsis id= "XkbSASetScreen" >
<funcprototype >
<funcdef > void <function > XkbSASetScreen</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act, s</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbSwitchScreenAction <parameter > act</parameter> </paramdef>
<paramdef > int <parameter > s</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
2014-07-10 11:08:14 -07:00
action in which to set <structfield > screenXXX</structfield>
2014-07-06 15:57:41 -07:00
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > s</parameter>
</term>
<listitem >
<para >
2014-07-10 11:08:14 -07:00
value to set in <structfield > screenXXX</structfield>
2014-07-06 15:57:41 -07:00
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSASetScreen</function>
2014-07-19 23:53:48 -07:00
sets the
2014-07-10 11:08:14 -07:00
<structfield > screenXXX</structfield>
2014-07-19 23:53:48 -07:00
field of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
from
2014-07-08 22:22:29 -07:00
<parameter > s</parameter> .
2010-11-30 10:52:07 -05:00
</para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Changing_Boolean_Controls_State' >
2010-11-30 10:52:07 -05:00
<title > Actions for Changing Boolean Controls State</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Changing_Boolean_Controls_State" >
<primary > <structname > XkbCtrlsAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 11:08:14 -07:00
<structname > XkbCtrlsAction</structname>
2014-07-19 23:53:48 -07:00
structure change the state of the boolean controls (see <link linkend= "Controls_that_Enable_and_Disable_Other_Controls" > section 10.1</link> ):
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbCtrlsAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_SetControls</symbol> ,
<symbol > XkbSA_LockControls</symbol> */
unsigned char flags; /* with <structfield > type</structfield> , controls enabling
and disabling of controls */
unsigned char ctrls3; /* <structfield > ctrls0</structfield> through <structfield > ctrls3</structfield>
represent the boolean controls */
unsigned char ctrls2; /* <structfield > ctrls0</structfield> through <structfield > ctrls3</structfield>
represent the boolean controls */
unsigned char ctrls1; /* <structfield > ctrls0</structfield> through <structfield > ctrls3</structfield>
represent the boolean controls */
unsigned char ctrls0; /* <structfield > ctrls0</structfield> through <structfield > ctrls3</structfield>
represent the boolean controls */
2014-07-10 11:08:14 -07:00
} <structname > XkbCtrlsAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field can have any one of the values shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.14" > Table 16.14</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.14' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Controls Action Types</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= '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 > Type</entry>
<entry > Effect</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SetControls</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
A key press enables any boolean controls specified in the
2014-07-10 11:08:14 -07:00
<structfield > ctrls</structfield>
2014-07-19 23:53:48 -07:00
fields that were not already enabled at the time of the key press.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
A key release disables any controls enabled by the key press.
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
This action can cause
2014-07-08 23:29:49 -07:00
<symbol > XkbControlsNotify</symbol>
2014-07-19 23:53:48 -07:00
events (see <link linkend= "Controls_that_Enable_and_Disable_Other_Controls" > section 10.1</link> ).
2010-11-30 10:52:07 -05:00
</para>
</listitem>
</itemizedlist>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockControls</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoLock</symbol>
2014-07-19 23:53:48 -07:00
bit is not set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, a key press enables any controls specified in the
2014-07-10 11:08:14 -07:00
<structfield > ctrls</structfield>
2014-07-19 23:53:48 -07:00
fields that were not already enabled at the time of the key press.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoUnlock</symbol>
2014-07-19 23:53:48 -07:00
bit is not set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, a key release disables any controls specified in the
2014-07-10 11:08:14 -07:00
<structfield > ctrls</structfield>
2014-07-19 23:53:48 -07:00
fields that were not already disabled at the time of the key press.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
This action can cause
2014-07-08 23:29:49 -07:00
<symbol > XkbControlsNotify</symbol>
2014-07-19 23:53:48 -07:00
events (see <link linkend= "Controls_that_Enable_and_Disable_Other_Controls" > section 10.1</link> ).
2010-11-30 10:52:07 -05:00
</para>
</listitem>
</itemizedlist>
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field is composed of the bitwise inclusive OR of the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.15" > Table 16.15</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.15' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Control Action Flags</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoLock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action type is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockControls</symbol> ,
2014-07-06 20:25:46 -07:00
the server only disables controls.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoUnlock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action type is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockControls</symbol> ,
2014-07-06 20:25:46 -07:00
the server only enables controls.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetControls</symbol>
2014-07-19 23:53:48 -07:00
action implements a key that enables a boolean control when pressed and
2014-07-06 20:25:46 -07:00
disables it when released. The
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockControls</symbol>
2014-07-19 23:53:48 -07:00
action is used to implement a key that toggles the state of a boolean control
2014-07-06 20:25:46 -07:00
each time it is pressed and released. The
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoLock</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoUnlock</symbol>
2014-07-19 23:53:48 -07:00
flags allow modifying the toggling behavior to only unlock or only lock the
2010-11-30 10:52:07 -05:00
boolean control.
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > ctrls0</structfield> ,
<structfield > ctrls1</structfield> ,
<structfield > ctrls2</structfield> ,
2014-07-06 20:25:46 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > ctrls3</structfield>
2014-07-19 23:53:48 -07:00
fields represent the boolean controls in the
2014-07-10 11:08:14 -07:00
<structfield > enabled_ctrls</structfield>
2014-07-19 23:53:48 -07:00
field of the controls structure (see <link linkend= "Controls_that_Enable_and_Disable_Other_Controls" > section 10.1</link> ). Xkb provides the following
2010-11-30 10:52:07 -05:00
macros, to convert between the two formats:
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbActionCtrls" > <primary > <function > XkbActionCtrls</function> </primary> </indexterm>
<funcsynopsis id= "XkbActionCtrls" >
<funcprototype >
<funcdef > unsigned int <function > XkbActionCtrls</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbCtrlsAction <parameter > act</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to extract controls
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbActionCtrls</function>
2014-07-19 23:53:48 -07:00
returns the
2014-07-10 11:08:14 -07:00
<structfield > ctrls</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
converted to an unsigned int.
2014-07-06 15:57:41 -07:00
</para>
2023-08-20 14:31:20 -07:00
<indexterm significance= "preferred" zone= "XkbActionSetCtrls" > <primary > <function > XkbActionSetCtrls</function> </primary> </indexterm>
<funcsynopsis id= "XkbActionSetCtrls" >
2014-07-06 15:57:41 -07:00
<funcprototype >
2023-08-20 14:31:20 -07:00
<funcdef > void <function > XkbActionSetCtrls</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act, ctrls</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbCtrlsAction <parameter > act</parameter> </paramdef>
<paramdef > unsigned int <parameter > ctrls</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action in which to set ctrls0-ctrls3
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > ctrls</parameter>
</term>
<listitem >
<para >
value to set in ctrls0-ctrls3
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2023-08-20 14:31:20 -07:00
<function > XkbActionSetCtrls</function>
2014-07-19 23:53:48 -07:00
sets the
2014-07-10 11:08:14 -07:00
<structfield > ctrls0</structfield>
2014-07-19 23:53:48 -07:00
through
2014-07-10 11:08:14 -07:00
<structfield > ctrls3</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
from
2014-07-08 22:22:29 -07:00
<parameter > ctrls</parameter> .
2010-11-30 10:52:07 -05:00
</para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Generating_Messages' >
2010-11-30 10:52:07 -05:00
<title > Actions for Generating Messages</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Generating_Messages" >
<primary > <structname > XkbMessageAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 11:08:14 -07:00
<structname > XkbMessageAction</structname>
2014-07-19 23:53:48 -07:00
structure generate
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessage</symbol>
2014-07-19 23:53:48 -07:00
events:
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
#define XkbActionMessageLength 6
2010-11-30 10:52:07 -05:00
typedef struct _XkbMessageAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_ActionMessage</symbol> */
unsigned char flags; /* controls event generation via
key presses and releases */
unsigned char message[XkbActionMessageLength]; /* message */
2014-07-10 11:08:14 -07:00
} <structname > XkbMessageAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field of the
2014-07-10 11:08:14 -07:00
<structname > XkbMessageAction</structname>
2014-07-19 23:53:48 -07:00
structure should always be
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_ActionMessage</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field is composed of the bitwise inclusive OR of the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.16" > Table 16.16</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.16' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Message Action Flags</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_MessageOnPress</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, key press events generate an
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessage</symbol>
2014-07-19 23:53:48 -07:00
event that reports the keycode, event type, and contents of the
2014-07-10 11:08:14 -07:00
<structfield > message</structfield>
2014-07-19 23:53:48 -07:00
field.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_MessageOnRelease</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, key release events generate an
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessage</symbol>
2014-07-19 23:53:48 -07:00
event that reports the keycode, event type, and contents of the
2014-07-10 11:08:14 -07:00
<structfield > message</structfield>
2014-07-19 23:53:48 -07:00
field.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_MessageGenKeyEvent</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, key press and key release events generate
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
events, regardless of whether they generate
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessage</symbol>
2014-07-19 23:53:48 -07:00
events.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > message</structfield>
2014-07-19 23:53:48 -07:00
field is an array of
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessageLength</symbol>
2014-07-19 23:53:48 -07:00
unsigned characters and may be set to anything the keymap designer wishes.
2010-11-30 10:52:07 -05:00
</para>
2011-10-07 22:52:30 -06:00
<sect3 id= 'Detecting_Key_Action_Messages' >
2010-11-30 10:52:07 -05:00
<title > Detecting Key Action Messages</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Detecting_Key_Action_Messages" >
<primary > events</primary> <secondary > <symbol > XkbActionMessage</symbol> </secondary> </indexterm>
<indexterm significance= "preferred" zone= "Detecting_Key_Action_Messages" >
<primary > <structname > XkbActionMessageEvent</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
To receive
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessage</symbol>
2014-07-19 23:53:48 -07:00
events by calling either
2014-07-06 20:34:51 -07:00
<function > XkbSelectEvents</function>
2014-07-19 23:53:48 -07:00
or
2014-07-06 20:34:51 -07:00
<function > XkbSelectEventDetails</function>
2014-07-19 23:53:48 -07:00
(see <link linkend= "Selecting_Xkb_Events" > section 4.3</link> ).
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
To receive
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessage</symbol>
2014-07-19 23:53:48 -07:00
events under all possible conditions, use
2014-07-06 20:34:51 -07:00
<function > XkbSelectEvents</function>
2014-07-19 23:53:48 -07:00
and pass
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessageMask</symbol>
2014-07-19 23:53:48 -07:00
in both
2014-07-10 15:00:30 -07:00
<parameter > bits_to_change</parameter>
2014-07-19 23:53:48 -07:00
and
2014-07-10 15:00:30 -07:00
<parameter > values_for_bits</parameter> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessage</symbol>
2014-07-19 23:53:48 -07:00
event has no event details. However, you can call
2014-07-06 20:34:51 -07:00
<function > XkbSelectEventDetails</function>
2014-07-19 23:53:48 -07:00
using
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessage</symbol>
2014-07-19 23:53:48 -07:00
as the
2014-07-10 11:08:14 -07:00
<structfield > event_type</structfield>
2014-07-19 23:53:48 -07:00
and specifying
2014-07-09 23:26:37 -07:00
<symbol > XkbAllActionMessagesMask</symbol>
2014-07-19 23:53:48 -07:00
in
2014-07-10 15:00:30 -07:00
<parameter > bits_to_change</parameter>
2014-07-19 23:53:48 -07:00
and
2014-07-10 15:00:30 -07:00
<parameter > values_for_bits</parameter> .
2014-07-19 23:53:48 -07:00
This has the same effect as a call to
2014-07-06 20:34:51 -07:00
<function > XkbSelectEvents</function> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The structure for the
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessage</symbol>
2014-07-19 23:53:48 -07:00
event is defined as follows:
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbActionMessage {
2014-07-19 00:48:02 -07:00
int type; /* Xkb extension base event code */
unsigned long serial; /* X server serial number for event */
Bool send_event; /* <symbol > True</symbol> ⇒ synthetically generated */
Display * display; /* server connection where event generated */
Time time; /* server time when event generated */
int xkb_type; /* <symbol > XkbActionMessage</symbol> */
int device; /* Xkb device ID,
will not be <symbol > XkbUseCoreKbd</symbol> */
KeyCode keycode; /* keycode of key triggering event */
Bool press; /* <symbol > True</symbol> ⇒ key press,
<symbol > False</symbol> ⇒ release */
Bool key_event_follows;/* <symbol > True</symbol> ⇒ KeyPress/KeyRelease follows */
char message[XkbActionMessageLength+1]; /* message text */
2014-07-10 11:08:14 -07:00
} <structname > XkbActionMessageEvent</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > keycode</structfield>
2014-07-19 23:53:48 -07:00
is the keycode of the key that was pressed or released. The
2014-07-10 11:08:14 -07:00
<structfield > press</structfield>
2014-07-19 23:53:48 -07:00
field specifies whether the event was the result of a key press or key
2010-11-30 10:52:07 -05:00
release.
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > key_event_follows</structfield>
2014-07-19 23:53:48 -07:00
specifies whether a
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
(if
2014-07-10 11:08:14 -07:00
<structfield > press</structfield>
2014-07-19 23:53:48 -07:00
is
2014-07-18 21:29:33 -07:00
<symbol > True</symbol> )
2014-07-19 23:53:48 -07:00
or
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
(if
2014-07-10 11:08:14 -07:00
<structfield > press</structfield>
2014-07-19 23:53:48 -07:00
is
2014-07-18 21:29:33 -07:00
<symbol > False</symbol> )
2014-07-19 23:53:48 -07:00
event is also sent to the client. As with all other Xkb events,
2014-07-10 13:40:40 -07:00
<structname > XkbActionMessageEvent</structname> s
2014-07-19 23:53:48 -07:00
are delivered to all clients requesting them, regardless of the current
2014-07-06 20:25:46 -07:00
keyboard focus. However, the
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
or
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
event that conditionally follows an
2014-07-10 11:08:14 -07:00
<structname > XkbActionMessageEvent</structname>
2014-07-19 23:53:48 -07:00
is sent only to the client selected by the current keyboard focus.
2014-07-10 11:08:14 -07:00
<structfield > key_event_follows</structfield>
2014-07-19 23:53:48 -07:00
is
2014-07-06 20:40:18 -07:00
<symbol > True</symbol>
2014-07-19 23:53:48 -07:00
only for the client that is actually sent the following
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
or
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
event.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > message</structfield>
2014-07-19 23:53:48 -07:00
field is set to the message specified in the action and is guaranteed to be
2014-07-08 22:26:56 -07:00
<symbol > NULL</symbol>
2014-07-06 20:25:46 -07:00
-terminated; the Xkb extension forces a
2014-07-08 22:26:56 -07:00
<symbol > NULL</symbol>
2014-07-19 23:53:48 -07:00
into
2014-07-10 11:08:14 -07:00
<structfield > message</structfield>
2014-07-06 20:25:46 -07:00
[
2014-07-08 23:29:49 -07:00
<symbol > XkbActionMessageLength</symbol>
2010-11-30 10:52:07 -05:00
].
</para>
</sect3>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Generating_a_Different_Keycode' >
2010-11-30 10:52:07 -05:00
<title > Actions for Generating a Different Keycode</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Generating_a_Different_Keycode" >
<primary > <structname > XkbRedirectKeyAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with the
2014-07-10 11:08:14 -07:00
<structname > XkbRedirectKeyAction</structname>
2014-07-19 23:53:48 -07:00
structure generate
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
events containing a keycode different from the key that was pressed or
2010-11-30 10:52:07 -05:00
released:
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbRedirectKeyAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_RedirectKey</symbol> */
unsigned char new_key; /* keycode to be put in event */
unsigned char mods_mask; /* mask of real mods to be reset */
unsigned char mods; /* mask of real mods to take values from */
unsigned char vmods_mask0; /* first half of mask of virtual mods
to be reset */
unsigned char vmods_mask1; /* other half of mask of virtual mods
to be reset */
unsigned char vmods0; /* first half of mask of virtual mods
to take values from */
unsigned char vmods1; /* other half of mask of virtual mods
to take values from */
2014-07-10 11:08:14 -07:00
} <structname > XkbRedirectKeyAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field for the
2014-07-10 11:08:14 -07:00
<structname > XkbRedirectKeyAction</structname>
2014-07-19 23:53:48 -07:00
structure should always be
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_RedirectKey</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
Key presses cause a
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
event for the key specified by the
2014-07-10 11:08:14 -07:00
<structfield > new_key</structfield>
2014-07-19 23:53:48 -07:00
field instead of the actual key. The state reported in this event reports the
2010-11-30 10:52:07 -05:00
current effective modifiers changed as follows: any real modifiers selected by
2014-07-06 20:25:46 -07:00
the
2014-07-10 11:08:14 -07:00
<structfield > mods_mask</structfield>
2014-07-19 23:53:48 -07:00
field are set to corresponding values from the
2014-07-10 11:08:14 -07:00
<structfield > mods</structfield>
2014-07-19 23:53:48 -07:00
field. Any real modifiers bound to the virtual modifiers specified by the
2014-07-10 11:08:14 -07:00
<structfield > vmods_mask0</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods_mask1</structfield>
2014-07-19 23:53:48 -07:00
fields are either set or cleared, depending on the corresponding values in the
2014-07-10 11:08:14 -07:00
<structfield > vmods0</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods1</structfield>
2014-07-19 23:53:48 -07:00
fields. If the real and virtual modifier definitions specify conflicting
2010-11-30 10:52:07 -05:00
values for a single modifier, the real modifier definition has priority.
</para>
<para >
2014-07-06 20:25:46 -07:00
Key releases cause a
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
event for the key specified by the
2014-07-10 11:08:14 -07:00
<structfield > new_key</structfield>
2014-07-19 23:53:48 -07:00
field instead of the actual key. The state for this event consists of the
2010-11-30 10:52:07 -05:00
effective keyboard modifiers at the time of the release, changed as described
previously.
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_RedirectKey</symbol>
2014-07-19 23:53:48 -07:00
action normally redirects to another key on the same device as the key that
2010-11-30 10:52:07 -05:00
caused the event, unless that device does not belong to the input extension
2014-07-09 23:26:37 -07:00
<symbol > KeyClass</symbol> ,
2014-07-06 20:25:46 -07:00
in which case this action causes an event on the core keyboard device. (The
2010-11-30 10:52:07 -05:00
input extension categorizes devices by breaking them into classes. Keyboards,
and other input devices with keys, are classified as KeyClass devices by the
input extension.)
</para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > vmods_mask0</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods_mask1</structfield>
2014-07-19 23:53:48 -07:00
fields actually represent one
2014-07-06 20:25:46 -07:00
<emphasis > vmods_mask</emphasis>
2014-07-19 23:53:48 -07:00
value, as described in <xref linkend= "Virtual_Modifiers" /> . Xkb provides the following macros, to
2010-11-30 10:52:07 -05:00
convert between the two formats:
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSARedirectVModsMask" > <primary > <function > XkbSARedirectVModsMask</function> </primary> </indexterm>
<funcsynopsis id= "XkbSARedirectVModsMask" >
<funcprototype >
<funcdef > unsigned int <function > XkbSARedirectVModsMask</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbRedirectKeyAction <parameter > act</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to extract vmods
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSARedirectVModsMask</function>
2014-07-19 23:53:48 -07:00
returns the
2014-07-10 11:08:14 -07:00
<structfield > vmods_mask0</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods_mask1</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
converted to an unsigned int.
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSARedirectSetVModsMask" > <primary > <function > XkbSARedirectSetVModsMask</function> </primary> </indexterm>
<funcsynopsis id= "XkbSARedirectSetVModsMask" >
<funcprototype >
<funcdef > void <function > XkbSARedirectSetVModsMask</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act, vm</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbRedirectKeyAction <parameter > act</parameter> </paramdef>
<paramdef > unsigned int <parameter > vm</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action in which to set vmods
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > vm</parameter>
</term>
<listitem >
<para >
new value for virtual modifier mask
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbSARedirectSetVModsMask</function>
2014-07-19 23:53:48 -07:00
sets the
2014-07-10 11:08:14 -07:00
<structfield > vmods_mask0</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods_mask1</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-19 23:53:48 -07:00
from
2014-07-08 22:22:29 -07:00
<parameter > vm</parameter> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
Similarly, the
2014-07-10 11:08:14 -07:00
<structfield > vmods0</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods1</structfield>
2014-07-19 23:53:48 -07:00
fields actually represent one
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-06 21:17:18 -07:00
value, as described in <xref linkend= "Virtual_Modifiers" /> . To convert between the two formats, Xkb
2010-11-30 10:52:07 -05:00
provides the following convenience macros:
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSARedirectVMods" > <primary > <function > XkbSARedirectVMods</function> </primary> </indexterm>
<funcsynopsis id= "XkbSARedirectVMods" >
<funcprototype >
<funcdef > unsigned int <function > XkbSARedirectVMods</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbRedirectKeyAction <parameter > act</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action from which to extract vmods
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
2014-07-18 23:56:29 -07:00
<para >
2014-07-10 11:08:14 -07:00
<function > XkbSARedirectVModsMask</function> returns the <structfield > vmods0</structfield>
and <structfield > vmods1</structfield> fields of <parameter > act</parameter>
2010-11-30 10:52:07 -05:00
converted to an unsigned int.
2014-07-18 23:56:29 -07:00
</para>
2010-11-30 10:52:07 -05:00
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbSARedirectSetVMods" > <primary > <function > XkbSARedirectSetVMods</function> </primary> </indexterm>
<funcsynopsis id= "XkbSARedirectSetVMods" >
<funcprototype >
<funcdef > void <function > XkbSARedirectSetVMods</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > act, vm</parameter>
2014-07-06 15:57:41 -07:00
) /* macro */ -->
<paramdef > XkbRedirectKeyAction <parameter > act</parameter> </paramdef>
<paramdef > unsigned int <parameter > v</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > act</parameter>
</term>
<listitem >
<para >
action in which to set vmods
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > v</parameter>
</term>
<listitem >
<para >
new value for virtual modifiers
</para>
</listitem>
</varlistentry>
</variablelist>
2014-07-18 23:56:29 -07:00
<para >
2014-07-10 11:08:14 -07:00
<function > XkbSARedirectSetVModsMask</function> sets the <structfield > vmods0</structfield>
and <structfield > vmods1</structfield> of <parameter > act</parameter> from <parameter > v</parameter> .
2014-07-18 23:56:29 -07:00
</para>
2010-11-30 10:52:07 -05:00
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Generating_DeviceButtonPress_and_DeviceButtonRelease' >
2010-11-30 10:52:07 -05:00
<title > Actions for Generating DeviceButtonPress and DeviceButtonRelease</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Generating_DeviceButtonPress_and_DeviceButtonRelease" >
<primary > <structname > XkbDeviceBtnAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
Actions associated with
2014-07-10 11:08:14 -07:00
<structname > XkbDeviceBtnAction</structname>
2014-07-19 23:53:48 -07:00
structures generate
2014-07-09 23:26:37 -07:00
<symbol > DeviceButtonPress</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-09 23:26:37 -07:00
<symbol > DeviceButtonRelease</symbol>
2014-07-19 23:53:48 -07:00
events instead of normal
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
events:
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbDeviceBtnAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_DeviceBtn</symbol> , <symbol > XkbSA_LockDeviceBtn</symbol> */
unsigned char flags; /* with <structfield > type</structfield> , specifies locking or unlocking */
unsigned char count; /* controls number of DeviceButtonPress
and Release events */
unsigned char button; /* index of button on <structfield > device</structfield> */
unsigned char device; /* device ID of an X input extension device */
2014-07-10 11:08:14 -07:00
} <structname > XkbDeviceBtnAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field can have any one of the values shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.17" > Table 16.17</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.17' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Device Button Action Types</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= '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 > Type</entry>
<entry > Effect</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_DeviceBtn</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
If the button specified by this action is logically down, the key press and
corresponding release are ignored and have no effect. If the device or button
2014-07-06 20:25:46 -07:00
specified by this action are illegal, this action behaves like
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_NoAction</symbol> .
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
Otherwise, key presses cause one or more input extension device events instead
2014-07-06 20:25:46 -07:00
of the usual key press event. If the
2014-07-10 11:08:14 -07:00
<structfield > count</structfield>
2014-07-19 23:53:48 -07:00
field is zero, a key press generates a single
2014-07-09 23:26:37 -07:00
<symbol > DeviceButtonPress</symbol>
2014-07-19 23:53:48 -07:00
event. If count is greater than zero, a key press event generates
2014-07-10 11:08:14 -07:00
<structfield > count</structfield>
2014-07-19 23:53:48 -07:00
pairs of
2014-07-09 23:26:37 -07:00
<symbol > DeviceButtonPress</symbol>
2014-07-19 23:53:48 -07:00
and
2014-07-09 23:26:37 -07:00
<symbol > DeviceButtonRelease</symbol>
2014-07-19 23:53:48 -07:00
events.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If
2014-07-10 11:08:14 -07:00
<structfield > count</structfield>
2014-07-19 23:53:48 -07:00
is zero, a key release generates an input extension
2014-07-09 23:26:37 -07:00
<symbol > DeviceButtonRelease</symbol>
2014-07-19 23:53:48 -07:00
event that matches the event generated by the corresponding key press. If
2014-07-10 11:08:14 -07:00
<structfield > count</structfield>
2014-07-19 23:53:48 -07:00
is nonzero, a key release does not cause a
2014-07-09 23:26:37 -07:00
<symbol > DeviceButtonRelease</symbol>
2014-07-19 23:53:48 -07:00
event. Key releases never cause
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
events.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
</itemizedlist>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockDeviceBtn</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<itemizedlist >
<listitem >
<para >
If the device or button specified by this action are illegal, this action
2014-07-08 23:29:49 -07:00
behaves like <symbol > XkbSA_NoAction</symbol> .
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
Otherwise, if the specified button is not locked and the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoLock</symbol>
2014-07-19 23:53:48 -07:00
bit is not set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, a key press generates an input extension
2014-07-09 23:26:37 -07:00
<symbol > DeviceButtonPress</symbol>
2014-07-19 23:53:48 -07:00
event instead of a
2014-07-06 20:40:18 -07:00
<symbol > KeyPress</symbol>
2014-07-19 23:53:48 -07:00
event and locks the button. If the button is already locked or if
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoLock</symbol>
2014-07-19 23:53:48 -07:00
bit is set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, the key press is ignored and has no effect.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If the corresponding key press was ignored, and if the
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockNoUnlock</symbol>
2014-07-19 23:53:48 -07:00
bit is not set in the
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field, a key release generates an input extension
2014-07-09 23:26:37 -07:00
<symbol > DeviceButtonRelease</symbol>
2014-07-19 23:53:48 -07:00
event instead of a
2014-07-06 20:40:18 -07:00
<symbol > KeyRelease</symbol>
2014-07-19 23:53:48 -07:00
event and unlocks the button. If the corresponding key press locked a button,
2010-11-30 10:52:07 -05:00
the key release is ignored and has no effect.
</para>
</listitem>
</itemizedlist>
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield>
2014-07-19 23:53:48 -07:00
field is composed of the bitwise inclusive OR of the masks shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.18" > Table 16.18</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.18' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Device Button Action Flags</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= '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 > Flag</entry>
<entry > Meaning</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoLock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action type is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockDeviceBtn</symbol> ,
2014-07-06 20:25:46 -07:00
the server only unlocks the button.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_LockNoUnlock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If set, and the action type is
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_LockDeviceBtn</symbol> ,
2014-07-06 20:25:46 -07:00
the server only locks the button.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Actions_for_Simulating_Events_from_Device_Valuators' >
2010-11-30 10:52:07 -05:00
<title > Actions for Simulating Events from Device Valuators</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "Actions_for_Simulating_Events_from_Device_Valuators" >
<primary > <structname > XkbDeviceValuatorAction</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
A
2014-07-18 21:09:24 -07:00
<firstterm > valuator</firstterm>
<indexterm significance= "preferred" zone= "Actions_for_Simulating_Events_from_Device_Valuators" >
<primary > valuator</primary> </indexterm>
2014-07-19 23:53:48 -07:00
manipulates a range of values for some entity, like a mouse axis, a slider or
2014-07-06 20:25:46 -07:00
a dial. Actions associated with
2014-07-10 11:08:14 -07:00
<structname > XkbDeviceValuatorAction</structname>
2014-07-19 23:53:48 -07:00
structures are used to simulate events from one or two input extension device
2010-11-30 10:52:07 -05:00
valuators.
</para>
<para > <programlisting >
typedef struct _XkbDeviceValuatorAction {
2014-07-19 00:48:02 -07:00
unsigned char type; /* <symbol > XkbSA_DeviceValuator</symbol> */
unsigned char device; /* device ID */
unsigned char v1_what; /* determines how valuator is
to behave for valuator 1 */
unsigned char v1_ndx; /* specifies a real valuator */
unsigned char v1_value; /* the value for valuator 1 */
unsigned char v2_what; /* determines how valuator is
to behave for valuator 2 */
unsigned char v2_ndx; /* specifies a real valuator */
unsigned char v2_value; /* the value for valuator 1 */
2014-07-10 11:08:14 -07:00
} <structname > XkbDeviceValuatorAction</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
If
2014-07-10 11:08:14 -07:00
<structfield > device</structfield>
2014-07-19 23:53:48 -07:00
is illegal or if neither
2014-07-10 11:08:14 -07:00
<structfield > v1_ndx</structfield>
2014-07-19 23:53:48 -07:00
nor
2014-07-10 11:08:14 -07:00
<structfield > v2_ndx</structfield>
2014-07-19 23:53:48 -07:00
specifies a legal valuator, this action behaves like
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_NoAction</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The low four bits of
2014-07-10 11:08:14 -07:00
<structfield > v1_what</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > v2_what</structfield>
2014-07-19 23:53:48 -07:00
specify the corresponding scale value (denoted
2014-07-10 13:40:40 -07:00
<structfield > val< n> Scale</structfield>
2014-07-19 23:53:48 -07:00
in <link linkend= "table16.17" > Table 16.17</link> ), if needed.
The high four bits of
2014-07-10 11:08:14 -07:00
<structfield > v1_what</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > v2_what</structfield>
2014-07-19 23:53:48 -07:00
specify the operation to perform to set the values. The high four bits of
2014-07-10 11:08:14 -07:00
<structfield > v1_what</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > v2_what</structfield>
2014-07-19 23:53:48 -07:00
can have the values shown in <link linkend= "table16.17" > Table 16.17</link> ;
the use of
2014-07-10 13:40:40 -07:00
<structfield > val< n> Scale</structfield>
2014-07-19 23:53:48 -07:00
is shown in that table also.
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.19' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Device Valuator v< n> _what High Bits Values</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= '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 > Value of high bits</entry>
<entry > Effect</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_IgnoreVal</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry > No action</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SetValMin</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-10 13:40:40 -07:00
<structfield > v< n> _value</structfield> is set to its minimum legal value.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SetValCenter</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-10 13:40:40 -07:00
<structfield > v< n> _value</structfield> is centered (to (max-min)/2).
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SetValMax</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-10 13:40:40 -07:00
<structfield > v< n> _value</structfield> is set to its maximum legal value.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SetValRelative</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-10 13:40:40 -07:00
<structfield > v< n> _value</structfield> * (2
<structfield > val< n> Scale</structfield> ) is added to
<structfield > v< n> _value</structfield> .
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbSA_SetValAbsolute</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-10 13:40:40 -07:00
<structfield > v< n> _value</structfield>
2014-07-19 23:53:48 -07:00
is set to (2 <structfield > val< n> Scale</structfield> ).
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
Illegal values for
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetValRelative</symbol>
2014-07-19 23:53:48 -07:00
or
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetValAbsolute</symbol>
2014-07-19 23:53:48 -07:00
are clamped into range. Note that all of these possibilities are legal for
2014-07-06 20:25:46 -07:00
absolute valuators. For relative valuators, only
2014-07-08 23:29:49 -07:00
<symbol > XkbSA_SetValRelative</symbol>
2014-07-19 23:53:48 -07:00
is permitted. Part of the input extension description of a device is the range
2010-11-30 10:52:07 -05:00
of legal values for all absolute valuators, whence the maximum and minimum
2014-07-07 21:30:01 -07:00
legal values shown in <link linkend= "table16.17" > Table 16.17</link> .
2010-11-30 10:52:07 -05:00
</para>
<para >
The following two masks are provided as a convenience to select either portion
2014-07-06 20:25:46 -07:00
of
2014-07-10 11:08:14 -07:00
<structfield > v1_what</structfield>
2014-07-19 23:53:48 -07:00
or
2014-07-19 00:48:02 -07:00
<structfield > v2_what</structfield> :
2010-11-30 10:52:07 -05:00
2014-07-18 23:56:29 -07:00
<programlisting >
2014-07-19 00:48:02 -07:00
#define XkbSA_ValOpMask (0x70)
#define XkbSA_ValScaleMask (0x07)
2014-07-18 23:56:29 -07:00
</programlisting>
</para>
2010-11-30 10:52:07 -05:00
<para >
2014-07-10 11:08:14 -07:00
<structfield > v1_ndx</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > v2_ndx</structfield>
2014-07-19 23:53:48 -07:00
specify valuators that actually exists. For example, most mice have two
2010-11-30 10:52:07 -05:00
valuators (x and y axes) so the only legal values for a mouse would be 0 and 1.
For a dial box with eight dials, any value in the range 0..7 would be correct.
</para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Obtaining_Key_Actions_for_Keys_from_the_Server' >
2010-11-30 10:52:07 -05:00
<title > Obtaining Key Actions for Keys from the Server</title>
<para >
2014-07-06 20:25:46 -07:00
To update the actions (the
2014-07-10 11:08:14 -07:00
<structfield > key_acts</structfield>
2014-07-19 23:53:48 -07:00
array) for a subset of the keys in a keyboard description, use
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyActions</function> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbGetKeyActions" > <primary > <function > XkbGetKeyActions</function> </primary> </indexterm>
<funcsynopsis id= "XkbGetKeyActions" >
<funcprototype >
<funcdef > Status <function > XkbGetKeyActions</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > dpy</parameter> ,
<parameter > first</parameter> ,
<parameter > num</parameter> ,
<parameter > xkb</parameter>
2014-07-06 15:57:41 -07:00
) -->
<paramdef > Display *<parameter > dpy</parameter> </paramdef>
<paramdef > unsigned int <parameter > first</parameter> </paramdef>
<paramdef > unsigned int <parameter > num</parameter> </paramdef>
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > dpy</parameter>
</term>
<listitem >
<para >
connection to X server
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > first</parameter>
</term>
<listitem >
<para >
keycode of first key of interest
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > num</parameter>
</term>
<listitem >
<para >
number of keys desired
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
pointer to keyboard description where result is stored
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyActions</function>
2014-07-19 23:53:48 -07:00
sends a request to the server to obtain the actions for
2014-07-08 22:22:29 -07:00
<parameter > num</parameter>
2014-07-19 23:53:48 -07:00
keys on the keyboard starting with key
2014-07-08 22:22:29 -07:00
<parameter > first</parameter> .
2014-07-06 20:25:46 -07:00
It waits for a reply and returns the actions in the
2014-07-19 11:55:51 -07:00
<structfield > server</structfield> -> <structfield > key_acts</structfield>
2014-07-19 23:53:48 -07:00
field of
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter> .
2014-07-06 20:25:46 -07:00
If successful,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyActions</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<symbol > Success</symbol> .
2014-07-06 20:25:46 -07:00
The
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter must be a pointer to a valid Xkb keyboard description.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-10 11:08:14 -07:00
<structfield > server</structfield>
2014-07-19 23:53:48 -07:00
map in the
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter has not been allocated,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyActions</function>
2014-07-19 23:53:48 -07:00
allocates and initializes it before obtaining the actions.
2010-11-30 10:52:07 -05:00
</para>
<para >
If the server does not have a compatible version of Xkb, or the Xkb extension
2014-07-06 20:25:46 -07:00
has not been properly initialized,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyActions</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadAccess</errorname> .
2014-07-06 20:25:46 -07:00
If
2014-07-08 22:22:29 -07:00
<parameter > num</parameter>
2014-07-19 23:53:48 -07:00
is less than 1 or greater than
2014-07-08 23:29:49 -07:00
<symbol > XkbMaxKeyCount</symbol> ,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyActions</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadValue</errorname> .
2014-07-06 20:25:46 -07:00
If any allocation errors occur,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyActions</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadAlloc</errorname> .
2010-11-30 10:52:07 -05:00
</para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Changing_the_Number_of_Actions_Bound_to_a_Key' >
2010-11-30 10:52:07 -05:00
<title > Changing the Number of Actions Bound to a Key</title>
<para >
2014-07-06 20:25:46 -07:00
To change the number of actions bound to a key, use
2014-07-09 00:03:23 -07:00
<function > XkbResizeKeyActions</function> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbResizeKeyActions" > <primary > <function > XkbResizeKeyActions</function> </primary> </indexterm>
<funcsynopsis id= "XkbResizeKeyActions" >
<funcprototype >
<funcdef > XkbAction *<function > XkbResizeKeyActions</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter> ,
<parameter > key</parameter> ,
<parameter > needed</parameter>
2014-07-06 15:57:41 -07:00
) -->
<paramdef > XkbDescRec *<parameter > xkb</parameter> </paramdef>
<paramdef > int <parameter > key</parameter> </paramdef>
<paramdef > int <parameter > needed</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
keyboard description to change
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > key</parameter>
</term>
<listitem >
<para >
keycode of key to change
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > needed</parameter>
</term>
<listitem >
<para >
new number of actions required
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter points to the keyboard description containing the
2014-07-08 22:22:29 -07:00
<parameter > key</parameter>
2014-07-19 23:53:48 -07:00
whose number of actions is to be changed. The
2014-07-08 22:22:29 -07:00
<parameter > key</parameter>
2014-07-19 23:53:48 -07:00
parameter is the keycode of the key to change, and
2014-07-08 22:22:29 -07:00
<parameter > needed</parameter>
2014-07-19 23:53:48 -07:00
specifies the new number of actions required for the key.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:34:51 -07:00
<function > XkbResizeKeyActions</function>
2014-07-19 23:53:48 -07:00
reserves the space needed for the actions and returns a pointer to the
2014-07-06 20:25:46 -07:00
beginning of the new array that holds the actions. It can change the
2014-07-10 11:08:14 -07:00
<structfield > acts</structfield> ,
<structfield > num_acts</structfield> ,
2014-07-06 20:25:46 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > size_acts</structfield>
2014-07-19 23:53:48 -07:00
fields of
2014-07-19 11:55:51 -07:00
<parameter > xkb</parameter> -> <structfield > server</structfield>
2014-07-19 23:53:48 -07:00
if it is necessary to reallocate the
2014-07-10 11:08:14 -07:00
<structfield > acts</structfield>
2010-11-30 10:52:07 -05:00
array.
</para>
<para >
2014-07-06 20:25:46 -07:00
If
2014-07-08 22:22:29 -07:00
<parameter > needed</parameter>
2014-07-19 23:53:48 -07:00
is greater than the current number of keysyms for the key,
2014-07-06 20:34:51 -07:00
<function > XkbResizeKeyActions</function>
2014-07-19 23:53:48 -07:00
initializes all new actions in the array to
2014-07-06 20:25:46 -07:00
<emphasis > NoAction</emphasis> .
2010-11-30 10:52:07 -05:00
</para>
<para >
Because the number of actions needed by a key is normally computed as width *
2014-07-06 20:25:46 -07:00
number of groups, and
2014-07-06 20:34:51 -07:00
<function > XkbResizeKeyActions</function>
2014-07-19 23:53:48 -07:00
does not modify either the width or number of groups for the key, a
2014-07-06 20:25:46 -07:00
discrepancy exists on return from
2014-07-06 20:34:51 -07:00
<function > XkbResizeKeyActions</function>
2014-07-19 23:53:48 -07:00
between the space allocated for the actions and the number required. The
2014-07-06 20:25:46 -07:00
unused entries in the list of actions returned by
2014-07-06 20:34:51 -07:00
<function > XkbResizeKeyActions</function>
2014-07-19 23:53:48 -07:00
are not preserved across future calls to any of the map editing functions, so
2010-11-30 10:52:07 -05:00
you must update the key actions (which updates the width and number of groups
2014-07-06 20:25:46 -07:00
for the key) before calling another allocator function. A call to
2014-07-06 20:34:51 -07:00
<function > XkbChangeTypesOfKey</function>
2014-07-19 23:53:48 -07:00
updates these.
2010-11-30 10:52:07 -05:00
</para>
<para >
If any allocation errors occur while resizing the number of actions bound to
2014-07-06 20:25:46 -07:00
the key,
2014-07-06 20:34:51 -07:00
<function > XkbResizeKeyActions</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-08 22:26:56 -07:00
<symbol > NULL</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<note > <para > A change to the number of actions bound to a key should be
accompanied by a change in the number of symbols bound to a key. Refer to
2014-07-06 21:29:59 -07:00
<link linkend= "Changing_the_Number_of_Symbols_Bound_to_a_Key" > section 15.3.7</link> for more information on changing the number of symbols bound to
2010-11-30 10:52:07 -05:00
a key.</para> </note>
</sect2>
</sect1>
2011-10-07 22:52:30 -06:00
<sect1 id= 'Key_Behavior' >
2010-11-30 10:52:07 -05:00
<title > Key Behavior</title>
<para >
Key behavior refers to the demeanor of a key. For example, the expected
2014-07-06 20:25:46 -07:00
behavior of the
2014-07-10 15:45:57 -07:00
<keycap > CapsLock</keycap>
2014-07-19 23:53:48 -07:00
key is that it logically locks when pressed, and then logically unlocks when
2010-11-30 10:52:07 -05:00
pressed again.
</para>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Radio_Groups_2' >
2010-11-30 10:52:07 -05:00
<title > Radio Groups</title>
<para >
2014-07-06 20:25:46 -07:00
Keys that belong to the same radio group have the
2014-07-08 23:29:49 -07:00
<symbol > XkbKB_RadioGroup</symbol>
2014-07-19 23:53:48 -07:00
type in the
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field and the radio group index specified in the
2014-07-10 11:08:14 -07:00
<structfield > data</structfield>
2014-07-19 23:53:48 -07:00
field in the
2014-07-10 11:08:14 -07:00
<structname > XkbBehavior</structname>
2014-07-19 23:53:48 -07:00
structure. If the radio group has a name in the
2014-07-08 23:34:29 -07:00
<structname > XkbNamesRec</structname>
2014-07-19 23:53:48 -07:00
structure, the radio group index is the index into the
2014-07-10 13:40:40 -07:00
<structfield > radio_group</structfield>
2014-07-19 23:53:48 -07:00
array in the
2014-07-08 23:34:29 -07:00
<structname > XkbNamesRec</structname>
2014-07-19 23:53:48 -07:00
structure. A radio group key when pressed stays logically down until another
2010-11-30 10:52:07 -05:00
key in the radio group is pressed, when the first key becomes logically up and
2014-07-06 20:25:46 -07:00
the new key becomes logically down. Setting the
2014-07-08 23:29:49 -07:00
<symbol > XkbKB_RGAllowNone</symbol>
2014-07-19 23:53:48 -07:00
bit in the behavior for all of the keys of the radio group means that pressing
2010-11-30 10:52:07 -05:00
the logically down member of the radio group causes it to logically release, in
which case none of the keys of the radio group would be logically down. If
2014-07-08 23:29:49 -07:00
<symbol > XkbKB_RGAllowNone</symbol>
2014-07-19 23:53:48 -07:00
is not set, there is no way to release the logically down member of the group.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
The low five bits of the
2014-07-10 11:08:14 -07:00
<structfield > data</structfield>
2014-07-19 23:53:48 -07:00
field of the
2014-07-10 11:08:14 -07:00
<structname > XkbBehavior</structname>
2014-07-19 23:53:48 -07:00
structure are the group number, the high three bits are flags. The only flag
2010-11-30 10:52:07 -05:00
currently defined is:
2014-07-19 00:48:02 -07:00
<programlisting >
2014-07-09 23:26:37 -07:00
#define XkbKB_RGAllowNone 0x80
2010-11-30 10:52:07 -05:00
</programlisting> </para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'The_XkbBehavior_Structure' >
2010-11-30 10:52:07 -05:00
<title > The XkbBehavior Structure</title>
2014-07-19 00:46:41 -07:00
<indexterm significance= "preferred" zone= "The_XkbBehavior_Structure" >
<primary > <structname > XkbBehavior</structname> </primary> </indexterm>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > behaviors</structfield>
2014-07-19 23:53:48 -07:00
field of the server map is an array of
2014-07-10 11:08:14 -07:00
<structname > XkbBehavior</structname>
2014-07-19 23:53:48 -07:00
structures, indexed by keycode, and contains the behavior for each key. The
2014-07-10 11:08:14 -07:00
<structname > XkbBehavior</structname>
2014-07-19 23:53:48 -07:00
structure is defined as follows:
2010-11-30 10:52:07 -05:00
2014-07-19 00:48:02 -07:00
<programlisting >
2010-11-30 10:52:07 -05:00
typedef struct _XkbBehavior {
2014-07-19 00:48:02 -07:00
unsigned char type; /* behavior type + optional
<symbol > XkbKB_Permanent</symbol> bit */
unsigned char data;
2014-07-10 11:08:14 -07:00
} <structname > XkbBehavior</structname> ;
2010-11-30 10:52:07 -05:00
</programlisting> </para>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field specifies the Xkb behavior, and the value of the
2014-07-10 11:08:14 -07:00
<structfield > data</structfield>
2014-07-19 23:53:48 -07:00
field depends on the
2014-07-10 11:08:14 -07:00
<structfield > type</structfield> .
2014-07-07 21:30:01 -07:00
Xkb supports the key behaviors shown in
<link linkend= "table16.20" > Table 16.20</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.20' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Key Behaviors</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= '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 > Type</entry>
<entry > Effect</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbKB_Default</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
Press and release events are processed normally. The
2014-07-10 11:08:14 -07:00
<structfield > data</structfield>
2014-07-19 23:53:48 -07:00
field is unused.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbKB_Lock</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
If a key is logically up (that is, the corresponding bit of the core key map is
cleared) when it is pressed, the key press is processed normally and the
corresponding release is ignored. If the key is logically down when pressed,
the key press is ignored but the corresponding release is processed normally.
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > data</structfield>
2014-07-19 23:53:48 -07:00
field is unused.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbKB_RadioGroup</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
<para >
If another member of the radio group is logically down (all members of the
2014-07-06 20:25:46 -07:00
radio group have the same index, specified in
2014-07-18 21:29:33 -07:00
<structfield > data</structfield> )
2014-07-19 23:53:48 -07:00
when a key is pressed, the server synthesizes a key release for the member
2010-11-30 10:52:07 -05:00
that is logically down and then processes the new key press event normally.
</para>
<para >
If the key itself is logically down when pressed, the key press event is
ignored, but the processing of the corresponding key release depends on the
2014-07-06 20:25:46 -07:00
value of the
2014-07-09 23:26:37 -07:00
<symbol > XkbKB_RGAllowNone</symbol>
2014-07-19 23:53:48 -07:00
bit in
2014-07-10 11:08:14 -07:00
<structfield > flags</structfield> .
2014-07-06 20:25:46 -07:00
If it is set, the key release is processed normally; otherwise, the key
2010-11-30 10:52:07 -05:00
release is also ignored.
</para>
<para >
All other key release events are ignored.
</para>
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbKB_Overlay1</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If the
<emphasis > Overlay1</emphasis>
2014-07-19 23:53:48 -07:00
control is enabled (see <link linkend= "Controls_for_Keyboard_Overlays_Overlay1_and_Overlay2_Controls" > section 10.4</link> ),
2014-07-10 11:08:14 -07:00
<structfield > data</structfield>
2014-07-19 23:53:48 -07:00
is interpreted as a keycode, and events from this key are reported as if they
2014-07-06 20:25:46 -07:00
came from
2014-07-10 13:40:40 -07:00
<structfield > data</structfield> ’ s
2014-07-19 23:53:48 -07:00
keycode. Otherwise, press and release events are processed normally.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2014-07-08 23:29:49 -07:00
<entry > <symbol > XkbKB_Overlay2</symbol> </entry>
2010-11-30 10:52:07 -05:00
<entry >
2014-07-06 20:25:46 -07:00
If the
<emphasis > Overlay2</emphasis>
2014-07-19 23:53:48 -07:00
control is enabled (see <link linkend= "Controls_for_Keyboard_Overlays_Overlay1_and_Overlay2_Controls" > section 10.4</link> ),
2014-07-10 11:08:14 -07:00
<structfield > data</structfield>
2014-07-19 23:53:48 -07:00
is interpreted as a keycode, and events from this key are reported as if they
2014-07-06 20:25:46 -07:00
came from
2014-07-10 13:40:40 -07:00
<structfield > data</structfield> ’ s
2014-07-19 23:53:48 -07:00
keycode. Otherwise, press and release events are processed normally.
2010-11-30 10:52:07 -05:00
</entry>
</row>
</tbody>
</tgroup>
</table>
<para >
2014-07-06 20:25:46 -07:00
Xkb also provides the mask,
2014-07-08 23:29:49 -07:00
<symbol > XkbKB_Permanent</symbol>
2014-07-19 23:53:48 -07:00
to specify whether the key behavior type should be simulated by Xkb or whether
2010-11-30 10:52:07 -05:00
the key behavior describes an unalterable physical, electrical, or software
2014-07-06 20:25:46 -07:00
aspect of the keyboard. If the
2014-07-08 23:29:49 -07:00
<symbol > XkbKB_Permanent</symbol>
2014-07-19 23:53:48 -07:00
bit is not set in the
2014-07-10 11:08:14 -07:00
<structfield > type</structfield>
2014-07-19 23:53:48 -07:00
field, Xkb simulates the behavior in software. Otherwise, Xkb relies upon the
2010-11-30 10:52:07 -05:00
keyboard to implement the behavior.
</para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Obtaining_Key_Behaviors_for_Keys_from_the_Server' >
2010-11-30 10:52:07 -05:00
<title > Obtaining Key Behaviors for Keys from the Server</title>
<para >
2014-07-06 20:25:46 -07:00
To obtain the behaviors (the
2014-07-10 11:08:14 -07:00
<structfield > behaviors</structfield>
2014-07-19 23:53:48 -07:00
array) for a subset of the keys in a keyboard description from the server, use
2014-07-19 09:01:26 -07:00
<function > XkbGetKeyBehaviors</function> :
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbGetKeyBehaviors" > <primary > <function > XkbGetKeyBehaviors</function> </primary> </indexterm>
<funcsynopsis id= "XkbGetKeyBehaviors" >
<funcprototype >
<funcdef > Status <function > XkbGetKeyBehaviors</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > dpy</parameter> ,
<parameter > first</parameter> ,
<parameter > num</parameter> ,
<parameter > xkb</parameter>
2014-07-06 15:57:41 -07:00
) -->
<paramdef > Display *<parameter > dpy</parameter> </paramdef>
<paramdef > unsigned int <parameter > first</parameter> </paramdef>
<paramdef > unsigned int <parameter > num</parameter> </paramdef>
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > dpy</parameter>
</term>
<listitem >
<para >
connection to server
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > first</parameter>
</term>
<listitem >
<para >
keycode of first key to get
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > num</parameter>
</term>
<listitem >
<para >
number of keys for which behaviors are desired
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
Xkb description to contain the result
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyBehaviors</function>
2014-07-19 23:53:48 -07:00
sends a request to the server to obtain the behaviors for
2014-07-08 22:22:29 -07:00
<parameter > num</parameter>
2014-07-19 23:53:48 -07:00
keys on the keyboard starting with the key whose keycode is
2014-07-08 22:22:29 -07:00
<parameter > first</parameter> .
2014-07-06 20:25:46 -07:00
It waits for a reply and returns the behaviors in the
2014-07-19 11:55:51 -07:00
<structfield > server</structfield> -> <structfield > behaviors</structfield>
2014-07-19 23:53:48 -07:00
field of
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter> .
2014-07-06 20:25:46 -07:00
If successful,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyBehaviors</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<symbol > Success</symbol> .
2014-07-06 20:25:46 -07:00
</para>
<para >
If the
2014-07-10 11:08:14 -07:00
<structfield > server</structfield>
2014-07-19 23:53:48 -07:00
map in the
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter has not been allocated,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyBehaviors</function>
2014-07-19 23:53:48 -07:00
allocates and initializes it before obtaining the actions.
2010-11-30 10:52:07 -05:00
</para>
<para >
If the server does not have a compatible version of Xkb, or the Xkb extension
2014-07-06 20:25:46 -07:00
has not been properly initialized,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyBehaviors</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadAccess</errorname> .
2014-07-06 20:25:46 -07:00
If
2014-07-08 22:22:29 -07:00
<parameter > num</parameter>
2014-07-19 23:53:48 -07:00
is less than 1 or greater than
2014-07-08 23:29:49 -07:00
<symbol > XkbMaxKeyCount</symbol> ,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyBehaviors</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadValue</errorname> .
2014-07-06 20:25:46 -07:00
If any allocation errors occur,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyBehaviors</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadAlloc</errorname> .
2010-11-30 10:52:07 -05:00
</para>
</sect2>
</sect1>
2011-10-07 22:52:30 -06:00
<sect1 id= 'Explicit_ComponentsAvoiding_Automatic_Remapping_by_the_Server' >
2010-11-30 10:52:07 -05:00
<title > Explicit Components—Avoiding Automatic Remapping by the Server</title>
<para >
Whenever a client remaps the keyboard using core protocol requests, Xkb
examines the map to determine likely default values for the components that
2014-07-06 21:29:59 -07:00
cannot be specified using the core protocol (see <link linkend= "Core_Keyboard_Mapping_to_Xkb_Keyboard_Mapping_Transformation" > section 17.1.2</link> for more
2010-11-30 10:52:07 -05:00
information on how Xkb chooses the default values).
</para>
<para >
This automatic remapping might replace definitions explicitly requested by an
application, so the Xkb keyboard description defines an explicit components
mask for each key. Any aspects of the automatic remapping listed in the
explicit components mask for a key are not changed by the automatic keyboard
mapping.
</para>
<para >
2014-07-06 20:25:46 -07:00
The explicit components masks are held in the
2014-07-10 11:08:14 -07:00
<structfield > explicit</structfield>
2014-07-19 23:53:48 -07:00
field of the server map, which is an array indexed by keycode. Each entry in
2010-11-30 10:52:07 -05:00
this array is a mask that is a bitwise inclusive OR of the values shown in
2014-07-07 21:30:01 -07:00
<link linkend= "table16.21" > Table 16.21</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 21:30:01 -07:00
<table id= 'table16.21' frame= 'topbot' >
2010-11-30 10:52:07 -05:00
<title > Explicit Component Masks</title>
2012-01-21 17:59:51 -07:00
<?dbfo keep-together="always" ?>
<tgroup cols= '3' align= 'left' colsep= '0' rowsep= '0' >
<colspec colname= 'c1' colwidth= '1.0*' />
<colspec colname= 'c2' colwidth= '1.0*' />
<colspec colname= 'c3' 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 > Bit in Explicit Mask</entry>
<entry > Value</entry>
<entry > Protects Against</entry>
</row>
</thead>
<tbody >
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry > <emphasis > ExplicitKeyType1</emphasis> </entry>
<entry > (1< < 0)</entry>
<entry >
2014-07-06 20:25:46 -07:00
Automatic determination of the key type associated with
<emphasis > Group1</emphasis> .
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry > <emphasis > ExplicitKeyType2</emphasis> </entry>
<entry > (1< < 1)</entry>
<entry >
2014-07-06 20:25:46 -07:00
Automatic determination of the key type associated with
<emphasis > Group2</emphasis> .
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry > <emphasis > ExplicitKeyType3</emphasis> </entry>
<entry > (1< < 2)</entry>
<entry >
2014-07-06 20:25:46 -07:00
Automatic determination of the key type associated with
<emphasis > Group3</emphasis> .
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry > <emphasis > ExplicitKeyType4</emphasis> </entry>
<entry > (1< < 3)</entry>
<entry >
2014-07-06 20:25:46 -07:00
Automatic determination of the key type associated with
<emphasis > Group4</emphasis> .
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry > <emphasis > ExplicitInterpret</emphasis> </entry>
<entry > (1< < 4)</entry>
<entry >
Application of any of the fields of a symbol interpretation to the
key in question.
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry > <emphasis > ExplicitAutoRepeat</emphasis> </entry>
<entry > (1< < 5)</entry>
<entry > Automatic determination of auto-repeat status for the key, as
specified in a symbol interpretation.</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry > <emphasis > ExplicitBehavior</emphasis> </entry>
<entry > (1< < 6)</entry>
<entry >
2014-07-06 20:25:46 -07:00
Automatic assignment of the
2014-07-08 23:29:49 -07:00
<symbol > XkbKB_Lock</symbol>
2014-07-19 23:53:48 -07:00
behavior to the key, if the
2014-07-08 23:29:49 -07:00
<symbol > XkbSI_LockingKey</symbol>
2014-07-19 23:53:48 -07:00
flag is set in a symbol interpretation.
2010-11-30 10:52:07 -05:00
</entry>
</row>
2012-01-21 17:59:51 -07:00
<row >
2010-11-30 10:52:07 -05:00
<entry > <emphasis > ExplicitVModMap</emphasis> </entry>
<entry > (1< < 7)</entry>
<entry >
Automatic determination of the virtual modifier map for the key
based on the actions assigned to the key and the symbol interpretations that
match the key.
</entry>
</row>
</tbody>
</tgroup>
</table>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Obtaining_Explicit_Components_for_Keys_from_the_Server' >
2010-11-30 10:52:07 -05:00
<title > Obtaining Explicit Components for Keys from the Server</title>
<para >
2014-07-06 20:25:46 -07:00
To obtain the explicit components (the
2014-07-10 11:08:14 -07:00
<structfield > explicit</structfield>
2014-07-19 23:53:48 -07:00
array) for a subset of the keys in a keyboard description, use
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyExplicitComponents</function> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbGetKeyExplicitComponents" > <primary > <function > XkbGetKeyExplicitComponents</function> </primary> </indexterm>
<funcsynopsis id= "XkbGetKeyExplicitComponents" >
<funcprototype >
<funcdef > Status <function > XkbGetKeyExplicitComponents</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > dpy</parameter> ,
<parameter > first</parameter> ,
<parameter > num</parameter> ,
<parameter > xkb</parameter>
2014-07-06 15:57:41 -07:00
) -->
<paramdef > Display *<parameter > dpy</parameter> </paramdef>
<paramdef > unsigned int <parameter > first</parameter> </paramdef>
<paramdef > unsigned int <parameter > num</parameter> </paramdef>
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > dpy</parameter>
</term>
<listitem >
<para >
connection to server
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > first</parameter>
</term>
<listitem >
<para >
keycode of first key to fetch
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > num</parameter>
</term>
<listitem >
<para >
number of keys for which to get explicit info
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
Xkb description in which to put results
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyExplicitComponents</function>
2014-07-19 23:53:48 -07:00
sends a request to the server to obtain the explicit components for
2014-07-08 22:22:29 -07:00
<parameter > num</parameter>
2014-07-19 23:53:48 -07:00
keys on the keyboard starting with key
2014-07-08 22:22:29 -07:00
<parameter > first</parameter> .
2014-07-06 20:25:46 -07:00
It waits for a reply and returns the explicit components in the
2014-07-19 11:55:51 -07:00
<structfield > server</structfield> -> <structfield > explicit</structfield>
2014-07-19 23:53:48 -07:00
array of
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter> .
2014-07-06 20:25:46 -07:00
If successful,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyExplicitComponents</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<symbol > Success</symbol> .
2014-07-06 20:25:46 -07:00
The
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter must be a pointer to a valid Xkb keyboard description.
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-10 11:08:14 -07:00
<structfield > server</structfield>
2014-07-19 23:53:48 -07:00
map in the
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter has not been allocated,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyExplicitComponents</function>
2014-07-19 23:53:48 -07:00
allocates and initializes it before obtaining the actions.
2010-11-30 10:52:07 -05:00
</para>
<para >
If the server does not have a compatible version of Xkb, or the Xkb extension
2014-07-06 20:25:46 -07:00
has not been properly initialized,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyExplicitComponents</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadMatch</errorname> .
2014-07-06 20:25:46 -07:00
If
2014-07-08 22:22:29 -07:00
<parameter > num</parameter>
2014-07-19 23:53:48 -07:00
is less than 1 or greater than
2014-07-08 23:29:49 -07:00
<symbol > XkbMaxKeyCount</symbol> ,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyExplicitComponents</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadValue</errorname> .
2014-07-06 20:25:46 -07:00
If any allocation errors occur,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyExplicitComponents</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadAlloc</errorname> .
2010-11-30 10:52:07 -05:00
</para>
</sect2>
</sect1>
2011-10-07 22:52:30 -06:00
<sect1 id= 'Virtual_Modifier_Mapping' >
2010-11-30 10:52:07 -05:00
<title > Virtual Modifier Mapping</title>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
member of the server map is a fixed-length array containing
2014-07-08 23:29:49 -07:00
<symbol > XkbNumVirtualMods</symbol>
2014-07-19 23:53:48 -07:00
entries. Each entry corresponds to a virtual modifier and provides the binding
2014-07-06 20:25:46 -07:00
of the virtual modifier to the real modifier bits. Each entry in the
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
array is a bitwise inclusive OR of the legal modifier masks:
2010-11-30 10:52:07 -05:00
</para>
2014-07-18 23:56:29 -07:00
<simplelist type= 'vert' columns= '1' >
<member > <symbol > ShiftMask</symbol> </member>
<member > <symbol > LockMask</symbol> </member>
<member > <symbol > ControlMask</symbol> </member>
<member > <symbol > Mod1Mask</symbol> </member>
<member > <symbol > Mod2Mask</symbol> </member>
<member > <symbol > Mod3Mask</symbol> </member>
<member > <symbol > Mod4Mask</symbol> </member>
<member > <symbol > Mod5Mask</symbol> </member>
</simplelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > vmodmap</structfield>
2014-07-19 23:53:48 -07:00
member of the server map is similar to the
2014-07-10 11:08:14 -07:00
<structfield > modmap</structfield>
2014-07-19 23:53:48 -07:00
array of the client map (see <link linkend= "The_Per_Key_Modifier_Map" > section 15.4</link> ), but is used to define the virtual
2014-07-06 20:25:46 -07:00
modifier mapping for each key. Like the
2014-07-10 11:08:14 -07:00
<structfield > modmap</structfield>
2014-07-19 23:53:48 -07:00
member, it is indexed by keycode, and each entry is a mask representing the
2010-11-30 10:52:07 -05:00
virtual modifiers bound to the corresponding key:
</para>
<itemizedlist >
<listitem >
<para >
2014-07-06 20:25:46 -07:00
Each of the bits in a
2014-07-10 11:08:14 -07:00
<structfield > vmodmap</structfield>
2014-07-19 23:53:48 -07:00
entry represents an index into the
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
member. That is, bit 0 of a
2014-07-10 11:08:14 -07:00
<structfield > vmodmap</structfield>
2014-07-19 23:53:48 -07:00
entry refers to index 0 of the
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
array, bit 1 refers to index 1, and so on.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
<listitem >
<para >
2014-07-06 20:25:46 -07:00
If a bit is set in the
2014-07-10 11:08:14 -07:00
<structfield > vmodmap</structfield>
2014-07-19 23:53:48 -07:00
entry for a key, that key is bound to the corresponding virtual modifier in
2014-07-06 20:25:46 -07:00
the
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
array.
2010-11-30 10:52:07 -05:00
</para>
</listitem>
</itemizedlist>
<para >
2014-07-06 20:25:46 -07:00
The
2014-07-10 11:08:14 -07:00
<structfield > vmodmap</structfield>
2014-07-19 23:53:48 -07:00
and
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
members of the server map are the <quote > master</quote> virtual modifier definitions. Xkb
2010-11-30 10:52:07 -05:00
automatically propagates any changes to these fields to all other fields that
use virtual modifier mappings.
</para>
<para >
The overall relationship of fields dealing with virtual modifiers in an Xkb
2014-07-07 22:22:28 -07:00
keyboard description are shown in <link linkend= "figure16.2" > Figure 16.2</link> .
2010-11-30 10:52:07 -05:00
</para>
2014-07-07 22:22:28 -07:00
<figure id= 'figure16.2' >
<title > Virtual Modifier Relationships</title>
<mediaobject >
<imageobject > <imagedata format= "SVG" fileref= "XKBlib-17.svg" />
</imageobject>
</mediaobject>
</figure>
2010-11-30 10:52:07 -05:00
<!--
<H5 CLASS= "Figure" >
Virtual Modifier Relationships</H5>
-->
2011-10-07 22:52:30 -06:00
<sect2 id= 'Obtaining_Virtual_Modifier_Bindings_from_the_Server' >
2010-11-30 10:52:07 -05:00
<title > Obtaining Virtual Modifier Bindings from the Server</title>
<para >
2014-07-06 20:25:46 -07:00
To obtain a subset of the virtual modifier bindings (the
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
array) in a keyboard description, use
2014-07-19 09:01:26 -07:00
<function > XkbGetVirtualMods</function> :
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbGetVirtualMods" > <primary > <function > XkbGetVirtualMods</function> </primary> </indexterm>
<funcsynopsis id= "XkbGetVirtualMods" >
<funcprototype >
<funcdef > Status <function > XkbGetVirtualMods</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > dpy</parameter> ,
<parameter > which</parameter> ,
<parameter > xkb</parameter>
2014-07-06 15:57:41 -07:00
) -->
<paramdef > Display *<parameter > dpy</parameter> </paramdef>
<paramdef > unsigned int <parameter > which</parameter> </paramdef>
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > dpy</parameter>
</term>
<listitem >
<para >
connection to server
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > which</parameter>
</term>
<listitem >
<para >
mask indicating virtual modifier bindings to get
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
Xkb description where results will be placed
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-06 20:34:51 -07:00
<function > XkbGetVirtualMods</function>
2014-07-19 23:53:48 -07:00
sends a request to the server to obtain the
2014-07-10 11:08:14 -07:00
<structfield > vmods</structfield>
2014-07-19 23:53:48 -07:00
entries for the virtual modifiers specified in the mask,
2014-07-08 22:22:29 -07:00
<parameter > which</parameter> ,
2014-07-06 21:29:59 -07:00
and waits for a reply. See <link linkend= "Virtual_Modifier_Names_and_Masks" > section 7.1</link> for a description of how to determine
2014-07-06 20:25:46 -07:00
the virtual modifier mask. For each bit set in
2014-07-08 22:22:29 -07:00
<parameter > which</parameter> ,
2014-07-06 20:34:51 -07:00
<function > XkbGetVirtualMods</function>
2014-07-19 23:53:48 -07:00
updates the corresponding virtual modifier definition in the
2014-07-10 13:40:40 -07:00
<structfield > server-> vmods</structfield>
2014-07-19 23:53:48 -07:00
array of
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter> .
2014-07-06 20:25:46 -07:00
The
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter must be a pointer to a valid Xkb keyboard description. If
2014-07-06 20:25:46 -07:00
successful,
2014-07-06 20:34:51 -07:00
<function > XkbGetVirtualMods</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<symbol > Success</symbol> .
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-10 11:08:14 -07:00
<structfield > server</structfield>
2014-07-19 23:53:48 -07:00
map has not been allocated in the
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter,
2014-07-06 20:34:51 -07:00
<function > XkbGetVirtualMods</function>
2014-07-19 23:53:48 -07:00
allocates and initializes it before obtaining the virtual modifier bindings.
2010-11-30 10:52:07 -05:00
</para>
<para >
If the server does not have a compatible version of Xkb, or the Xkb extension
2014-07-06 20:25:46 -07:00
has not been properly initialized,
2014-07-06 20:34:51 -07:00
<function > XkbGetVirtualMods</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadMatch</errorname> .
2014-07-06 20:25:46 -07:00
Any errors in allocation cause
2014-07-06 20:34:51 -07:00
<function > XkbGetVirtualMods</function>
2014-07-06 20:25:46 -07:00
to return
2014-07-06 20:40:18 -07:00
<errorname > BadAlloc</errorname> .
2010-11-30 10:52:07 -05:00
</para>
</sect2>
2011-10-07 22:52:30 -06:00
<sect2 id= 'Obtaining_Per_Key_Virtual_Modifier_Mappings_from_the_Server' >
2010-11-30 10:52:07 -05:00
<title > Obtaining Per-Key Virtual Modifier Mappings from the Server</title>
<para >
2014-07-06 20:25:46 -07:00
To obtain the virtual modifier map (the
2014-07-10 11:08:14 -07:00
<structfield > vmodmap</structfield>
2014-07-19 23:53:48 -07:00
array) for a subset of the keys in a keyboard description, use
2014-07-19 09:01:26 -07:00
<function > XkbGetKeyVirtualModMap</function> :
2010-11-30 10:52:07 -05:00
</para>
2014-07-06 15:57:41 -07:00
<indexterm significance= "preferred" zone= "XkbGetKeyVirtualModMap" > <primary > <function > XkbGetKeyVirtualModMap</function> </primary> </indexterm>
<funcsynopsis id= "XkbGetKeyVirtualModMap" >
<funcprototype >
<funcdef > Status <function > XkbGetKeyVirtualModMap</function> </funcdef>
2014-07-06 20:25:46 -07:00
<!-- (
2014-07-08 22:22:29 -07:00
<parameter > dpy</parameter> ,
<parameter > first</parameter> ,
<parameter > num</parameter> ,
<parameter > xkb</parameter>
2014-07-06 15:57:41 -07:00
) -->
<paramdef > Display *<parameter > dpy</parameter> </paramdef>
<paramdef > unsigned int <parameter > first</parameter> </paramdef>
<paramdef > unsigned int <parameter > num</parameter> </paramdef>
<paramdef > XkbDescPtr <parameter > xkb</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
<variablelist >
<varlistentry >
<term >
<parameter > dpy</parameter>
</term>
<listitem >
<para >
connection to server
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > first</parameter>
</term>
<listitem >
<para >
keycode of first key to fetch
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > num</parameter>
</term>
<listitem >
<para >
# keys for which virtual mod maps are desired
</para>
</listitem>
</varlistentry>
<varlistentry >
<term >
<parameter > xkb</parameter>
</term>
<listitem >
<para >
Xkb description where results will be placed
</para>
</listitem>
</varlistentry>
</variablelist>
2010-11-30 10:52:07 -05:00
<para >
2014-07-09 00:03:23 -07:00
<function > XkbGetKeyVirtualModmap</function>
2010-11-30 10:52:07 -05:00
sends a request to the server to obtain the virtual modifier mappings for
2014-07-08 22:22:29 -07:00
<parameter > num</parameter>
2014-07-19 23:53:48 -07:00
keys on the keyboard starting with key
2014-07-08 22:22:29 -07:00
<parameter > first</parameter> .
2014-07-06 20:25:46 -07:00
It waits for a reply and returns the virtual modifier mappings in the
2014-07-19 11:55:51 -07:00
<structfield > server</structfield> -> <structfield > vmodmap</structfield>
2014-07-19 23:53:48 -07:00
array of
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter> .
2014-07-06 20:25:46 -07:00
If successful,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyVirtualModMap</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<symbol > Success</symbol> .
2014-07-06 20:25:46 -07:00
The
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter must be a pointer to a valid Xkb keyboard description
2010-11-30 10:52:07 -05:00
</para>
<para >
2014-07-06 20:25:46 -07:00
If the
2014-07-10 11:08:14 -07:00
<structfield > server</structfield>
2014-07-19 23:53:48 -07:00
map in the
2014-07-08 22:22:29 -07:00
<parameter > xkb</parameter>
2014-07-19 23:53:48 -07:00
parameter has not been allocated,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyVirtualModMap</function>
2014-07-19 23:53:48 -07:00
allocates and initializes it before obtaining the virtual modifier mappings.
2010-11-30 10:52:07 -05:00
</para>
<para >
If the server does not have a compatible version of Xkb, or the Xkb extension
2014-07-06 20:25:46 -07:00
has not been properly initialized,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyVirtualModMap</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadMatch</errorname> .
2014-07-06 20:25:46 -07:00
If
2014-07-08 22:22:29 -07:00
<parameter > num</parameter>
2014-07-19 23:53:48 -07:00
is less than 1 or greater than
2014-07-08 23:29:49 -07:00
<symbol > XkbMaxKeyCount</symbol> ,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyVirtualModMap</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadValue</errorname> .
2014-07-06 20:25:46 -07:00
If any allocation errors occur,
2014-07-06 20:34:51 -07:00
<function > XkbGetKeyVirtualModMap</function>
2014-07-19 23:53:48 -07:00
returns
2014-07-06 20:40:18 -07:00
<errorname > BadAlloc</errorname> .
2010-11-30 10:52:07 -05:00
</para>
</sect2>
</sect1>
</chapter>