ch08.xml revision 3233502e
10f8248bfSmrg<?xml version="1.0" encoding="UTF-8" ?>
20f8248bfSmrg<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
30f8248bfSmrg	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
4eb411b4bSmrg<chapter id='Indicators'>
5e9fcaa8aSmrg<title>Indicators</title>
6e9fcaa8aSmrg
70f8248bfSmrg<indexterm significance="preferred" zone="Indicators">
80f8248bfSmrg<primary>indicators</primary></indexterm>
90f8248bfSmrg
10e9fcaa8aSmrg<para>
11e9fcaa8aSmrgAlthough the core X implementation supports up to 32 LEDs on an input device,
12e9fcaa8aSmrgit does not provide any linkage between the state of the LEDs and the logical
130f8248bfSmrgstate of the input device. For example, most keyboards have a
140f8248bfSmrg<guilabel>CapsLock</guilabel>
150f8248bfSmrgLED, but X does not provide a mechanism to make the LED automatically follow
160f8248bfSmrgthe logical state of the
170f8248bfSmrg<keycap>CapsLock</keycap>
180f8248bfSmrgkey.
19e9fcaa8aSmrg</para>
20e9fcaa8aSmrg
21e9fcaa8aSmrg
22e9fcaa8aSmrg<para>
23e9fcaa8aSmrgFurthermore, the core X implementation does not provide clients with the
240f8248bfSmrgability to determine what bits in the
250f8248bfSmrg<structfield>led_mask</structfield>
260f8248bfSmrgfield of the
270f8248bfSmrg<structname>XKeyboardState</structname>
280f8248bfSmrgmap to the particular LEDs on the keyboard. For example, X does not provide a
290f8248bfSmrgmethod for a client to determine what bit to set in the
300f8248bfSmrg<structfield>led_mask</structfield>
310f8248bfSmrgfield to turn on the
320f8248bfSmrg<guilabel>Scroll Lock</guilabel>
330f8248bfSmrgLED or whether the keyboard even has a
340f8248bfSmrg<guilabel>Scroll Lock</guilabel>
350f8248bfSmrgLED.
36e9fcaa8aSmrg</para>
37e9fcaa8aSmrg
38e9fcaa8aSmrg
39e9fcaa8aSmrg<para>
40e9fcaa8aSmrgXkb provides indicator names and programmable indicators to help solve these
41e9fcaa8aSmrgproblems. Using Xkb, clients can determine the names of the various indicators,
42e9fcaa8aSmrgdetermine and control the way that the individual indicators should be updated
43e9fcaa8aSmrgto reflect keyboard changes, and determine which of the 32 keyboard indicators
44e9fcaa8aSmrgreported by the protocol are actually present on the keyboard. Clients may also
45e9fcaa8aSmrgrequest immediate notification of changes to the state of any subset of the
46e9fcaa8aSmrgkeyboard indicators, which makes it straightforward to provide an on-screen
470f8248bfSmrg<quote>virtual</quote> LED panel.
480f8248bfSmrgThis chapter describes Xkb indicators and the functions
49e9fcaa8aSmrgused for manipulating them.
50e9fcaa8aSmrg</para>
51e9fcaa8aSmrg
52eb411b4bSmrg<sect1 id='Indicator_Names'>
53e9fcaa8aSmrg<title>Indicator Names</title>
54e9fcaa8aSmrg
55e9fcaa8aSmrg<para>
56e9fcaa8aSmrgXkb provides the capability of symbolically naming indicators. Xkb itself
57e9fcaa8aSmrgdoesn’t use these symbolic names for anything; they are there only to help
58e9fcaa8aSmrgmake the keyboard description comprehensible to humans. To set the names of
590f8248bfSmrgspecific indicators, use
600f8248bfSmrg<function>XkbSetNames</function>
610f8248bfSmrgas discussed in <xref linkend="Symbolic_Names" />. Then set the map using
620f8248bfSmrg<function>XkbSetMap</function>
630f8248bfSmrg(see <link linkend="Changing_Map_Components_in_the_Server">section 14.3</link>)
640f8248bfSmrgor
653233502eSmrg<function>XkbSetNamedDeviceIndicator</function>
660f8248bfSmrg(below). To retrieve indicator names, use
670f8248bfSmrg<function>XkbGetNames</function>
680f8248bfSmrg(<xref linkend="Symbolic_Names" />).
69e9fcaa8aSmrg</para>
70e9fcaa8aSmrg
71e9fcaa8aSmrg
72e9fcaa8aSmrg</sect1>
73eb411b4bSmrg<sect1 id='Indicator_Data_Structures'>
74e9fcaa8aSmrg<title>Indicator Data Structures</title>
75e9fcaa8aSmrg
76e9fcaa8aSmrg<para>
770f8248bfSmrgUse the indicator description record,
780f8248bfSmrg<structname>XkbIndicatorRec</structname>,
790f8248bfSmrgand its indicator map,
800f8248bfSmrg<structname>XkbIndicatorMapRec</structname>,
810f8248bfSmrgto inquire about and control most indicator properties and behaviors.
82e9fcaa8aSmrg</para>
83e9fcaa8aSmrg
84e9fcaa8aSmrg
85eb411b4bSmrg<sect2 id='XkbIndicatorRec'>
86e9fcaa8aSmrg<title>XkbIndicatorRec</title>
87e9fcaa8aSmrg
880f8248bfSmrg<indexterm significance="preferred" zone="XkbIndicatorRec">
890f8248bfSmrg<primary><structname>XkbIndicatorRec</structname></primary></indexterm>
900f8248bfSmrg
91e9fcaa8aSmrg<para>
920f8248bfSmrgThe description for all the Xkb indicators is held in the
930f8248bfSmrg<structfield>indicators</structfield>
940f8248bfSmrgfield of the complete keyboard description (see <xref linkend="Complete_Keyboard_Description" />), which is defined
95e9fcaa8aSmrgas follows:
96e9fcaa8aSmrg
970f8248bfSmrg<programlisting>
98e9fcaa8aSmrg#define      XkbNumIndicators      32
990f8248bfSmrg
100e9fcaa8aSmrgtypedef struct {
1010f8248bfSmrg    unsigned long           phys_indicators;            /* LEDs existence */
1020f8248bfSmrg    XkbIndicatorMapRec      maps[XkbNumIndicators];     /* indicator maps */
1030f8248bfSmrg} <structname>XkbIndicatorRec</structname>, *XkbIndicatorPtr;
104e9fcaa8aSmrg</programlisting></para>
105e9fcaa8aSmrg
106e9fcaa8aSmrg<para>
1070f8248bfSmrgThis structure contains the
1080f8248bfSmrg<structfield>phys_indicators</structfield>
1090f8248bfSmrgfield, which relates some information about the correspondence between
110e9fcaa8aSmrgindicators and physical LEDs on the keyboard, and an array of indicator
1110f8248bfSmrg<structfield>maps</structfield>,
1120f8248bfSmrgone map per indicator.
113e9fcaa8aSmrg</para>
114e9fcaa8aSmrg
115e9fcaa8aSmrg<para>
1160f8248bfSmrgThe
1170f8248bfSmrg<structfield>phys_indicators</structfield>
1180f8248bfSmrgfield indicates which indicators are bound to physical LEDs on the keyboard;
1190f8248bfSmrgif a bit is set in
1200f8248bfSmrg<structfield>phys_indicators</structfield>,
1210f8248bfSmrgthen the associated indicator has a physical LED associated with it. This
122e9fcaa8aSmrgfield is necessary because some indicators may not have corresponding physical
123e9fcaa8aSmrgLEDs on the keyboard. For example, most keyboards have an LED for indicating
1240f8248bfSmrgthe state of
1250f8248bfSmrg<keycap>CapsLock</keycap>,
1260f8248bfSmrgbut most keyboards do not have an LED that indicates the current group.
1270f8248bfSmrgBecause
1280f8248bfSmrg<structfield>phys_indicators</structfield>
1290f8248bfSmrgdescribes a physical characteristic of the keyboard, you cannot directly
130e9fcaa8aSmrgchange it under program control. However, if a client program loads a
1310f8248bfSmrgcompletely new keyboard description via
1320f8248bfSmrg<function>XkbGetKeyboardByName</function>,
1330f8248bfSmrgor if a new keyboard is attached and the X implementation notices,
1340f8248bfSmrg<structfield>phys_indicators</structfield>
1350f8248bfSmrgchanges if the indicators for the new keyboard are different.
136e9fcaa8aSmrg</para>
137e9fcaa8aSmrg
138e9fcaa8aSmrg
139e9fcaa8aSmrg</sect2>
140eb411b4bSmrg<sect2 id='XkbIndicatorMapRec'>
141e9fcaa8aSmrg<title>XkbIndicatorMapRec</title>
142e9fcaa8aSmrg
1430f8248bfSmrg<indexterm significance="preferred" zone="XkbIndicatorMapRec">
1440f8248bfSmrg<primary><structname>XkbIndicatorMapRec</structname></primary></indexterm>
1450f8248bfSmrg
146e9fcaa8aSmrg<para>
147e9fcaa8aSmrgEach indicator has its own set of attributes that specify whether clients can
148e9fcaa8aSmrgexplicitly set its state and whether it tracks the keyboard state. The
1490f8248bfSmrgattributes of each indicator are held in the
1500f8248bfSmrg<structfield>maps</structfield>
1510f8248bfSmrgarray, which is an array of
1520f8248bfSmrg<structname>XkbIndicatorRec</structname>
1530f8248bfSmrgstructures:
154e9fcaa8aSmrg
1550f8248bfSmrg<programlisting>
156e9fcaa8aSmrgtypedef struct {
1570f8248bfSmrg    unsigned char  flags;         /* how the indicator can be changed */
1580f8248bfSmrg    unsigned char  which_groups;  /* match criteria for groups */
1590f8248bfSmrg    unsigned char  groups;        /* which keyboard groups the indicator watches */
1600f8248bfSmrg    unsigned char  which_mods;    /* match criteria for modifiers */
1610f8248bfSmrg    XkbModsRec     mods;          /* which modifiers the indicator watches */
1620f8248bfSmrg    unsigned int   ctrls;         /* which controls the indicator watches */
1630f8248bfSmrg} <structname>XkbIndicatorMapRec</structname>, *XkbIndicatorMapPtr;
164e9fcaa8aSmrg</programlisting></para>
165e9fcaa8aSmrg
166e9fcaa8aSmrg<para>
167e9fcaa8aSmrgThis indicator map specifies for each indicator:
168e9fcaa8aSmrg</para>
169e9fcaa8aSmrg
170e9fcaa8aSmrg<itemizedlist>
171e9fcaa8aSmrg<listitem>
172e9fcaa8aSmrg  <para>
173e9fcaa8aSmrgThe conditions under which the keyboard modifier state affects the indicator
174e9fcaa8aSmrg  </para>
175e9fcaa8aSmrg</listitem>
176e9fcaa8aSmrg<listitem>
177e9fcaa8aSmrg  <para>
178e9fcaa8aSmrgThe conditions under which the keyboard group state affects the indicator
179e9fcaa8aSmrg  </para>
180e9fcaa8aSmrg</listitem>
181e9fcaa8aSmrg<listitem>
182e9fcaa8aSmrg  <para>
183e9fcaa8aSmrgThe conditions under which the state of the boolean controls affects the
184e9fcaa8aSmrgindicator
185e9fcaa8aSmrg  </para>
186e9fcaa8aSmrg</listitem>
187e9fcaa8aSmrg<listitem>
188e9fcaa8aSmrg  <para>
189e9fcaa8aSmrgThe effect (if any) of attempts to explicitly change the state of the indicator
1900f8248bfSmrgusing the functions
1910f8248bfSmrg<function>XkbSetControls</function>
1920f8248bfSmrgor
1930f8248bfSmrg<function>XChangeKeyboardControl</function>
194e9fcaa8aSmrg
195e9fcaa8aSmrg  </para>
196e9fcaa8aSmrg</listitem>
197e9fcaa8aSmrg</itemizedlist>
198e9fcaa8aSmrg
199e9fcaa8aSmrg<para>
200e9fcaa8aSmrgFor more information on the effects of explicit changes to indicators and the
2010f8248bfSmrgrelationship to the indicator map, see <link linkend="Effects_of_Explicit_Changes_on_Indicators">section 8.4.1</link>.
202e9fcaa8aSmrg</para>
203e9fcaa8aSmrg
204eb411b4bSmrg<sect3 id='XkbIndicatorMapRec_flags_field'>
205e9fcaa8aSmrg<title>XkbIndicatorMapRec flags field</title>
206e9fcaa8aSmrg
207e9fcaa8aSmrg<para>
2080f8248bfSmrgThe
2090f8248bfSmrg<structfield>flags</structfield>
2100f8248bfSmrgfield specifies the conditions under which the indicator can be changed and
2110f8248bfSmrgthe effects of changing the indicator. The valid values for
2120f8248bfSmrg<structfield>flags</structfield>
2130f8248bfSmrgand their effects are shown in <link linkend="table8.1">Table 8.1</link>.
214e9fcaa8aSmrg</para>
215e9fcaa8aSmrg
2160f8248bfSmrg<table id='table8.1' frame='topbot'>
217e9fcaa8aSmrg<title>XkbIndicatorMapRec flags Field</title>
218eb411b4bSmrg<?dbfo keep-together="always" ?>
219eb411b4bSmrg<tgroup cols='3' align='left' colsep='0' rowsep='0'>
220eb411b4bSmrg<colspec colname='c1' colwidth='2.0*'/>
221eb411b4bSmrg<colspec colname='c2' colwidth='1.0*'/>
222eb411b4bSmrg<colspec colname='c3' colwidth='3.0*'/>
223e9fcaa8aSmrg<thead>
224eb411b4bSmrg<row rowsep='1'>
225e9fcaa8aSmrg  <entry>Value</entry>
226e9fcaa8aSmrg  <entry></entry>
227e9fcaa8aSmrg  <entry>Effect</entry>
228e9fcaa8aSmrg  </row>
229e9fcaa8aSmrg</thead>
230e9fcaa8aSmrg<tbody>
231eb411b4bSmrg  <row>
2320f8248bfSmrg    <entry><symbol>XkbIM_NoExplicit</symbol></entry>
233e9fcaa8aSmrg    <entry>(1L&lt;&lt;7)</entry>
234e9fcaa8aSmrg    <entry>Client applications cannot change the state of the indicator.</entry>
235e9fcaa8aSmrg  </row>
236eb411b4bSmrg  <row>
2370f8248bfSmrg    <entry><symbol>XkbIM_NoAutomatic</symbol></entry>
238e9fcaa8aSmrg    <entry>(1L&lt;&lt;6)</entry>
239e9fcaa8aSmrg    <entry>Xkb does not automatically change the value of the indicator based
240e9fcaa8aSmrgupon a change in the keyboard state, regardless of the values for the other
241e9fcaa8aSmrgfields of the indicator map.</entry>
242e9fcaa8aSmrg  </row>
243eb411b4bSmrg  <row>
2440f8248bfSmrg    <entry><symbol>XkbIM_LEDDrivesKB</symbol></entry>
245e9fcaa8aSmrg    <entry>(1L&lt;&lt;5)</entry>
246e9fcaa8aSmrg    <entry>A client application changing the state of the indicator causes the
247e9fcaa8aSmrgstate of the keyboard to change.</entry>
248e9fcaa8aSmrg  </row>
249e9fcaa8aSmrg</tbody>
250e9fcaa8aSmrg</tgroup>
251e9fcaa8aSmrg</table>
252e9fcaa8aSmrg
253e9fcaa8aSmrg<para>
2540f8248bfSmrgNote that if
2550f8248bfSmrg<symbol>XkbIM_NoAutomatic</symbol>
2560f8248bfSmrgis not set, by default the indicator follows the keyboard state.
257e9fcaa8aSmrg</para>
258e9fcaa8aSmrg
259e9fcaa8aSmrg
260e9fcaa8aSmrg<para>
2610f8248bfSmrgIf
2620f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
2630f8248bfSmrgis set and
2640f8248bfSmrg<symbol>XkbIM_NoExplicit</symbol>
2650f8248bfSmrgis not, and if you call a function which updates the server’s image of the
2660f8248bfSmrgindicator map (such as
2670f8248bfSmrg<function>XkbSetIndicatorMap</function>
2680f8248bfSmrgor
2693233502eSmrg<function>XkbSetNamedDeviceIndicator</function>),
2700f8248bfSmrgXkb changes the keyboard state and controls to reflect the other fields of
271e9fcaa8aSmrgthe indicator map, as described in the remainder of this section. If you
2720f8248bfSmrgattempt to explicitly change the value of an indicator for which
2730f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
2740f8248bfSmrgis absent or for which
2750f8248bfSmrg<symbol>XkbIM_NoExplicit</symbol>
2760f8248bfSmrgis present, keyboard state or controls are unaffected.
2770f8248bfSmrg</para>
2780f8248bfSmrg
2790f8248bfSmrg
2800f8248bfSmrg<para>
2810f8248bfSmrgFor example, a keyboard designer may want to make the
2820f8248bfSmrg<guilabel>CapsLock</guilabel>
2830f8248bfSmrgLED controllable only by the server, but allow the
2840f8248bfSmrg<guilabel>Scroll Lock</guilabel>
2850f8248bfSmrgLED to be controlled by client applications. To do so, the keyboard designer
2860f8248bfSmrgcould set the
2870f8248bfSmrg<symbol>XkbIM_NoExplicit</symbol>
2880f8248bfSmrgflag for the
2890f8248bfSmrg<guilabel>CapsLock</guilabel>
2900f8248bfSmrgLED, but not set it for the
2910f8248bfSmrg<guilabel>Scroll Lock</guilabel>
2920f8248bfSmrgLED. Or the keyboard designer may wish to allow the
2930f8248bfSmrg<guilabel>CapsLock</guilabel>
2940f8248bfSmrgLED to be controlled by both the server and client applications and also have
2950f8248bfSmrgthe server to automatically change the
2960f8248bfSmrg<emphasis>CapsLock</emphasis>
2970f8248bfSmrg
2980f8248bfSmrgmodifier state whenever a client application changes the
2990f8248bfSmrg<guilabel>CapsLock</guilabel>
3000f8248bfSmrgLED. To do so, the keyboard designer would not set the
3010f8248bfSmrg<symbol>XkbIM_NoExplicit</symbol>
3020f8248bfSmrgflag, but would instead set the
3030f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
3040f8248bfSmrgflag.
305e9fcaa8aSmrg</para>
306e9fcaa8aSmrg
307e9fcaa8aSmrg<para>
308e9fcaa8aSmrgThe remaining fields in the indicator map specify the conditions under which
3090f8248bfSmrgXkb automatically turns an indicator on or off (only if
3100f8248bfSmrg<symbol>XkbIM_NoAutomatic</symbol>
3110f8248bfSmrgis not set). If these conditions match the keyboard state, Xkb turns the
312e9fcaa8aSmrgindicator on. If the conditions do not match, Xkb turns the indicator off.
313e9fcaa8aSmrg</para>
314e9fcaa8aSmrg
315e9fcaa8aSmrg</sect3>
316e9fcaa8aSmrg
317eb411b4bSmrg<sect3 id='XkbIndicatorMapRec_which_groups_and_groups_fields'>
318e9fcaa8aSmrg<title>XkbIndicatorMapRec which_groups and groups fields</title>
319e9fcaa8aSmrg
320e9fcaa8aSmrg<para>
3210f8248bfSmrgThe
3220f8248bfSmrg<structfield>which_groups</structfield>
3230f8248bfSmrgand the
3240f8248bfSmrg<structfield>groups</structfield>
3250f8248bfSmrgfields of an indicator map determine how the keyboard group state affects the
3260f8248bfSmrgcorresponding indicator. The
3270f8248bfSmrg<structfield>which_groups</structfield>
3280f8248bfSmrgfield controls the interpretation of
3290f8248bfSmrg<structfield>groups</structfield>
3300f8248bfSmrgand may contain any one of the following values:
331e9fcaa8aSmrg
3320f8248bfSmrg<programlisting>
333e9fcaa8aSmrg#define XkbIM_UseNone             0
334e9fcaa8aSmrg#define XkbIM_UseBase             (1L &lt;&lt; 0)
335e9fcaa8aSmrg#define XkbIM_UseLatched          (1L &lt;&lt; 1)
336e9fcaa8aSmrg#define XkbIM_UseLocked           (1L &lt;&lt; 2)
337e9fcaa8aSmrg#define XkbIM_UseEffective        (1L &lt;&lt; 3)
338e9fcaa8aSmrg#define XkbIM_UseAnyGroup         XkbIM_UseLatched | XkbIM_UseLocked |
339e9fcaa8aSmrg                                  XkbIM_UseEffective
340e9fcaa8aSmrg</programlisting></para>
341e9fcaa8aSmrg
342e9fcaa8aSmrg<para>
3430f8248bfSmrgThe
3440f8248bfSmrg<structfield>groups</structfield>
345e9fcaa8aSmrgfield specifies what keyboard groups an indicator watches and is the bitwise
346e9fcaa8aSmrginclusive OR of the following valid values:
347e9fcaa8aSmrg
3480f8248bfSmrg<programlisting>
349e9fcaa8aSmrg#define XkbGroup1Mask            (1&lt;&lt;0)
350e9fcaa8aSmrg#define XkbGroup2Mask            (1&lt;&lt;1)
351e9fcaa8aSmrg#define XkbGroup3Mask            (1&lt;&lt;2)
352e9fcaa8aSmrg#define XkbGroup4Mask            (1&lt;&lt;3)
353e9fcaa8aSmrg#define XkbAnyGroupMask          (1&lt;&lt;7)
354e9fcaa8aSmrg#define XkbAllGroupsMask         (0xf)
355e9fcaa8aSmrg</programlisting></para>
356e9fcaa8aSmrg
357e9fcaa8aSmrg<para>
3580f8248bfSmrgIf
3590f8248bfSmrg<symbol>XkbIM_NoAutomatic</symbol>
3600f8248bfSmrgis not set (the keyboard drives the indicator), the effect of
3610f8248bfSmrg<structfield>which_groups</structfield>
3620f8248bfSmrgand
3630f8248bfSmrg<structfield>groups</structfield>
3640f8248bfSmrgis shown in <link linkend="table8.2">Table 8.2</link>.
365e9fcaa8aSmrg</para>
366e9fcaa8aSmrg
3670f8248bfSmrg<table id='table8.2' frame='topbot'>
368e9fcaa8aSmrg<title>XkbIndicatorMapRec which_groups and groups, Keyboard Drives
369e9fcaa8aSmrgIndicator</title>
370eb411b4bSmrg<?dbfo keep-together="always" ?>
371eb411b4bSmrg<tgroup cols='2' align='left' colsep='0' rowsep='0'>
372eb411b4bSmrg<colspec colname='c1' colwidth='1.0*'/>
373eb411b4bSmrg<colspec colname='c2' colwidth='2.0*'/>
374e9fcaa8aSmrg<thead>
375eb411b4bSmrg<row rowsep='1'>
376e9fcaa8aSmrg  <entry>which_groups</entry>
377e9fcaa8aSmrg  <entry>Effect</entry>
378e9fcaa8aSmrg  </row>
379e9fcaa8aSmrg</thead>
380e9fcaa8aSmrg<tbody>
381eb411b4bSmrg  <row>
3820f8248bfSmrg    <entry><symbol>XkbIM_UseNone</symbol></entry>
383e9fcaa8aSmrg    <entry>
3840f8248bfSmrgThe
3850f8248bfSmrg<structfield>groups</structfield>
3860f8248bfSmrgfield and the current keyboard group state are ignored.
387e9fcaa8aSmrg    </entry>
388e9fcaa8aSmrg  </row>
389eb411b4bSmrg  <row>
3900f8248bfSmrg    <entry><symbol>XkbIM_UseBase</symbol></entry>
391e9fcaa8aSmrg    <entry>
3920f8248bfSmrgIf
3930f8248bfSmrg<structfield>groups</structfield>
3940f8248bfSmrgis nonzero, the indicator is lit whenever the base keyboard group is nonzero.
3950f8248bfSmrgIf
3960f8248bfSmrg<structfield>groups</structfield>
3970f8248bfSmrgis zero, the indicator is lit whenever the base keyboard group is zero.
398e9fcaa8aSmrg    </entry>
399e9fcaa8aSmrg  </row>
400eb411b4bSmrg  <row>
4010f8248bfSmrg    <entry><symbol>XkbIM_UseLatched</symbol></entry>
402e9fcaa8aSmrg    <entry>
4030f8248bfSmrgIf
4040f8248bfSmrg<structfield>groups</structfield>
4050f8248bfSmrgis nonzero, the indicator is lit whenever the latched keyboard group is
4060f8248bfSmrgnonzero. If
4070f8248bfSmrg<structfield>groups</structfield>
4080f8248bfSmrgis zero, the indicator is lit whenever the latched keyboard group is zero.
409e9fcaa8aSmrg    </entry>
410e9fcaa8aSmrg  </row>
411eb411b4bSmrg  <row>
4120f8248bfSmrg    <entry><symbol>XkbIM_UseLocked</symbol></entry>
413e9fcaa8aSmrg    <entry>
4140f8248bfSmrgThe
4150f8248bfSmrg<structfield>groups</structfield>
4160f8248bfSmrgfield is interpreted as a mask. The indicator is lit when the current locked
4170f8248bfSmrgkeyboard group matches one of the bits that are set in
4180f8248bfSmrg<structfield>groups</structfield>.
419e9fcaa8aSmrg    </entry>
420e9fcaa8aSmrg  </row>
421eb411b4bSmrg  <row>
4220f8248bfSmrg    <entry><symbol>XkbIM_UseEffective</symbol></entry>
423e9fcaa8aSmrg    <entry>
4240f8248bfSmrgThe
4250f8248bfSmrg<structfield>groups</structfield>
4260f8248bfSmrgfield is interpreted as a mask. The indicator is lit when the current
4270f8248bfSmrgeffective keyboard group matches one of the bits that are set in
4280f8248bfSmrg<structfield>groups</structfield>.
4290f8248bfSmrg</entry>
430e9fcaa8aSmrg  </row>
431e9fcaa8aSmrg</tbody>
432e9fcaa8aSmrg</tgroup>
433e9fcaa8aSmrg</table>
434e9fcaa8aSmrg
435e9fcaa8aSmrg<para>
4360f8248bfSmrgThe effect of
4370f8248bfSmrg<structfield>which_groups</structfield>
4380f8248bfSmrgand
4390f8248bfSmrg<structfield>groups</structfield>
4400f8248bfSmrgwhen you change an indicator for which
4410f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
4420f8248bfSmrgis set (the indicator drives the keyboard) is shown in
4430f8248bfSmrg<link linkend="table8.3">Table 8.3</link>. The <quote>New State</quote>
4440f8248bfSmrgcolumn refers to the new state to which you set the indicator.
445e9fcaa8aSmrg</para>
446e9fcaa8aSmrg
4470f8248bfSmrg<table id='table8.3' frame='topbot'>
448e9fcaa8aSmrg<title>XkbIndicatorMapRec which_groups and groups, Indicator Drives
449e9fcaa8aSmrgKeyboard</title>
450eb411b4bSmrg<?dbfo keep-together="always" ?>
451eb411b4bSmrg<tgroup cols='3' align='left' colsep='0' rowsep='0'>
452eb411b4bSmrg<colspec colname='c1' colwidth='2.0*'/>
453eb411b4bSmrg<colspec colname='c2' colwidth='1.0*'/>
454eb411b4bSmrg<colspec colname='c3' colwidth='3.0*'/>
455e9fcaa8aSmrg<thead>
456eb411b4bSmrg<row rowsep='1'>
457e9fcaa8aSmrg  <entry>which_groups</entry>
458e9fcaa8aSmrg  <entry>New State</entry>
459e9fcaa8aSmrg  <entry>Effect on Keyboard Group State</entry>
460e9fcaa8aSmrg  </row>
461e9fcaa8aSmrg</thead>
462e9fcaa8aSmrg<tbody>
463eb411b4bSmrg  <row>
4640f8248bfSmrg    <entry><symbol>XkbIM_UseNone</symbol></entry>
465e9fcaa8aSmrg    <entry>On or Off</entry>
466e9fcaa8aSmrg    <entry>No effect</entry>
467e9fcaa8aSmrg  </row>
468eb411b4bSmrg  <row>
4690f8248bfSmrg    <entry><symbol>XkbIM_UseBase</symbol></entry>
470e9fcaa8aSmrg    <entry>On or Off</entry>
471e9fcaa8aSmrg    <entry>No effect</entry>
472e9fcaa8aSmrg  </row>
473eb411b4bSmrg  <row>
4740f8248bfSmrg    <entry><symbol>XkbIM_UseLatched</symbol></entry>
475e9fcaa8aSmrg    <entry>On</entry>
476e9fcaa8aSmrg    <entry>
4770f8248bfSmrgThe
4780f8248bfSmrg<structfield>groups</structfield>
4790f8248bfSmrgfield is treated as a group mask. The keyboard group latch is changed to the
4800f8248bfSmrglowest numbered group specified in
4810f8248bfSmrg<structfield>groups</structfield>;
4820f8248bfSmrgif
4830f8248bfSmrg<structfield>groups</structfield>
4840f8248bfSmrgis empty, the keyboard group latch is changed to zero.
485e9fcaa8aSmrg    </entry>
486e9fcaa8aSmrg  </row>
487eb411b4bSmrg  <row>
4880f8248bfSmrg    <entry><symbol>XkbIM_UseLatched</symbol></entry>
489e9fcaa8aSmrg    <entry>Off</entry>
490e9fcaa8aSmrg    <entry>
4910f8248bfSmrgThe
4920f8248bfSmrg<structfield>groups</structfield>
4930f8248bfSmrgfield is treated as a group mask. If the indicator is explicitly extinguished,
494e9fcaa8aSmrgkeyboard group latch is changed to the lowest numbered group not specified in
4950f8248bfSmrg<structfield>groups</structfield>;
4960f8248bfSmrgif
4970f8248bfSmrg<structfield>groups</structfield>
4980f8248bfSmrgis zero, the keyboard group latch is set to the index of the highest legal
499e9fcaa8aSmrgkeyboard group.
500e9fcaa8aSmrg    </entry>
501e9fcaa8aSmrg  </row>
502eb411b4bSmrg  <row>
503e9fcaa8aSmrg    <entry>XkbIM_UseLocked or XkbIM_UseEffective</entry>
504e9fcaa8aSmrg    <entry>On</entry>
505e9fcaa8aSmrg    <entry>
5060f8248bfSmrgIf the
5070f8248bfSmrg<structfield>groups</structfield>
5080f8248bfSmrgmask is empty, group is not changed; otherwise, the locked keyboard group is
5090f8248bfSmrgchanged to the lowest numbered group specified in
5100f8248bfSmrg<structfield>groups</structfield>.
511e9fcaa8aSmrg    </entry>
512e9fcaa8aSmrg  </row>
513eb411b4bSmrg  <row>
514e9fcaa8aSmrg    <entry>XkbIM_UseLocked or XkbIM_UseEffective</entry>
515e9fcaa8aSmrg    <entry>Off</entry>
516e9fcaa8aSmrg    <entry>
517e9fcaa8aSmrgLocked keyboard group is changed to the lowest numbered group that is not
5180f8248bfSmrgspecified in the
5190f8248bfSmrg<structfield>groups</structfield>
5200f8248bfSmrgmask, or to
5210f8248bfSmrg<emphasis>Group1</emphasis>
5220f8248bfSmrgif the
5230f8248bfSmrg<structfield>groups</structfield>
5240f8248bfSmrgmask contains all keyboard groups.
525e9fcaa8aSmrg    </entry>
526e9fcaa8aSmrg  </row>
527e9fcaa8aSmrg</tbody>
528e9fcaa8aSmrg</tgroup>
529e9fcaa8aSmrg</table>
530e9fcaa8aSmrg
531e9fcaa8aSmrg</sect3>
532eb411b4bSmrg<sect3 id='XkbIndicatorMapRec_which_mods_and_mods_fields'>
533e9fcaa8aSmrg<title>XkbIndicatorMapRec which_mods and mods fields</title>
534e9fcaa8aSmrg
535e9fcaa8aSmrg<para>
5360f8248bfSmrgThe
5370f8248bfSmrg<structfield>mods</structfield>
5380f8248bfSmrgfield specifies what modifiers an indicator watches. The
5390f8248bfSmrg<structfield>mods</structfield>
5400f8248bfSmrgfield is an Xkb modifier definition,
5410f8248bfSmrg<structname>XkbModsRec</structname>,
5420f8248bfSmrgas described in <link linkend="Modifier_Definitions">section 7.2</link>, which can specify both real and virtual
5430f8248bfSmrgmodifiers. The
5440f8248bfSmrg<structfield>mods</structfield>
5450f8248bfSmrgfield takes effect even if some or all of the virtual indicators specified in
5460f8248bfSmrg<structfield>mods</structfield>
5470f8248bfSmrgare unbound. To specify the mods field, in general, assign the modifiers of
5480f8248bfSmrginterest to
5490f8248bfSmrg<structfield>mods.real_mods</structfield>
5500f8248bfSmrgand the virtual modifiers of interest to
5510f8248bfSmrg<structfield>mods.vmods</structfield>.
5520f8248bfSmrgYou can disregard the
5530f8248bfSmrg<structfield>mods.mask</structfield>
5540f8248bfSmrgfield unless your application needs to interpret the indicator map directly
555e9fcaa8aSmrg(that is, to simulate automatic indicator behavior on its own). Relatively few
556e9fcaa8aSmrgapplications need to do so, but if you find it necessary, you can either read
557e9fcaa8aSmrgthe indicator map back from the server after you update it (the server
558e9fcaa8aSmrgautomatically updates the mask field whenever any of the real or virtual
5590f8248bfSmrgmodifiers are changed in the modifier definition) or you can use
5600f8248bfSmrg<function>XkbVirtualModsToReal</function>
5610f8248bfSmrgto determine the proper contents for the mask field, assuming that the
5620f8248bfSmrg<structname>XkbDescRec</structname>
5630f8248bfSmrgcontains the virtual modifier definitions.
5640f8248bfSmrg</para>
5650f8248bfSmrg
5660f8248bfSmrg<para>
5670f8248bfSmrg<structfield>which_mods</structfield>
5680f8248bfSmrgspecifies what criteria Xkb uses to determine a match with the corresponding
5690f8248bfSmrg<structfield>mods</structfield>
5700f8248bfSmrgfield by specifying one or more components of the Xkb keyboard state. If
5710f8248bfSmrg<symbol>XkbIM_NoAutomatic</symbol>
5720f8248bfSmrgis not set (the keyboard drives the indicator), the indicator is lit whenever
5730f8248bfSmrgany of the modifiers specified in the
5740f8248bfSmrg<structfield>mask</structfield>
5750f8248bfSmrgfield of the
5760f8248bfSmrg<structfield>mods</structfield>
5770f8248bfSmrgmodifier definition are also set in any of the current keyboard state
5780f8248bfSmrgcomponents specified by
5790f8248bfSmrg<structfield>which_mods</structfield>.
5800f8248bfSmrgRemember that the
5810f8248bfSmrg<structfield>mask</structfield>
5820f8248bfSmrgfield is comprised of all of the real modifiers specified in the definition
583e9fcaa8aSmrgplus any real modifiers that are bound to the virtual modifiers specified in
5840f8248bfSmrgthe definition. (See <xref linkend="Keyboard_State" /> for more information on the keyboard state and
5850f8248bfSmrg<xref linkend="Virtual_Modifiers" /> for more information on virtual modifiers.) Use a bitwise inclusive
5860f8248bfSmrgOR of the following values to compose a value for
5870f8248bfSmrg<structfield>which_mods</structfield>:
588e9fcaa8aSmrg
5890f8248bfSmrg<programlisting>
590e9fcaa8aSmrg#define XkbIM_UseNone             0
591e9fcaa8aSmrg#define XkbIM_UseBase             (1L &lt;&lt; 0)
592e9fcaa8aSmrg#define XkbIM_UseLatched          (1L &lt;&lt; 1)
593e9fcaa8aSmrg#define XkbIM_UseLocked           (1L &lt;&lt; 2)
594e9fcaa8aSmrg#define XkbIM_UseEffective        (1L &lt;&lt; 3)
595e9fcaa8aSmrg#define XkbIM_UseCompat           (1L &lt;&lt; 4)
596e9fcaa8aSmrg#define XkbIM_UseAnyMods          XkbIM_UseBase | XkbIM_UseLatched |
597e9fcaa8aSmrg                                  XkbIM_UseLocked | XkbIM_UseEffective |
598e9fcaa8aSmrg                                  XkbIM_UseCompat
599e9fcaa8aSmrg</programlisting></para>
600e9fcaa8aSmrg
601e9fcaa8aSmrg<para>
6020f8248bfSmrgIf
6030f8248bfSmrg<symbol>XkbIM_NoAutomatic</symbol>
6040f8248bfSmrgis not set (the keyboard drives the indicator), the effect of
6050f8248bfSmrg<structfield>which_mods</structfield>
6060f8248bfSmrgand
6070f8248bfSmrg<structfield>mods</structfield>
6080f8248bfSmrgis shown in <link linkend="table8.4">Table 8.4</link>
609e9fcaa8aSmrg</para>
610e9fcaa8aSmrg
6110f8248bfSmrg<table id='table8.4' frame='topbot'>
612e9fcaa8aSmrg<title>XkbIndicatorMapRec which_mods and mods, Keyboard Drives Indicator</title>
613eb411b4bSmrg<?dbfo keep-together="always" ?>
614eb411b4bSmrg<tgroup cols='2' align='left' colsep='0' rowsep='0'>
615eb411b4bSmrg<colspec colname='c1' colwidth='1.0*'/>
616eb411b4bSmrg<colspec colname='c2' colwidth='2.0*'/>
617e9fcaa8aSmrg<thead>
618eb411b4bSmrg<row rowsep='1'>
619e9fcaa8aSmrg  <entry>which_mods</entry>
620e9fcaa8aSmrg  <entry>Effect on Keyboard Modifiers</entry>
621e9fcaa8aSmrg  </row>
622e9fcaa8aSmrg</thead>
623e9fcaa8aSmrg<tbody>
624eb411b4bSmrg  <row>
6250f8248bfSmrg    <entry><symbol>XkbIM_UseNone</symbol></entry>
626e9fcaa8aSmrg    <entry>The mods field and the current keyboard modifier state are
627e9fcaa8aSmrgignored.</entry>
628e9fcaa8aSmrg  </row>
629eb411b4bSmrg  <row>
6300f8248bfSmrg    <entry><symbol>XkbIM_UseBase</symbol></entry>
631e9fcaa8aSmrg    <entry>
6320f8248bfSmrgThe indicator is lit when any of the modifiers specified in the
6330f8248bfSmrg<structfield>mask</structfield>
6340f8248bfSmrgfield of
6350f8248bfSmrg<structfield>mods</structfield>
6360f8248bfSmrgare on in the keyboard base state. If both
6370f8248bfSmrg<structfield>mods.real_mods</structfield>
6380f8248bfSmrgand
6390f8248bfSmrg<structfield>mods.vmods</structfield>
6400f8248bfSmrgare zero, the indicator is lit when the base keyboard state contains no
641e9fcaa8aSmrgmodifiers.
642e9fcaa8aSmrg    </entry>
643e9fcaa8aSmrg  </row>
644eb411b4bSmrg  <row>
6450f8248bfSmrg    <entry><symbol>XkbIM_UseLatched</symbol></entry>
646e9fcaa8aSmrg    <entry>
6470f8248bfSmrgThe indicator is lit when any of the modifiers specified in the
6480f8248bfSmrg<structfield>mask</structfield>
6490f8248bfSmrgfield of
6500f8248bfSmrg<structfield>mods</structfield>
6510f8248bfSmrgare latched. If both
6520f8248bfSmrg<structfield>mods.real_mods</structfield>
6530f8248bfSmrgand
6540f8248bfSmrg<structfield>mods.vmods</structfield>
6550f8248bfSmrgare zero, the indicator is lit when none of the modifier keys are latched.
656e9fcaa8aSmrg    </entry>
657e9fcaa8aSmrg  </row>
658eb411b4bSmrg  <row>
6590f8248bfSmrg    <entry><symbol>XkbIM_UseLocked</symbol></entry>
660e9fcaa8aSmrg    <entry>
6610f8248bfSmrgThe indicator is lit when any of the modifiers specified in the
6620f8248bfSmrg<structfield>mask</structfield>
6630f8248bfSmrgfield of
6640f8248bfSmrg<structfield>mods</structfield>
6650f8248bfSmrgare locked. If both
6660f8248bfSmrg<structfield>mods.real_mods</structfield>
6670f8248bfSmrgand
6680f8248bfSmrg<structfield>mods.vmods</structfield>
6690f8248bfSmrgare zero, the indicator is lit when none of the modifier keys are locked.
670e9fcaa8aSmrg    </entry>
671e9fcaa8aSmrg  </row>
672eb411b4bSmrg  <row>
6730f8248bfSmrg    <entry><symbol>XkbIM_UseEffective</symbol></entry>
674e9fcaa8aSmrg    <entry>
6750f8248bfSmrgThe indicator is lit when any of the modifiers specified in the
6760f8248bfSmrg<structfield>mask</structfield>
6770f8248bfSmrgfield of
6780f8248bfSmrg<structfield>mods</structfield>
6790f8248bfSmrgare in the effective keyboard state. If both
6800f8248bfSmrg<structfield>mods.real_mods</structfield>
6810f8248bfSmrgand
6820f8248bfSmrg<structfield>mods.vmods</structfield>
6830f8248bfSmrgare zero, the indicator is lit when the effective keyboard state contains no
684e9fcaa8aSmrgmodifiers.
685e9fcaa8aSmrg    </entry>
686e9fcaa8aSmrg  </row>
687eb411b4bSmrg  <row>
6880f8248bfSmrg    <entry><symbol>XkbIM_UseCompat</symbol></entry>
689e9fcaa8aSmrg    <entry>
6900f8248bfSmrgThe indicator is lit when any of the modifiers specified in the
6910f8248bfSmrg<structfield>mask</structfield>
6920f8248bfSmrgfield of
6930f8248bfSmrg<structfield>mods</structfield>
6940f8248bfSmrgare in the keyboard compatibility state. If both
6950f8248bfSmrg<structfield>mods.real_mods</structfield>
6960f8248bfSmrgand
6970f8248bfSmrg<structfield>mods.vmods</structfield>
6980f8248bfSmrgare zero, the indicator is lit when the keyboard compatibility state contains
699e9fcaa8aSmrgno modifiers.
700e9fcaa8aSmrg    </entry>
701e9fcaa8aSmrg  </row>
702e9fcaa8aSmrg</tbody>
703e9fcaa8aSmrg</tgroup>
704e9fcaa8aSmrg</table>
705e9fcaa8aSmrg
706e9fcaa8aSmrg<para>
7070f8248bfSmrgThe effect on the keyboard modifiers of
7080f8248bfSmrg<structfield>which_mods</structfield>
7090f8248bfSmrgand
7100f8248bfSmrg<structfield>mods</structfield>
7110f8248bfSmrgwhen you change an indicator for which
7120f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
7130f8248bfSmrgis set (the indicator drives the keyboard) is shown in
7140f8248bfSmrg<link linkend="table8.5">Table 8.5</link>. The <quote>New State</quote>
7150f8248bfSmrgcolumn refers to the new state to which you set the indicator.
7160f8248bfSmrg</para>
717e9fcaa8aSmrg
7180f8248bfSmrg<table id='table8.5' frame='topbot'>
719e9fcaa8aSmrg<title>XkbIndicatorMapRec which_mods and mods, Indicator Drives Keyboard</title>
720eb411b4bSmrg<?dbfo keep-together="always" ?>
721eb411b4bSmrg<tgroup cols='3' align='left' colsep='0' rowsep='0'>
722eb411b4bSmrg<colspec colname='c1' colwidth='2.0*'/>
723eb411b4bSmrg<colspec colname='c2' colwidth='1.0*'/>
724eb411b4bSmrg<colspec colname='c3' colwidth='3.0*'/>
725e9fcaa8aSmrg<thead>
726eb411b4bSmrg<row rowsep='1'>
727e9fcaa8aSmrg  <entry>which_mods</entry>
728e9fcaa8aSmrg  <entry>New State</entry>
729e9fcaa8aSmrg  <entry>Effect on Keyboard Modifiers</entry>
730e9fcaa8aSmrg  </row>
731e9fcaa8aSmrg</thead>
732e9fcaa8aSmrg<tbody>
733eb411b4bSmrg  <row>
734e9fcaa8aSmrg    <entry>XkbIM_UseNone or XkbIM_UseBase</entry>
735e9fcaa8aSmrg    <entry>On or Off</entry>
736e9fcaa8aSmrg    <entry>No Effect</entry>
737e9fcaa8aSmrg  </row>
738eb411b4bSmrg  <row>
7390f8248bfSmrg    <entry><symbol>XkbIM_UseLatched</symbol></entry>
740e9fcaa8aSmrg    <entry>On</entry>
741e9fcaa8aSmrg    <entry>
7420f8248bfSmrgAny modifiers specified in the
7430f8248bfSmrg<structfield>mask</structfield>
7440f8248bfSmrgfield of
7450f8248bfSmrg<structfield>mods</structfield>
7460f8248bfSmrgare added to the latched modifiers.
747e9fcaa8aSmrg    </entry>
748e9fcaa8aSmrg  </row>
749eb411b4bSmrg  <row>
7500f8248bfSmrg    <entry><symbol>XkbIM_UseLatched</symbol></entry>
751e9fcaa8aSmrg    <entry>Off</entry>
752e9fcaa8aSmrg    <entry>
7530f8248bfSmrgAny modifiers specified in the
7540f8248bfSmrg<structfield>mask</structfield>
7550f8248bfSmrgfield of
7560f8248bfSmrg<structfield>mods</structfield>
7570f8248bfSmrgare removed from the latched modifiers.
758e9fcaa8aSmrg    </entry>
759e9fcaa8aSmrg  </row>
760eb411b4bSmrg  <row>
761e9fcaa8aSmrg    <entry>XkbIM_UseLocked, XkbIM_UseCompat, or XkbIM_UseEffective</entry>
762e9fcaa8aSmrg    <entry>On</entry>
763e9fcaa8aSmrg    <entry>
7640f8248bfSmrgAny modifiers specified in the
7650f8248bfSmrg<structfield>mask</structfield>
7660f8248bfSmrgfield of
7670f8248bfSmrg<structfield>mods</structfield>
7680f8248bfSmrgare added to the locked modifiers.
769e9fcaa8aSmrg    </entry>
770e9fcaa8aSmrg  </row>
771eb411b4bSmrg  <row>
7720f8248bfSmrg    <entry><symbol>XkbIM_UseLocked</symbol></entry>
773e9fcaa8aSmrg    <entry>Off</entry>
774e9fcaa8aSmrg    <entry>
7750f8248bfSmrgAny modifiers specified in the
7760f8248bfSmrg<structfield>mask</structfield>
7770f8248bfSmrgfield of
7780f8248bfSmrg<structfield>mods</structfield>
7790f8248bfSmrgare removed from the locked modifiers.
780e9fcaa8aSmrg    </entry>
781e9fcaa8aSmrg  </row>
782eb411b4bSmrg  <row>
783e9fcaa8aSmrg    <entry>XkbIM_UseCompat or XkbIM_UseEffective</entry>
784e9fcaa8aSmrg    <entry>Off</entry>
785e9fcaa8aSmrg    <entry>
7860f8248bfSmrgAny modifiers specified in the
7870f8248bfSmrg<structfield>mask</structfield>
7880f8248bfSmrgfield of
7890f8248bfSmrg<structfield>mods</structfield>
7900f8248bfSmrgare removed from both the locked and latched modifiers.
791e9fcaa8aSmrg    </entry>
792e9fcaa8aSmrg  </row>
793e9fcaa8aSmrg</tbody>
794e9fcaa8aSmrg</tgroup>
795e9fcaa8aSmrg</table>
796e9fcaa8aSmrg
797e9fcaa8aSmrg</sect3>
798eb411b4bSmrg<sect3 id='XkbIndicatorMapRec_ctrls_field'>
799e9fcaa8aSmrg<title>XkbIndicatorMapRec ctrls field</title>
800e9fcaa8aSmrg
801e9fcaa8aSmrg<para>
8020f8248bfSmrgThe
8030f8248bfSmrg<structfield>ctrls</structfield>
8040f8248bfSmrgfield specifies what controls (see <xref linkend="Keyboard_Controls" />) the indicator watches and is
805e9fcaa8aSmrgcomposed using the bitwise inclusive OR of the following values:
806e9fcaa8aSmrg
8070f8248bfSmrg<programlisting>
808e9fcaa8aSmrg#define XkbRepeatKeysMask           (1L &lt;&lt; 0)
809e9fcaa8aSmrg#define XkbSlowKeysMask             (1L &lt;&lt; 1)
810e9fcaa8aSmrg#define XkbBounceKeysMask           (1L &lt;&lt; 2)
811e9fcaa8aSmrg#define XkbStickyKeysMask           (1L &lt;&lt; 3)
812e9fcaa8aSmrg#define XkbMouseKeysMask            (1L &lt;&lt; 4)
813e9fcaa8aSmrg#define XkbMouseKeysAccelMask       (1L &lt;&lt; 5)
814e9fcaa8aSmrg#define XkbAccessXKeysMask          (1L &lt;&lt; 6)
815e9fcaa8aSmrg#define XkbAccessXTimeoutMask       (1L &lt;&lt; 7)
816e9fcaa8aSmrg#define XkbAccessXFeedbackMask      (1L &lt;&lt; 8)
817e9fcaa8aSmrg#define XkbAudibleBellMask          (1L &lt;&lt; 9)
818e9fcaa8aSmrg#define XkbOverlay1Mask             (1L &lt;&lt; 10)
819e9fcaa8aSmrg#define XkbOverlay2Mask             (1L &lt;&lt; 11)
820e9fcaa8aSmrg#define XkbAllBooleanCtrlsMask      (0x00001FFF)
821e9fcaa8aSmrg</programlisting></para>
822e9fcaa8aSmrg
823e9fcaa8aSmrg<para>
824e9fcaa8aSmrgXkb lights the indicator whenever any of the boolean controls specified in
8250f8248bfSmrg<structfield>ctrls</structfield>
8260f8248bfSmrgis enabled.
827e9fcaa8aSmrg</para>
828e9fcaa8aSmrg
829e9fcaa8aSmrg
830e9fcaa8aSmrg</sect3>
831e9fcaa8aSmrg</sect2>
832e9fcaa8aSmrg</sect1>
833eb411b4bSmrg<sect1 id='Getting_Information_About_Indicators'>
834e9fcaa8aSmrg<title>Getting Information About Indicators</title>
835e9fcaa8aSmrg
836e9fcaa8aSmrg<para>
837e9fcaa8aSmrgXkb allows applications to obtain information about indicators using two
838e9fcaa8aSmrgdifferent methods. The first method, which is similar to the core X
839e9fcaa8aSmrgimplementation, uses a mask to specify the indicators. The second method, which
840e9fcaa8aSmrgis more suitable for applications concerned with interoperability, uses
841e9fcaa8aSmrgindicator names. The correspondence between the indicator name and the bit
8420f8248bfSmrgposition in masks is as follows: one of the parameters returned from
8433233502eSmrg<function>XkbGetNamedDeviceIndicator</function>
8440f8248bfSmrgis an index that is the bit position to use in any function call that requires
8450f8248bfSmrga mask of indicator bits, as well as the indicator’s index into the
8460f8248bfSmrg<structname>XkbIndicatorRec</structname>
8470f8248bfSmrgarray of indicator maps.
848e9fcaa8aSmrg</para>
849e9fcaa8aSmrg
850e9fcaa8aSmrg
851eb411b4bSmrg<sect2 id='Getting_Indicator_State'>
852e9fcaa8aSmrg<title>Getting Indicator State</title>
853e9fcaa8aSmrg
854e9fcaa8aSmrg<para>
855e9fcaa8aSmrgBecause the state of the indicators is relatively volatile, the keyboard
856e9fcaa8aSmrgdescription does not hold the current state of the indicators. To obtain the
8570f8248bfSmrgcurrent state of the keyboard indicators, use
8580f8248bfSmrg<function>XkbGetIndicatorState</function>.
8590f8248bfSmrg</para>
8600f8248bfSmrg
8610f8248bfSmrg<indexterm significance="preferred" zone="XkbGetIndicatorState"><primary><function>XkbGetIndicatorState</function></primary></indexterm>
8620f8248bfSmrg<funcsynopsis id="XkbGetIndicatorState">
8630f8248bfSmrg  <funcprototype>
8640f8248bfSmrg    <funcdef>Status <function>XkbGetIndicatorState</function></funcdef>
8650f8248bfSmrg<!-- (
8660f8248bfSmrg<parameter>display</parameter>,
8670f8248bfSmrg<parameter>device_spec</parameter>,
8680f8248bfSmrg<parameter>state_return</parameter>
8690f8248bfSmrg) -->
8700f8248bfSmrg
8710f8248bfSmrg    <paramdef>Display *<parameter>display</parameter></paramdef>
8720f8248bfSmrg    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
8730f8248bfSmrg    <paramdef>unsigned int *<parameter>state_return</parameter></paramdef>
8740f8248bfSmrg  </funcprototype>
8750f8248bfSmrg</funcsynopsis>
8760f8248bfSmrg<variablelist>
8770f8248bfSmrg  <varlistentry>
8780f8248bfSmrg    <term>
8790f8248bfSmrg      <parameter>display</parameter>
8800f8248bfSmrg    </term>
8810f8248bfSmrg    <listitem>
8820f8248bfSmrg      <para>
8830f8248bfSmrg        connection to the X server
8840f8248bfSmrg      </para>
8850f8248bfSmrg    </listitem>
8860f8248bfSmrg  </varlistentry>
8870f8248bfSmrg  <varlistentry>
8880f8248bfSmrg    <term>
8890f8248bfSmrg      <parameter>device_spec</parameter>
8900f8248bfSmrg    </term>
8910f8248bfSmrg    <listitem>
8920f8248bfSmrg      <para>
8930f8248bfSmrg        device ID, or <symbol>XkbUseCoreKbd</symbol>
8940f8248bfSmrg      </para>
8950f8248bfSmrg    </listitem>
8960f8248bfSmrg  </varlistentry>
8970f8248bfSmrg  <varlistentry>
8980f8248bfSmrg    <term>
8990f8248bfSmrg      <parameter>state_return</parameter>
9000f8248bfSmrg    </term>
9010f8248bfSmrg    <listitem>
9020f8248bfSmrg      <para>
9030f8248bfSmrg        backfilled with a mask of the indicator state
9040f8248bfSmrg      </para>
9050f8248bfSmrg    </listitem>
9060f8248bfSmrg  </varlistentry>
9070f8248bfSmrg</variablelist>
9080f8248bfSmrg
9090f8248bfSmrg<para>
9100f8248bfSmrg<function>XkbGetIndicatorState</function>
9110f8248bfSmrgqueries the
9120f8248bfSmrg<parameter>display</parameter>
9130f8248bfSmrgfor the state of the indicators on the device specified by the
9140f8248bfSmrg<parameter>device_spec</parameter>.
9150f8248bfSmrgFor each indicator that is <quote>turned on</quote> on the device,
9160f8248bfSmrgthe associated bit is set in
9170f8248bfSmrg<parameter>state_return</parameter>.
9180f8248bfSmrgIf a compatible version of the Xkb extension is not available in the server,
9190f8248bfSmrg<function>XkbGetIndicatorState</function>
9200f8248bfSmrgreturns a
9210f8248bfSmrg<errorname>BadMatch</errorname>
9220f8248bfSmrgerror. Otherwise, it sends the request to the X server, places the state of
9230f8248bfSmrgthe indicators into
9240f8248bfSmrg<parameter>state_return</parameter>,
9250f8248bfSmrgand returns
9260f8248bfSmrg<symbol>Success</symbol>.
9270f8248bfSmrgThus the value reported by
9280f8248bfSmrg<function>XkbGetIndicatorState</function>
9290f8248bfSmrgis identical to the value reported by the core protocol.
930e9fcaa8aSmrg</para>
931e9fcaa8aSmrg
932e9fcaa8aSmrg
933e9fcaa8aSmrg</sect2>
934eb411b4bSmrg<sect2 id='Getting_Indicator_Information_by_Index'>
935e9fcaa8aSmrg<title>Getting Indicator Information by Index</title>
936e9fcaa8aSmrg
937e9fcaa8aSmrg<para>
938e9fcaa8aSmrgTo get the map for one or more indicators, using a mask to specify the
9390f8248bfSmrgindicators, use
9400f8248bfSmrg<function>XkbGetIndicatorMap</function>.
9410f8248bfSmrg</para>
9420f8248bfSmrg
9430f8248bfSmrg<indexterm significance="preferred" zone="XkbGetIndicatorMap"><primary><function>XkbGetIndicatorMap</function></primary></indexterm>
9440f8248bfSmrg<funcsynopsis id="XkbGetIndicatorMap">
9450f8248bfSmrg  <funcprototype>
9460f8248bfSmrg    <funcdef>Status <function>XkbGetIndicatorMap</function></funcdef>
9470f8248bfSmrg<!-- (
9480f8248bfSmrg<parameter>dpy</parameter>,
9490f8248bfSmrg<parameter>which</parameter>,
9500f8248bfSmrg<parameter>desc</parameter>
9510f8248bfSmrg) -->
9520f8248bfSmrg
9530f8248bfSmrg    <paramdef>Display *<parameter>dpy</parameter></paramdef>
9540f8248bfSmrg    <paramdef>unsigned int <parameter>which</parameter></paramdef>
9550f8248bfSmrg    <paramdef>XkbDescPtr <parameter>desc</parameter></paramdef>
9560f8248bfSmrg  </funcprototype>
9570f8248bfSmrg</funcsynopsis>
9580f8248bfSmrg<variablelist>
9590f8248bfSmrg  <varlistentry>
9600f8248bfSmrg    <term>
9610f8248bfSmrg      <parameter>dpy</parameter>
9620f8248bfSmrg    </term>
9630f8248bfSmrg    <listitem>
9640f8248bfSmrg      <para>
9650f8248bfSmrg        connection to the X server
9660f8248bfSmrg      </para>
9670f8248bfSmrg    </listitem>
9680f8248bfSmrg  </varlistentry>
9690f8248bfSmrg  <varlistentry>
9700f8248bfSmrg    <term>
9710f8248bfSmrg      <parameter>which</parameter>
9720f8248bfSmrg    </term>
9730f8248bfSmrg    <listitem>
9740f8248bfSmrg      <para>
9750f8248bfSmrg        mask of indicators for which maps should be returned
9760f8248bfSmrg      </para>
9770f8248bfSmrg    </listitem>
9780f8248bfSmrg  </varlistentry>
9790f8248bfSmrg  <varlistentry>
9800f8248bfSmrg    <term>
9810f8248bfSmrg      <parameter>desc</parameter>
9820f8248bfSmrg    </term>
9830f8248bfSmrg    <listitem>
9840f8248bfSmrg      <para>
9850f8248bfSmrg        keyboard description to be updated
9860f8248bfSmrg      </para>
9870f8248bfSmrg    </listitem>
9880f8248bfSmrg  </varlistentry>
9890f8248bfSmrg</variablelist>
9900f8248bfSmrg
9910f8248bfSmrg<para>
9920f8248bfSmrg<function>XkbGetIndicatorMap</function>
9930f8248bfSmrgobtains the maps from the server for only those indicators specified by the
9940f8248bfSmrg<parameter>which</parameter>
9950f8248bfSmrgmask and copies the values into the keyboard description specified by
9960f8248bfSmrg<parameter>desc</parameter>.
9970f8248bfSmrgIf the
9980f8248bfSmrg<structfield>indicators</structfield>
9990f8248bfSmrgfield of the
10000f8248bfSmrg<parameter>desc</parameter>
10010f8248bfSmrgparameter is
10020f8248bfSmrg<symbol>NULL</symbol>,
10030f8248bfSmrg<function>XkbGetIndicatorMap</function>
10040f8248bfSmrgallocates and initializes it.
10050f8248bfSmrg</para>
10060f8248bfSmrg
10070f8248bfSmrg
10080f8248bfSmrg<para>
10090f8248bfSmrg<function>XkbGetIndicatorMap</function>
10100f8248bfSmrgcan generate
10110f8248bfSmrg<errorname>BadAlloc</errorname>,
10120f8248bfSmrg<errorname>BadLength</errorname>,
10130f8248bfSmrg<errorname>BadMatch</errorname>,
10140f8248bfSmrgand
10150f8248bfSmrg<errorname>BadImplementation</errorname>
10160f8248bfSmrgerrors.
10170f8248bfSmrg</para>
10180f8248bfSmrg
10190f8248bfSmrg
10200f8248bfSmrg<para>
10210f8248bfSmrgTo free the indicator maps, use
10220f8248bfSmrg<function>XkbFreeIndicatorMaps</function>
10230f8248bfSmrg(see <link linkend="Allocating_and_Freeing_Indicator_Maps">section 8.6</link>).
1024e9fcaa8aSmrg</para>
1025e9fcaa8aSmrg
1026e9fcaa8aSmrg
1027e9fcaa8aSmrg</sect2>
1028eb411b4bSmrg<sect2 id='Getting_Indicator_Information_by_Name'>
1029e9fcaa8aSmrg<title>Getting Indicator Information by Name</title>
1030e9fcaa8aSmrg
1031e9fcaa8aSmrg<para>
10320f8248bfSmrgXkb also allows applications to refer to indicators by name. Use
10330f8248bfSmrg<function>XkbGetNames</function>
10340f8248bfSmrgto get the indicator names (see <xref linkend="Symbolic_Names" />). Using names eliminates the need
1035e9fcaa8aSmrgfor hard-coding bitmask values for particular keyboards. For example, instead
10360f8248bfSmrgof using vendor-specific constants such as
10370f8248bfSmrg<symbol>WSKBLed_ScrollLock</symbol>
10380f8248bfSmrgmask on Digital workstations or
10390f8248bfSmrg<symbol>XLED_SCROLL_LOCK</symbol>
10400f8248bfSmrgon Sun workstations, you can instead use
10413233502eSmrg<function>XkbGetNamedDeviceIndicator</function> or
10420f8248bfSmrg<function>XkbGetNamedIndicator</function>
10430f8248bfSmrgto look up information on the indicator named <quote>Scroll Lock.</quote>
10440f8248bfSmrg</para>
10450f8248bfSmrg
10460f8248bfSmrg<para>
10470f8248bfSmrgUse
10483233502eSmrg<function>XkbGetNamedDeviceIndicator</function>
10493233502eSmrgto look up the indicator map and other information for an indicator by name
10503233502eSmrgon a specific device.
10510f8248bfSmrg</para>
10520f8248bfSmrg
10533233502eSmrg<indexterm significance="preferred" zone="XkbGetNamedDeviceIndicator"><primary><function>XkbGetNamedDeviceIndicator</function></primary></indexterm>
10543233502eSmrg<funcsynopsis id="XkbGetNamedDeviceIndicator">
10550f8248bfSmrg  <funcprototype>
10563233502eSmrg    <funcdef>Bool <function>XkbGetNamedDeviceIndicator</function></funcdef>
10570f8248bfSmrg<!-- (
10580f8248bfSmrg<parameter>dpy</parameter>,
10590f8248bfSmrg<parameter>dev_spec</parameter>,
10600f8248bfSmrg<parameter>name</parameter>,
10610f8248bfSmrg<parameter>ndx_rtrn</parameter>,
10620f8248bfSmrg<parameter>state_rtrn</parameter>,
10630f8248bfSmrg<parameter>map_rtrn</parameter>,
10640f8248bfSmrg<parameter>real_rtrn</parameter>
10650f8248bfSmrg) -->
10660f8248bfSmrg
10670f8248bfSmrg    <paramdef>Display *<parameter>dpy</parameter></paramdef>
10680f8248bfSmrg    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
10693233502eSmrg    <paramdef>unsigned int <parameter>led_class</parameter></paramdef>
10703233502eSmrg    <paramdef>unsigned int <parameter>led_id</parameter></paramdef>
10710f8248bfSmrg    <paramdef>Atom <parameter>name</parameter></paramdef>
10720f8248bfSmrg    <paramdef>int *<parameter>ndx_rtrn</parameter></paramdef>
10730f8248bfSmrg    <paramdef>Bool *<parameter>state_rtrn</parameter></paramdef>
10740f8248bfSmrg    <paramdef>XkbIndicatorMapPtr <parameter>map_rtrn</parameter></paramdef>
10750f8248bfSmrg    <paramdef>Bool *<parameter>real_rtrn</parameter></paramdef>
10760f8248bfSmrg  </funcprototype>
10770f8248bfSmrg</funcsynopsis>
10780f8248bfSmrg<variablelist>
10790f8248bfSmrg  <varlistentry>
10800f8248bfSmrg    <term>
10810f8248bfSmrg      <parameter>dpy</parameter>
10820f8248bfSmrg    </term>
10830f8248bfSmrg    <listitem>
10840f8248bfSmrg      <para>
10850f8248bfSmrg        connection to the X server
10860f8248bfSmrg      </para>
10870f8248bfSmrg    </listitem>
10880f8248bfSmrg  </varlistentry>
10890f8248bfSmrg  <varlistentry>
10900f8248bfSmrg    <term>
10910f8248bfSmrg      <parameter>device_spec</parameter>
10920f8248bfSmrg    </term>
10930f8248bfSmrg    <listitem>
10940f8248bfSmrg      <para>
10950f8248bfSmrg        keyboard device ID, or <symbol>XkbUseCoreKbd</symbol>
10960f8248bfSmrg      </para>
10970f8248bfSmrg    </listitem>
10980f8248bfSmrg  </varlistentry>
10993233502eSmrg  <varlistentry>
11003233502eSmrg    <term>
11013233502eSmrg      <parameter>led_class</parameter>
11023233502eSmrg    </term>
11033233502eSmrg    <listitem>
11043233502eSmrg      <para>
11053233502eSmrg        feedback class, or <symbol>XkbDfltXIClass</symbol>
11063233502eSmrg      </para>
11073233502eSmrg    </listitem>
11083233502eSmrg  </varlistentry>
11093233502eSmrg  <varlistentry>
11103233502eSmrg    <term>
11113233502eSmrg      <parameter>led_id</parameter>
11123233502eSmrg    </term>
11133233502eSmrg    <listitem>
11143233502eSmrg      <para>
11153233502eSmrg        feedback ID, or <symbol>XkbDfltXIId</symbol>
11163233502eSmrg      </para>
11173233502eSmrg    </listitem>
11183233502eSmrg  </varlistentry>
11190f8248bfSmrg  <varlistentry>
11200f8248bfSmrg    <term>
11210f8248bfSmrg      <parameter>name</parameter>
11220f8248bfSmrg    </term>
11230f8248bfSmrg    <listitem>
11240f8248bfSmrg      <para>
11250f8248bfSmrg        name of the indicator to be retrieved
11260f8248bfSmrg      </para>
11270f8248bfSmrg    </listitem>
11280f8248bfSmrg  </varlistentry>
11290f8248bfSmrg  <varlistentry>
11300f8248bfSmrg    <term>
11310f8248bfSmrg      <parameter>ndx_rtrn</parameter>
11320f8248bfSmrg    </term>
11330f8248bfSmrg    <listitem>
11340f8248bfSmrg      <para>
11350f8248bfSmrg        backfilled with the index of the retrieved indicator
11360f8248bfSmrg      </para>
11370f8248bfSmrg    </listitem>
11380f8248bfSmrg  </varlistentry>
11390f8248bfSmrg  <varlistentry>
11400f8248bfSmrg    <term>
11410f8248bfSmrg      <parameter>state_rtrn</parameter>
11420f8248bfSmrg    </term>
11430f8248bfSmrg    <listitem>
11440f8248bfSmrg      <para>
11450f8248bfSmrg        backfilled with the current state of the retrieved indicator
11460f8248bfSmrg      </para>
11470f8248bfSmrg    </listitem>
11480f8248bfSmrg  </varlistentry>
11490f8248bfSmrg  <varlistentry>
11500f8248bfSmrg    <term>
11510f8248bfSmrg      <parameter>map_rtrn</parameter>
11520f8248bfSmrg    </term>
11530f8248bfSmrg    <listitem>
11540f8248bfSmrg      <para>
11550f8248bfSmrg        backfilled with the mapping for the retrieved indicator
11560f8248bfSmrg      </para>
11570f8248bfSmrg    </listitem>
11580f8248bfSmrg  </varlistentry>
11590f8248bfSmrg  <varlistentry>
11600f8248bfSmrg    <term>
11610f8248bfSmrg      <parameter>real_rtrn</parameter>
11620f8248bfSmrg    </term>
11630f8248bfSmrg    <listitem>
11640f8248bfSmrg      <para>
11650f8248bfSmrg        backfilled with <symbol>True</symbol>
11660f8248bfSmrg         if the named indicator is real (physical)
11670f8248bfSmrg      </para>
11680f8248bfSmrg    </listitem>
11690f8248bfSmrg  </varlistentry>
11700f8248bfSmrg</variablelist>
11710f8248bfSmrg
11720f8248bfSmrg<para>
11730f8248bfSmrgIf the device specified by
11740f8248bfSmrg<parameter>device_spec</parameter>
11753233502eSmrgwith feedback specified by
11763233502eSmrg<parameter>led_class</parameter> and <parameter>led_id</parameter>
11770f8248bfSmrghas an indicator named
11780f8248bfSmrg<parameter>name</parameter>,
11793233502eSmrg<function>XkbGetNamedDeviceIndicator</function>
11800f8248bfSmrgreturns
11810f8248bfSmrg<symbol>True</symbol>
11820f8248bfSmrgand populates the rest of the parameters with information about the indicator.
11830f8248bfSmrgOtherwise,
11843233502eSmrg<function>XkbGetNamedDeviceIndicator</function>
11850f8248bfSmrgreturns
11860f8248bfSmrg<symbol>False</symbol>.
11870f8248bfSmrg</para>
11880f8248bfSmrg
11890f8248bfSmrg
11900f8248bfSmrg<para>
11910f8248bfSmrgThe
11920f8248bfSmrg<parameter>ndx_rtrn</parameter>
11930f8248bfSmrgfield returns the zero-based index of the named indicator. This index is the
1194e9fcaa8aSmrgbit position to use in any function call that requires a mask of indicator
11950f8248bfSmrgbits, as well as the indicator’s index into the
11960f8248bfSmrg<structname>XkbIndicatorRec</structname>
11970f8248bfSmrgarray of indicator maps.
11980f8248bfSmrg<parameter>state_rtrn</parameter>
11990f8248bfSmrgreturns the current state of the named indicator
12000f8248bfSmrg(<symbol>True</symbol>
12010f8248bfSmrg= on,
12020f8248bfSmrg<symbol>False</symbol>
12030f8248bfSmrg= off).
12040f8248bfSmrg<parameter>map_rtrn</parameter>
12050f8248bfSmrgreturns the indicator map for the named indicator. In addition, if the
12060f8248bfSmrgindicator is mapped to a physical LED, the
12070f8248bfSmrg<parameter>real_rtrn</parameter>
12080f8248bfSmrgparameter is set to
12090f8248bfSmrg<symbol>True</symbol>.
1210e9fcaa8aSmrg</para>
1211e9fcaa8aSmrg
1212e9fcaa8aSmrg
1213e9fcaa8aSmrg<para>
12140f8248bfSmrgEach of the "<parameter>_rtrn</parameter>" arguments is optional; you can pass
12150f8248bfSmrg<symbol>NULL</symbol>
12160f8248bfSmrgfor any unneeded "<parameter>_rtrn</parameter>" arguments.
1217e9fcaa8aSmrg</para>
1218e9fcaa8aSmrg
1219e9fcaa8aSmrg
1220e9fcaa8aSmrg<para>
12213233502eSmrg<function>XkbGetNamedDeviceIndicator</function>
12220f8248bfSmrgcan generate
12230f8248bfSmrg<errorname>BadAtom</errorname>
12240f8248bfSmrgand
12250f8248bfSmrg<errorname>BadImplementation</errorname>
12260f8248bfSmrgerrors.
1227e9fcaa8aSmrg</para>
1228e9fcaa8aSmrg
12293233502eSmrg<para>
12303233502eSmrgAs a convenience function, Xkb provides a function to get information about
12313233502eSmrgindicators with the default class and identifier on the default device:
12323233502eSmrg<function>XkbGetNamedIndicator</function>.
12333233502eSmrg</para>
12343233502eSmrg
12353233502eSmrg
12363233502eSmrg<indexterm significance="preferred" zone="XkbGetNamedIndicator"><primary><function>XkbGetNamedIndicator</function></primary></indexterm>
12373233502eSmrg<funcsynopsis id="XkbGetNamedIndicator">
12383233502eSmrg  <funcprototype>
12393233502eSmrg    <funcdef>Bool <function>XkbGetNamedIndicator</function></funcdef>
12403233502eSmrg    <paramdef>Display *<parameter>dpy</parameter></paramdef>
12413233502eSmrg    <paramdef>Atom <parameter>name</parameter></paramdef>
12423233502eSmrg    <paramdef>int *<parameter>ndx_rtrn</parameter></paramdef>
12433233502eSmrg    <paramdef>Bool *<parameter>state_rtrn</parameter></paramdef>
12443233502eSmrg    <paramdef>XkbIndicatorMapPtr <parameter>map_rtrn</parameter></paramdef>
12453233502eSmrg    <paramdef>Bool *<parameter>real_rtrn</parameter></paramdef>
12463233502eSmrg  </funcprototype>
12473233502eSmrg</funcsynopsis>
12483233502eSmrg<variablelist>
12493233502eSmrg  <varlistentry>
12503233502eSmrg    <term>
12513233502eSmrg      <parameter>dpy</parameter>
12523233502eSmrg    </term>
12533233502eSmrg    <listitem>
12543233502eSmrg      <para>
12553233502eSmrg        connection to the X server
12563233502eSmrg      </para>
12573233502eSmrg    </listitem>
12583233502eSmrg  </varlistentry>
12593233502eSmrg  <varlistentry>
12603233502eSmrg    <term>
12613233502eSmrg      <parameter>name</parameter>
12623233502eSmrg    </term>
12633233502eSmrg    <listitem>
12643233502eSmrg      <para>
12653233502eSmrg        name of the indicator to be retrieved
12663233502eSmrg      </para>
12673233502eSmrg    </listitem>
12683233502eSmrg  </varlistentry>
12693233502eSmrg  <varlistentry>
12703233502eSmrg    <term>
12713233502eSmrg      <parameter>ndx_rtrn</parameter>
12723233502eSmrg    </term>
12733233502eSmrg    <listitem>
12743233502eSmrg      <para>
12753233502eSmrg        backfilled with the index of the retrieved indicator
12763233502eSmrg      </para>
12773233502eSmrg    </listitem>
12783233502eSmrg  </varlistentry>
12793233502eSmrg  <varlistentry>
12803233502eSmrg    <term>
12813233502eSmrg      <parameter>state_rtrn</parameter>
12823233502eSmrg    </term>
12833233502eSmrg    <listitem>
12843233502eSmrg      <para>
12853233502eSmrg        backfilled with the current state of the retrieved indicator
12863233502eSmrg      </para>
12873233502eSmrg    </listitem>
12883233502eSmrg  </varlistentry>
12893233502eSmrg  <varlistentry>
12903233502eSmrg    <term>
12913233502eSmrg      <parameter>map_rtrn</parameter>
12923233502eSmrg    </term>
12933233502eSmrg    <listitem>
12943233502eSmrg      <para>
12953233502eSmrg        backfilled with the mapping for the retrieved indicator
12963233502eSmrg      </para>
12973233502eSmrg    </listitem>
12983233502eSmrg  </varlistentry>
12993233502eSmrg  <varlistentry>
13003233502eSmrg    <term>
13013233502eSmrg      <parameter>real_rtrn</parameter>
13023233502eSmrg    </term>
13033233502eSmrg    <listitem>
13043233502eSmrg      <para>
13053233502eSmrg        backfilled with <symbol>True</symbol>
13063233502eSmrg         if the named indicator is real (physical)
13073233502eSmrg      </para>
13083233502eSmrg    </listitem>
13093233502eSmrg  </varlistentry>
13103233502eSmrg</variablelist>
13113233502eSmrg
13123233502eSmrg<para>
13133233502eSmrg<function>XkbGetNamedIndicator</function>
13143233502eSmrgcalls
13153233502eSmrg<function>XkbGetNamedDeviceIndicator</function>
13163233502eSmrgwith the specified parameters, a
13173233502eSmrg<structfield>device_spec</structfield>
13183233502eSmrgof
13193233502eSmrg<symbol>XkbUseCoreKbd</symbol>,
13203233502eSmrga
13213233502eSmrg<structfield>led_class</structfield>
13223233502eSmrgof
13233233502eSmrg<symbol>XkbDfltXIClass</symbol>,
13243233502eSmrgand a
13253233502eSmrg<structfield>led_id</structfield>
13263233502eSmrgof
13273233502eSmrg<symbol>XkbDfltXIId</symbol>,
13283233502eSmrgand returns the value which was returned by
13293233502eSmrg<function>XkbGetNamedDeviceIndicator</function>.
13303233502eSmrg</para>
1331e9fcaa8aSmrg
1332e9fcaa8aSmrg</sect2>
1333e9fcaa8aSmrg</sect1>
1334eb411b4bSmrg<sect1 id='Changing_Indicator_Maps_and_State'>
1335e9fcaa8aSmrg<title>Changing Indicator Maps and State</title>
1336e9fcaa8aSmrg
1337e9fcaa8aSmrg<para>
1338e9fcaa8aSmrgJust as you can get the indicator map using a mask or using an indicator name,
1339e9fcaa8aSmrgso you can change it using a mask or a name.
1340e9fcaa8aSmrg</para>
1341e9fcaa8aSmrg
13420f8248bfSmrg<note><para>You cannot change the
13430f8248bfSmrg<structfield>phys_indicators</structfield>
13440f8248bfSmrgfield of the indicators structure. The only way to change the
13450f8248bfSmrg<structfield>phys_indicators</structfield>
13460f8248bfSmrgfield is to change the keyboard map.</para></note>
1347e9fcaa8aSmrg
1348e9fcaa8aSmrg<para>
1349e9fcaa8aSmrgThere are two ways to make changes to indicator maps and state: either change a
13500f8248bfSmrglocal copy of the indicator maps and use
13510f8248bfSmrg<function>XkbSetIndicatorMap</function>
13520f8248bfSmrgor
13533233502eSmrg<function>XkbSetNamedDeviceIndicator</function>,
13540f8248bfSmrgor, to reduce network traffic, use an
13550f8248bfSmrg<structname>XkbIndicatorChangesRec</structname>
13560f8248bfSmrgstructure and use
13570f8248bfSmrg<function>XkbChangeIndicators</function>.
1358e9fcaa8aSmrg</para>
1359e9fcaa8aSmrg
1360e9fcaa8aSmrg
1361eb411b4bSmrg<sect2 id='Effects_of_Explicit_Changes_on_Indicators'>
1362e9fcaa8aSmrg<title>Effects of Explicit Changes on Indicators</title>
1363e9fcaa8aSmrg
1364e9fcaa8aSmrg<para>
1365e9fcaa8aSmrgThis section discusses the effects of explicitly changing indicators depending
13660f8248bfSmrgupon different settings in the indicator map. See
13670f8248bfSmrg<link linkend="table8.3">Table 8.3</link> and
13680f8248bfSmrg<link linkend="table8.5">Table 8.5</link> for
1369e9fcaa8aSmrginformation on the effects of the indicator map fields when explicit changes
1370e9fcaa8aSmrgare made.
1371e9fcaa8aSmrg</para>
1372e9fcaa8aSmrg
1373e9fcaa8aSmrg
1374e9fcaa8aSmrg<para>
13750f8248bfSmrgIf
13760f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
13770f8248bfSmrgis set and
13780f8248bfSmrg<symbol>XkbIM_NoExplicit</symbol>
13790f8248bfSmrgis not, and if you call a function that updates the server’s image of the
13800f8248bfSmrgindicator map (such as
13810f8248bfSmrg<function>XkbSetIndicatorMap</function>
13820f8248bfSmrgor
13833233502eSmrg<function>XkbSetNamedDeviceIndicator</function>),
13840f8248bfSmrgXkb changes the keyboard state and controls to reflect the other fields of
1385e9fcaa8aSmrgthe indicator map. If you attempt to explicitly change the value of an
13860f8248bfSmrgindicator for which
13870f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
13880f8248bfSmrgis absent or for which
13890f8248bfSmrg<symbol>XkbIM_NoExplicit</symbol>
13900f8248bfSmrgis present, keyboard state or controls are unaffected.
1391e9fcaa8aSmrg</para>
1392e9fcaa8aSmrg
1393e9fcaa8aSmrg
1394e9fcaa8aSmrg<para>
13950f8248bfSmrgIf neither
13960f8248bfSmrg<symbol>XkbIM_NoAutomatic</symbol>
13970f8248bfSmrgnor
13980f8248bfSmrg<symbol>XkbIM_NoExplicit</symbol>
13990f8248bfSmrgis set in an indicator map, Xkb honors any request to change the state of the
1400e9fcaa8aSmrgindicator, but the new state might be immediately superseded by automatic
1401e9fcaa8aSmrgchanges to the indicator state if the keyboard state or controls change.
1402e9fcaa8aSmrg</para>
1403e9fcaa8aSmrg
1404e9fcaa8aSmrg
1405e9fcaa8aSmrg<para>
1406e9fcaa8aSmrgThe effects of changing an indicator that drives the keyboard are cumulative;
1407e9fcaa8aSmrgit is possible for a single change to affect keyboard group, modifiers, and
1408e9fcaa8aSmrgcontrols simultaneously.
1409e9fcaa8aSmrg</para>
1410e9fcaa8aSmrg
1411e9fcaa8aSmrg
1412e9fcaa8aSmrg<para>
14130f8248bfSmrgIf you change an indicator for which both the
14140f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
14150f8248bfSmrgand
14160f8248bfSmrg<symbol>XkbIM_NoAutomatic</symbol>
14170f8248bfSmrgflags are specified, Xkb applies the keyboard changes specified in the other
1418e9fcaa8aSmrgindicator map fields and changes the indicator to reflect the state that was
1419e9fcaa8aSmrgexplicitly requested. The indicator remains in the new state until it is
1420e9fcaa8aSmrgexplicitly changed again.
1421e9fcaa8aSmrg</para>
1422e9fcaa8aSmrg
1423e9fcaa8aSmrg
1424e9fcaa8aSmrg<para>
14250f8248bfSmrgIf the
14260f8248bfSmrg<symbol>XkbIM_NoAutomatic</symbol>
14270f8248bfSmrgflag is not set and
14280f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
14290f8248bfSmrgis set, Xkb applies the changes specified in the other indicator map fields
1430e9fcaa8aSmrgand sets the state of the indicator to the values specified by the indicator
1431e9fcaa8aSmrgmap. Note that it is possible in this case for the indicator to end up in a
1432e9fcaa8aSmrgdifferent state than the one that was explicitly requested. For example, Xkb
14330f8248bfSmrgdoes not extinguish an indicator with
14340f8248bfSmrg<structfield>which_mods</structfield>
14350f8248bfSmrgof
14360f8248bfSmrg<symbol>XkbIM_UseBase</symbol>
14370f8248bfSmrgand
14380f8248bfSmrg<structfield>mods</structfield>
14390f8248bfSmrgof
14400f8248bfSmrg<symbol>Shift</symbol>
14410f8248bfSmrgif, at the time Xkb processes the request to extinguish the indicator, one of
14420f8248bfSmrgthe
14430f8248bfSmrg<symbol>Shift</symbol>
14440f8248bfSmrgkeys is physically depressed.
1445e9fcaa8aSmrg</para>
1446e9fcaa8aSmrg
1447e9fcaa8aSmrg
1448e9fcaa8aSmrg<para>
14490f8248bfSmrgIf you explicitly light an indicator for which
14500f8248bfSmrg<symbol>XkbIM_LEDDrivesKB</symbol>
14510f8248bfSmrgis set, Xkb enables all of the boolean controls specified in the
14520f8248bfSmrg<structfield>ctrls</structfield>
14530f8248bfSmrgfield of its indicator map. Explicitly extinguishing such an indicator causes
14540f8248bfSmrgXkb to disable all of the boolean controls specified in
14550f8248bfSmrg<structfield>ctrls</structfield>.
1456e9fcaa8aSmrg</para>
1457e9fcaa8aSmrg
1458e9fcaa8aSmrg
1459e9fcaa8aSmrg</sect2>
1460eb411b4bSmrg<sect2 id='Changing_Indicator_Maps_by_Index'>
1461e9fcaa8aSmrg<title>Changing Indicator Maps by Index</title>
1462e9fcaa8aSmrg
1463e9fcaa8aSmrg<para>
1464e9fcaa8aSmrgTo update the maps for one or more indicators, first modify a local copy of the
14650f8248bfSmrgkeyboard description, then use
14660f8248bfSmrg<function>XkbSetIndicatorMap</function>
14670f8248bfSmrgto download the changes to the server:
14680f8248bfSmrg</para>
14690f8248bfSmrg
14700f8248bfSmrg<indexterm significance="preferred" zone="XkbSetIndicatorMap"><primary><function>XkbSetIndicatorMap</function></primary></indexterm>
14710f8248bfSmrg<funcsynopsis id="XkbSetIndicatorMap">
14720f8248bfSmrg  <funcprototype>
14730f8248bfSmrg    <funcdef>Bool <function>XkbSetIndicatorMap</function></funcdef>
14740f8248bfSmrg<!-- (
14750f8248bfSmrg<parameter>dpy</parameter>,
14760f8248bfSmrg<parameter>which</parameter>,
14770f8248bfSmrg<parameter>desc</parameter>
14780f8248bfSmrg) -->
14790f8248bfSmrg
14800f8248bfSmrg    <paramdef>Display *<parameter>dpy</parameter></paramdef>
14810f8248bfSmrg    <paramdef>unsigned int <parameter>which</parameter></paramdef>
14820f8248bfSmrg    <paramdef>XkbDescPtr <parameter>desc</parameter></paramdef>
14830f8248bfSmrg  </funcprototype>
14840f8248bfSmrg</funcsynopsis>
14850f8248bfSmrg<variablelist>
14860f8248bfSmrg  <varlistentry>
14870f8248bfSmrg    <term>
14880f8248bfSmrg      <parameter>dpy</parameter>
14890f8248bfSmrg    </term>
14900f8248bfSmrg    <listitem>
14910f8248bfSmrg      <para>
14920f8248bfSmrg        connection to the X server
14930f8248bfSmrg      </para>
14940f8248bfSmrg    </listitem>
14950f8248bfSmrg  </varlistentry>
14960f8248bfSmrg  <varlistentry>
14970f8248bfSmrg    <term>
14980f8248bfSmrg      <parameter>which</parameter>
14990f8248bfSmrg    </term>
15000f8248bfSmrg    <listitem>
15010f8248bfSmrg      <para>
15020f8248bfSmrg        mask of indicators to change
15030f8248bfSmrg      </para>
15040f8248bfSmrg    </listitem>
15050f8248bfSmrg  </varlistentry>
15060f8248bfSmrg  <varlistentry>
15070f8248bfSmrg    <term>
15080f8248bfSmrg      <parameter>desc</parameter>
15090f8248bfSmrg    </term>
15100f8248bfSmrg    <listitem>
15110f8248bfSmrg      <para>
15120f8248bfSmrg        keyboard description from which the maps are taken
15130f8248bfSmrg      </para>
15140f8248bfSmrg    </listitem>
15150f8248bfSmrg  </varlistentry>
15160f8248bfSmrg</variablelist>
15170f8248bfSmrg
15180f8248bfSmrg<para>
15190f8248bfSmrgFor each
15200f8248bfSmrgbit set in the
15210f8248bfSmrg<parameter>which</parameter>
15220f8248bfSmrgparameter,
15230f8248bfSmrg<function>XkbSetIndicatorMap</function>
15240f8248bfSmrgsends the corresponding indicator map from the
15250f8248bfSmrg<parameter>desc</parameter>
15260f8248bfSmrgparameter to the server.
1527e9fcaa8aSmrg</para>
1528e9fcaa8aSmrg
1529e9fcaa8aSmrg
1530e9fcaa8aSmrg</sect2>
1531eb411b4bSmrg<sect2 id='Changing_Indicator_Maps_by_Name'>
1532e9fcaa8aSmrg<title>Changing Indicator Maps by Name</title>
1533e9fcaa8aSmrg
1534e9fcaa8aSmrg<para>
15353233502eSmrg<function>XkbSetNamedDeviceIndicator</function> and
15360f8248bfSmrg<function>XkbSetNamedIndicator</function>
15370f8248bfSmrgcan do several related things:
1538e9fcaa8aSmrg</para>
1539e9fcaa8aSmrg
1540e9fcaa8aSmrg<itemizedlist>
1541e9fcaa8aSmrg<listitem>
1542e9fcaa8aSmrg  <para>
1543e9fcaa8aSmrgName an indicator if it is not already named
1544e9fcaa8aSmrg  </para>
1545e9fcaa8aSmrg</listitem>
1546e9fcaa8aSmrg<listitem>
1547e9fcaa8aSmrg  <para>
1548e9fcaa8aSmrgToggle the state of the indicator
1549e9fcaa8aSmrg  </para>
1550e9fcaa8aSmrg</listitem>
1551e9fcaa8aSmrg<listitem>
1552e9fcaa8aSmrg  <para>
1553e9fcaa8aSmrgSet the indicator to a specified state
1554e9fcaa8aSmrg  </para>
1555e9fcaa8aSmrg</listitem>
1556e9fcaa8aSmrg<listitem>
1557e9fcaa8aSmrg  <para>
1558e9fcaa8aSmrgSet the indicator map for the indicator
1559e9fcaa8aSmrg  </para>
1560e9fcaa8aSmrg</listitem>
1561e9fcaa8aSmrg</itemizedlist>
1562e9fcaa8aSmrg
15633233502eSmrg<indexterm significance="preferred" zone="XkbSetNamedDeviceIndicator"><primary><function>XkbSetNamedDeviceIndicator</function></primary></indexterm>
15643233502eSmrg<funcsynopsis id="XkbSetNamedDeviceIndicator">
15650f8248bfSmrg  <funcprototype>
15663233502eSmrg    <funcdef>Bool<function>XkbSetNamedDeviceIndicator</function></funcdef>
15670f8248bfSmrg<!-- (
15680f8248bfSmrg<parameter>dpy</parameter>,
15690f8248bfSmrg<parameter>device_spec</parameter>,
15700f8248bfSmrg<parameter>name</parameter>,
15710f8248bfSmrg<parameter>change_state, state</parameter>,
15720f8248bfSmrg<parameter>create_new</parameter>,
15730f8248bfSmrg<parameter>map</parameter>
15740f8248bfSmrg) -->
15750f8248bfSmrg
15760f8248bfSmrg    <paramdef>Display *<parameter>dpy</parameter></paramdef>
15770f8248bfSmrg    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
15783233502eSmrg    <paramdef>unsigned int <parameter>led_class</parameter></paramdef>
15793233502eSmrg    <paramdef>unsigned int <parameter>led_id</parameter></paramdef>
15800f8248bfSmrg    <paramdef>Atom <parameter>name</parameter></paramdef>
15810f8248bfSmrg    <paramdef>Bool <parameter>change_state</parameter></paramdef>
15820f8248bfSmrg    <paramdef>Bool <parameter>state</parameter></paramdef>
15830f8248bfSmrg    <paramdef>Bool <parameter>create_new</parameter></paramdef>
15840f8248bfSmrg    <paramdef>XkbIndicatorMapPtr <parameter>map</parameter></paramdef>
15850f8248bfSmrg  </funcprototype>
15860f8248bfSmrg</funcsynopsis>
15870f8248bfSmrg<variablelist>
15880f8248bfSmrg  <varlistentry>
15890f8248bfSmrg    <term>
15900f8248bfSmrg      <parameter>dpy</parameter>
15910f8248bfSmrg    </term>
15920f8248bfSmrg    <listitem>
15930f8248bfSmrg      <para>
15940f8248bfSmrg        connection to the X server
15950f8248bfSmrg      </para>
15960f8248bfSmrg    </listitem>
15970f8248bfSmrg  </varlistentry>
15980f8248bfSmrg  <varlistentry>
15990f8248bfSmrg    <term>
16000f8248bfSmrg      <parameter>device_spec</parameter>
16010f8248bfSmrg    </term>
16020f8248bfSmrg    <listitem>
16030f8248bfSmrg      <para>
16040f8248bfSmrg        device ID, or <symbol>XkbUseCoreKbd</symbol>
16050f8248bfSmrg      </para>
16060f8248bfSmrg    </listitem>
16070f8248bfSmrg  </varlistentry>
16083233502eSmrg  <varlistentry>
16093233502eSmrg    <term>
16103233502eSmrg      <parameter>led_class</parameter>
16113233502eSmrg    </term>
16123233502eSmrg    <listitem>
16133233502eSmrg      <para>
16143233502eSmrg        feedback class, or <symbol>XkbDfltXIClass</symbol>
16153233502eSmrg      </para>
16163233502eSmrg    </listitem>
16173233502eSmrg  </varlistentry>
16183233502eSmrg  <varlistentry>
16193233502eSmrg    <term>
16203233502eSmrg      <parameter>led_id</parameter>
16213233502eSmrg    </term>
16223233502eSmrg    <listitem>
16233233502eSmrg      <para>
16243233502eSmrg        feedback ID, or <symbol>XkbDfltXIId</symbol>
16253233502eSmrg      </para>
16263233502eSmrg    </listitem>
16273233502eSmrg  </varlistentry>
16280f8248bfSmrg  <varlistentry>
16290f8248bfSmrg    <term>
16300f8248bfSmrg      <parameter>name</parameter>
16310f8248bfSmrg    </term>
16320f8248bfSmrg    <listitem>
16330f8248bfSmrg      <para>
16340f8248bfSmrg        name of the indicator to change
16350f8248bfSmrg      </para>
16360f8248bfSmrg    </listitem>
16370f8248bfSmrg  </varlistentry>
16380f8248bfSmrg  <varlistentry>
16390f8248bfSmrg    <term>
16400f8248bfSmrg      <parameter>change_state</parameter>
16410f8248bfSmrg    </term>
16420f8248bfSmrg    <listitem>
16430f8248bfSmrg      <para>
16440f8248bfSmrg        whether to change the indicator state or not
16450f8248bfSmrg      </para>
16460f8248bfSmrg    </listitem>
16470f8248bfSmrg  </varlistentry>
16480f8248bfSmrg  <varlistentry>
16490f8248bfSmrg    <term>
16500f8248bfSmrg      <parameter>state</parameter>
16510f8248bfSmrg    </term>
16520f8248bfSmrg    <listitem>
16530f8248bfSmrg      <para>
16540f8248bfSmrg        desired new state for the indicator
16550f8248bfSmrg      </para>
16560f8248bfSmrg    </listitem>
16570f8248bfSmrg  </varlistentry>
16580f8248bfSmrg  <varlistentry>
16590f8248bfSmrg    <term>
16600f8248bfSmrg      <parameter>create_new</parameter>
16610f8248bfSmrg    </term>
16620f8248bfSmrg    <listitem>
16630f8248bfSmrg      <para>
16640f8248bfSmrg        whether a new indicator with the specified name should be
16650f8248bfSmrg        created when necessary
16660f8248bfSmrg      </para>
16670f8248bfSmrg    </listitem>
16680f8248bfSmrg  </varlistentry>
16690f8248bfSmrg  <varlistentry>
16700f8248bfSmrg    <term>
16710f8248bfSmrg      <parameter>map</parameter>
16720f8248bfSmrg    </term>
16730f8248bfSmrg    <listitem>
16740f8248bfSmrg      <para>
16750f8248bfSmrg        new map for the indicator
16760f8248bfSmrg      </para>
16770f8248bfSmrg    </listitem>
16780f8248bfSmrg  </varlistentry>
16790f8248bfSmrg</variablelist>
1680e9fcaa8aSmrg
1681e9fcaa8aSmrg<para>
1682e9fcaa8aSmrgIf a compatible version of the Xkb extension is not available in the server,
16833233502eSmrg<function>XkbSetNamedDeviceIndicator</function>
16840f8248bfSmrgreturns
16850f8248bfSmrg<symbol>False</symbol>.
16860f8248bfSmrgOtherwise, it sends a request to the X server to change the indicator
16870f8248bfSmrgspecified by
16880f8248bfSmrg<parameter>name</parameter>
16890f8248bfSmrgand returns
16900f8248bfSmrg<symbol>True</symbol>.
1691e9fcaa8aSmrg</para>
1692e9fcaa8aSmrg
1693e9fcaa8aSmrg
1694e9fcaa8aSmrg<para>
16950f8248bfSmrgIf
16960f8248bfSmrg<parameter>change_state</parameter>
16970f8248bfSmrgis
16980f8248bfSmrg<symbol>True</symbol>,
16993233502eSmrg<function>XkbSetNamedDeviceIndicator</function>
17000f8248bfSmrgtells the server to change the state of the named indicator to the value
17010f8248bfSmrgspecified by
17020f8248bfSmrg<parameter>state</parameter>.
17033233502eSmrgIf
17043233502eSmrg<parameter>change_state</parameter>
17053233502eSmrgis
17063233502eSmrg<symbol>False</symbol>,
17073233502eSmrg<parameter>state</parameter>
17083233502eSmrgis not used.
1709e9fcaa8aSmrg</para>
1710e9fcaa8aSmrg
1711e9fcaa8aSmrg
1712e9fcaa8aSmrg<para>
17130f8248bfSmrgIf an indicator with the name specified by
17140f8248bfSmrg<parameter>name</parameter>
17150f8248bfSmrgdoes not already exist, the
17160f8248bfSmrg<parameter>create_new</parameter>
17170f8248bfSmrgparameter tells the server whether it should create a new named indicator. If
17180f8248bfSmrg<parameter>create_new</parameter>
17190f8248bfSmrgis
17200f8248bfSmrg<symbol>True</symbol>,
17210f8248bfSmrgthe server finds the first indicator that doesn’t have a name and gives it
17220f8248bfSmrgthe name specified by
17230f8248bfSmrg<parameter>name</parameter>.
1724e9fcaa8aSmrg</para>
1725e9fcaa8aSmrg
1726e9fcaa8aSmrg
1727e9fcaa8aSmrg<para>
17280f8248bfSmrgIf the optional parameter,
17290f8248bfSmrg<parameter>map</parameter>,
17300f8248bfSmrgis not
17310f8248bfSmrg<symbol>NULL</symbol>,
17323233502eSmrg<function>XkbSetNamedDeviceIndicator</function>
17330f8248bfSmrgtells the server to change the indicator’s map to the values specified
17340f8248bfSmrgin <parameter>map</parameter>.
1735e9fcaa8aSmrg</para>
1736e9fcaa8aSmrg
1737e9fcaa8aSmrg<para>
17383233502eSmrg<function>XkbSetNamedDeviceIndicator</function>
17390f8248bfSmrgcan generate
17400f8248bfSmrg<errorname>BadAtom</errorname>
17410f8248bfSmrgand
17420f8248bfSmrg<errorname>BadImplementation</errorname>
17430f8248bfSmrgerrors. In addition, it can also generate
17440f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>
17450f8248bfSmrg(see <link linkend="Tracking_Changes_to_Indicator_State_or_Map">section 8.5</link>),
17460f8248bfSmrg<symbol>XkbIndicatorMapNotify</symbol>,
17470f8248bfSmrgand
17480f8248bfSmrg<symbol>XkbNamesNotify</symbol>
17490f8248bfSmrgevents (see <link linkend="Tracking_Name_Changes">section 18.5</link>).
1750e9fcaa8aSmrg</para>
1751e9fcaa8aSmrg
17523233502eSmrg<para>
17533233502eSmrgAs a convenience function, Xkb provides a function to set information about
17543233502eSmrgindicators with the default class and identifier on the default device:
17553233502eSmrg<function>XkbSetNamedIndicator</function>.
17563233502eSmrg</para>
17573233502eSmrg
17583233502eSmrg<indexterm significance="preferred" zone="XkbSetNamedIndicator"><primary><function>XkbSetNamedIndicator</function></primary></indexterm>
17593233502eSmrg<funcsynopsis id="XkbSetNamedIndicator">
17603233502eSmrg  <funcprototype>
17613233502eSmrg    <funcdef>Bool<function>XkbSetNamedIndicator</function></funcdef>
17623233502eSmrg    <paramdef>Display *<parameter>dpy</parameter></paramdef>
17633233502eSmrg    <paramdef>Atom <parameter>name</parameter></paramdef>
17643233502eSmrg    <paramdef>Bool <parameter>change_state</parameter></paramdef>
17653233502eSmrg    <paramdef>Bool <parameter>state</parameter></paramdef>
17663233502eSmrg    <paramdef>Bool <parameter>create_new</parameter></paramdef>
17673233502eSmrg    <paramdef>XkbIndicatorMapPtr <parameter>map</parameter></paramdef>
17683233502eSmrg  </funcprototype>
17693233502eSmrg</funcsynopsis>
17703233502eSmrg<variablelist>
17713233502eSmrg  <varlistentry>
17723233502eSmrg    <term>
17733233502eSmrg      <parameter>dpy</parameter>
17743233502eSmrg    </term>
17753233502eSmrg    <listitem>
17763233502eSmrg      <para>
17773233502eSmrg        connection to the X server
17783233502eSmrg      </para>
17793233502eSmrg    </listitem>
17803233502eSmrg  </varlistentry>
17813233502eSmrg  <varlistentry>
17823233502eSmrg    <term>
17833233502eSmrg      <parameter>name</parameter>
17843233502eSmrg    </term>
17853233502eSmrg    <listitem>
17863233502eSmrg      <para>
17873233502eSmrg        name of the indicator to change
17883233502eSmrg      </para>
17893233502eSmrg    </listitem>
17903233502eSmrg  </varlistentry>
17913233502eSmrg  <varlistentry>
17923233502eSmrg    <term>
17933233502eSmrg      <parameter>change_state</parameter>
17943233502eSmrg    </term>
17953233502eSmrg    <listitem>
17963233502eSmrg      <para>
17973233502eSmrg        whether to change the indicator state or not
17983233502eSmrg      </para>
17993233502eSmrg    </listitem>
18003233502eSmrg  </varlistentry>
18013233502eSmrg  <varlistentry>
18023233502eSmrg    <term>
18033233502eSmrg      <parameter>state</parameter>
18043233502eSmrg    </term>
18053233502eSmrg    <listitem>
18063233502eSmrg      <para>
18073233502eSmrg        desired new state for the indicator
18083233502eSmrg      </para>
18093233502eSmrg    </listitem>
18103233502eSmrg  </varlistentry>
18113233502eSmrg  <varlistentry>
18123233502eSmrg    <term>
18133233502eSmrg      <parameter>create_new</parameter>
18143233502eSmrg    </term>
18153233502eSmrg    <listitem>
18163233502eSmrg      <para>
18173233502eSmrg        whether a new indicator with the specified name should be
18183233502eSmrg        created when necessary
18193233502eSmrg      </para>
18203233502eSmrg    </listitem>
18213233502eSmrg  </varlistentry>
18223233502eSmrg  <varlistentry>
18233233502eSmrg    <term>
18243233502eSmrg      <parameter>map</parameter>
18253233502eSmrg    </term>
18263233502eSmrg    <listitem>
18273233502eSmrg      <para>
18283233502eSmrg        new map for the indicator
18293233502eSmrg      </para>
18303233502eSmrg    </listitem>
18313233502eSmrg  </varlistentry>
18323233502eSmrg</variablelist>
18333233502eSmrg
18343233502eSmrg<para>
18353233502eSmrg<function>XkbSetNamedIndicator</function>
18363233502eSmrgcalls
18373233502eSmrg<function>XkbSetNamedDeviceIndicator</function>
18383233502eSmrgwith the specified parameters, a
18393233502eSmrg<structfield>device_spec</structfield>
18403233502eSmrgof
18413233502eSmrg<symbol>XkbUseCoreKbd</symbol>,
18423233502eSmrga
18433233502eSmrg<structfield>led_class</structfield>
18443233502eSmrgof
18453233502eSmrg<symbol>XkbDfltXIClass</symbol>,
18463233502eSmrgand a
18473233502eSmrg<structfield>led_id</structfield>
18483233502eSmrgof
18493233502eSmrg<symbol>XkbDfltXIId</symbol>,
18503233502eSmrgand returns the value which was returned by
18513233502eSmrg<function>XkbSetNamedDeviceIndicator</function>.
18523233502eSmrg</para>
1853e9fcaa8aSmrg
1854e9fcaa8aSmrg</sect2>
18550f8248bfSmrg<sect2 id='XkbIndicatorChangesRec'>
1856e9fcaa8aSmrg<title>The XkbIndicatorChangesRec Structure</title>
1857e9fcaa8aSmrg
18580f8248bfSmrg<indexterm significance="preferred" zone="XkbIndicatorChangesRec">
18590f8248bfSmrg<primary><structname>XkbIndicatorChangesRec</structname></primary></indexterm>
18600f8248bfSmrg
1861e9fcaa8aSmrg<para>
18620f8248bfSmrgThe
18630f8248bfSmrg<structname>XkbIndicatorChangesRec</structname>
18640f8248bfSmrgidentifies small modifications to the indicator map. Use it with the function
18650f8248bfSmrg<function>XkbChangeIndicators</function>
18660f8248bfSmrgto reduce the amount of traffic sent to the server.
1867e9fcaa8aSmrg</para>
1868e9fcaa8aSmrg
1869e9fcaa8aSmrg<para><programlisting>
1870e9fcaa8aSmrgtypedef struct _XkbIndicatorChanges {
18710f8248bfSmrg    unsigned int             state_changes;
18720f8248bfSmrg    unsigned int             map_changes;
18730f8248bfSmrg} <structname>XkbIndicatorChangesRec</structname>,*XkbIndicatorChangesPtr;
1874e9fcaa8aSmrg</programlisting></para>
1875e9fcaa8aSmrg
1876e9fcaa8aSmrg<para>
18770f8248bfSmrgThe
18780f8248bfSmrg<structfield>state_changes</structfield>
18790f8248bfSmrgfield is a mask that specifies the indicators that have changed state, and
18800f8248bfSmrg<structfield>map_changes</structfield>
18810f8248bfSmrgis a mask that specifies the indicators whose maps have changed.
1882e9fcaa8aSmrg</para>
1883e9fcaa8aSmrg
1884e9fcaa8aSmrg
1885e9fcaa8aSmrg<para>
1886e9fcaa8aSmrgTo change indicator maps or state without passing the entire keyboard
18870f8248bfSmrgdescription, use
18880f8248bfSmrg<function>XkbChangeIndicators</function>.
18890f8248bfSmrg</para>
18900f8248bfSmrg
18910f8248bfSmrg<indexterm significance="preferred" zone="XkbChangeIndicators"><primary><function>XkbChangeIndicators</function></primary></indexterm>
18920f8248bfSmrg<funcsynopsis id="XkbChangeIndicators">
18930f8248bfSmrg  <funcprototype>
18940f8248bfSmrg    <funcdef>Bool <function>XkbChangeIndicators</function></funcdef>
18950f8248bfSmrg<!-- (
18960f8248bfSmrg<parameter>dpy, xkb, changes, state</parameter>
18970f8248bfSmrg) -->
18980f8248bfSmrg
18990f8248bfSmrg    <paramdef>Display *<parameter>dpy</parameter></paramdef>
19000f8248bfSmrg    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
19010f8248bfSmrg    <paramdef>XkbIndicatorChangesPtr <parameter>changes</parameter></paramdef>
19020f8248bfSmrg    <paramdef>unsigned int <parameter>state</parameter></paramdef>
19030f8248bfSmrg  </funcprototype>
19040f8248bfSmrg</funcsynopsis>
19050f8248bfSmrg<variablelist>
19060f8248bfSmrg  <varlistentry>
19070f8248bfSmrg    <term>
19080f8248bfSmrg      <parameter>dpy</parameter>
19090f8248bfSmrg    </term>
19100f8248bfSmrg    <listitem>
19110f8248bfSmrg      <para>
19120f8248bfSmrg        connection to the X server
19130f8248bfSmrg      </para>
19140f8248bfSmrg    </listitem>
19150f8248bfSmrg  </varlistentry>
19160f8248bfSmrg  <varlistentry>
19170f8248bfSmrg    <term>
19180f8248bfSmrg      <parameter>xkb</parameter>
19190f8248bfSmrg    </term>
19200f8248bfSmrg    <listitem>
19210f8248bfSmrg      <para>
19220f8248bfSmrg        keyboard description from which names are to be  taken.
19230f8248bfSmrg      </para>
19240f8248bfSmrg    </listitem>
19250f8248bfSmrg  </varlistentry>
19260f8248bfSmrg  <varlistentry>
19270f8248bfSmrg    <term>
19280f8248bfSmrg      <parameter>changes</parameter>
19290f8248bfSmrg    </term>
19300f8248bfSmrg    <listitem>
19310f8248bfSmrg      <para>
19320f8248bfSmrg        indicators to be updated on the server
19330f8248bfSmrg      </para>
19340f8248bfSmrg    </listitem>
19350f8248bfSmrg  </varlistentry>
19360f8248bfSmrg  <varlistentry>
19370f8248bfSmrg    <term>
19380f8248bfSmrg      <parameter>state</parameter>
19390f8248bfSmrg    </term>
19400f8248bfSmrg    <listitem>
19410f8248bfSmrg      <para>
19420f8248bfSmrg        new state of indicators listed in <parameter>changes</parameter>-&gt;<structfield>state_changes</structfield>
19430f8248bfSmrg      </para>
19440f8248bfSmrg    </listitem>
19450f8248bfSmrg  </varlistentry>
19460f8248bfSmrg</variablelist>
19470f8248bfSmrg
19480f8248bfSmrg<para>
19490f8248bfSmrg<function>XkbChangeIndicators</function>
19500f8248bfSmrgcopies any maps specified by
19510f8248bfSmrg<parameter>changes</parameter>
19520f8248bfSmrgfrom the keyboard description,
19530f8248bfSmrg<parameter>xkb</parameter>,
19540f8248bfSmrgto the server specified by
19550f8248bfSmrg<parameter>dpy</parameter>.
19560f8248bfSmrgIf any bits are set in the
19570f8248bfSmrg<structfield>state_changes</structfield>
19580f8248bfSmrgfield of
19590f8248bfSmrg<parameter>changes</parameter>,
19600f8248bfSmrg<function>XkbChangeIndicators</function>
19610f8248bfSmrgalso sets the state of those indicators to the values specified in the
19620f8248bfSmrg<parameter>state</parameter>
19630f8248bfSmrgmask. A 1 bit in
19640f8248bfSmrg<parameter>state</parameter>
19650f8248bfSmrgturns the corresponding indicator on, a 0 bit turns it off.
19660f8248bfSmrg</para>
19670f8248bfSmrg
19680f8248bfSmrg
19690f8248bfSmrg<para>
19700f8248bfSmrg<function>XkbChangeIndicators</function>
19710f8248bfSmrgcan generate
19720f8248bfSmrg<errorname>BadAtom</errorname>
19730f8248bfSmrgand
19740f8248bfSmrg<errorname>BadImplementation</errorname>
19750f8248bfSmrgerrors. In addition, it can also generate
19760f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>
19770f8248bfSmrgand
19780f8248bfSmrg<symbol>XkbIndicatorMapNotify</symbol>
19790f8248bfSmrgevents (see <link linkend="Tracking_Changes_to_Indicator_State_or_Map">section 8.5</link>).
1980e9fcaa8aSmrg</para>
1981e9fcaa8aSmrg
1982e9fcaa8aSmrg
1983e9fcaa8aSmrg</sect2>
1984e9fcaa8aSmrg</sect1>
1985eb411b4bSmrg<sect1 id='Tracking_Changes_to_Indicator_State_or_Map'>
1986e9fcaa8aSmrg<title>Tracking Changes to Indicator State or Map</title>
1987e9fcaa8aSmrg
19880f8248bfSmrg<indexterm significance="preferred" zone="Tracking_Changes_to_Indicator_State_or_Map">
19890f8248bfSmrg<primary>events</primary><secondary><symbol>XkbIndicatorStateNotify</symbol></secondary></indexterm>
19900f8248bfSmrg<indexterm significance="preferred" zone="Tracking_Changes_to_Indicator_State_or_Map">
19910f8248bfSmrg<primary><structname>XkbIndicatorStateNotifyEvent</structname></primary></indexterm>
19920f8248bfSmrg
19930f8248bfSmrg<indexterm significance="preferred" zone="Tracking_Changes_to_Indicator_State_or_Map">
19940f8248bfSmrg<primary>events</primary><secondary><symbol>XkbIndicatorMapNotify</symbol></secondary></indexterm>
19950f8248bfSmrg<indexterm significance="preferred" zone="Tracking_Changes_to_Indicator_State_or_Map">
19960f8248bfSmrg<primary><structname>XkbIndicatorMapNotifyEvent</structname></primary></indexterm>
19970f8248bfSmrg
19980f8248bfSmrg<para>
19990f8248bfSmrgWhenever an indicator changes state, the server sends
20000f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>
20010f8248bfSmrgevents to all interested clients. Similarly, whenever an indicator’s map
20020f8248bfSmrgchanges, the server sends
20030f8248bfSmrg<symbol>XkbIndicatorMapNotify</symbol>
20040f8248bfSmrgevents to all interested clients.
20050f8248bfSmrg</para>
20060f8248bfSmrg
20070f8248bfSmrg
20080f8248bfSmrg<para>
20090f8248bfSmrgTo receive
20100f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>
20110f8248bfSmrgevents, use
20120f8248bfSmrg<function>XkbSelectEvents</function>
20130f8248bfSmrg(see <link linkend="Selecting_Xkb_Events">section 4.3</link>) with both the
20140f8248bfSmrg<parameter>bits_to_change</parameter>
20150f8248bfSmrgand
20160f8248bfSmrg<parameter>values_for_bits</parameter>
20170f8248bfSmrgparameters containing
20180f8248bfSmrg<symbol>XkbIndicatorStateNotifyMask</symbol>.
20190f8248bfSmrgTo receive
20200f8248bfSmrg<symbol>XkbIndicatorMapNotify</symbol>
20210f8248bfSmrgevents, use
20220f8248bfSmrg<function>XkbSelectEvents</function>
20230f8248bfSmrgwith
20240f8248bfSmrg<symbol>XkbIndicatorMapNotifyMask</symbol>.
20250f8248bfSmrg</para>
20260f8248bfSmrg
20270f8248bfSmrg
20280f8248bfSmrg<para>
20290f8248bfSmrgTo receive events for only specific indicators, use
20300f8248bfSmrg<function>XkbSelectEventDetails</function>.
20310f8248bfSmrgSet the
20320f8248bfSmrg<structfield>event_type</structfield>
20330f8248bfSmrgparameter to
20340f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>
20350f8248bfSmrgor
20360f8248bfSmrg<symbol>XkbIndicatorMapNotify</symbol>,
20370f8248bfSmrgand set both the
20380f8248bfSmrg<parameter>bits_to_change</parameter>
20390f8248bfSmrgand
20400f8248bfSmrg<parameter>values_for_bits</parameter>
20410f8248bfSmrgdetail parameters to a mask where each bit specifies one indicator, turning on
2042e9fcaa8aSmrgthose bits that specify the indicators for which you want to receive events.
2043e9fcaa8aSmrg</para>
2044e9fcaa8aSmrg
2045e9fcaa8aSmrg
2046e9fcaa8aSmrg<para>
2047e9fcaa8aSmrgBoth types of indicator events use the same structure:
2048e9fcaa8aSmrg
20490f8248bfSmrg<programlisting>
2050e9fcaa8aSmrgtypedef struct _XkbIndicatorNotify {
20510f8248bfSmrg    int            type;        /* Xkb extension base event code */
20520f8248bfSmrg    unsigned long  serial;      /* X server serial number for event */
20530f8248bfSmrg    Bool           send_event;  /* <symbol>True</symbol> &rArr; synthetically generated */
20540f8248bfSmrg    Display *      display;     /* server connection where event generated */
20550f8248bfSmrg    Time           time;        /* server time when event generated */
20560f8248bfSmrg    int            xkb_type;    /* specifies state or map notify */
20570f8248bfSmrg    int            device;      /* Xkb device ID, will not be <symbol>XkbUseCoreKbd</symbol> */
20580f8248bfSmrg    unsigned int   changed;     /* mask of indicators with new state or map */
20590f8248bfSmrg    unsigned int   state;       /* current state of all indicators */
20600f8248bfSmrg} <structname>XkbIndicatorNotifyEvent</structname>;
2061e9fcaa8aSmrg</programlisting></para>
2062e9fcaa8aSmrg
2063e9fcaa8aSmrg<para>
20640f8248bfSmrg<structfield>xkb_type</structfield>
20650f8248bfSmrgis either
20660f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>
20670f8248bfSmrgor
20680f8248bfSmrg<symbol>XkbIndicatorMapNotify</symbol>,
20690f8248bfSmrgdepending on whether the event is a
20700f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>
20710f8248bfSmrgevent or
20720f8248bfSmrg<symbol>XkbIndicatorMapNotify</symbol>,
20730f8248bfSmrgevent.
20740f8248bfSmrg</para>
20750f8248bfSmrg
20760f8248bfSmrg<para>
20770f8248bfSmrgThe
20780f8248bfSmrg<structfield>changed</structfield>
20790f8248bfSmrgparameter is a mask that is the bitwise inclusive OR of the indicators that
20800f8248bfSmrghave changed. If the event is of type
20810f8248bfSmrg<symbol>XkbIndicatorMapNotify</symbol>,
20820f8248bfSmrg<structfield>changed</structfield>
20830f8248bfSmrgreports the maps that changed. If the event is of type
20840f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>,
20850f8248bfSmrg<structfield>changed</structfield>
20860f8248bfSmrgreports the indicators that have changed state.
20870f8248bfSmrg<parameter>state</parameter>
20880f8248bfSmrgis a mask that specifies the current state of all indicators, whether they
20890f8248bfSmrghave changed or not, for both
20900f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>
20910f8248bfSmrgand <symbol>XkbIndicatorMapNotify</symbol> events.
20920f8248bfSmrg</para>
20930f8248bfSmrg
20940f8248bfSmrg<para>
20950f8248bfSmrgWhen your client application receives either a
20960f8248bfSmrg<symbol>XkbIndicatorStateNotify</symbol>
20970f8248bfSmrgevent or
20980f8248bfSmrg<symbol>XkbIndicatorMapNotify</symbol>
20990f8248bfSmrgevent, you can note the changes in a changes structure by calling
21000f8248bfSmrg<function>XkbNoteIndicatorChanges</function>.
21010f8248bfSmrg</para>
21020f8248bfSmrg
21030f8248bfSmrg<indexterm significance="preferred" zone="XkbNoteIndicatorChanges"><primary><function>XkbNoteIndicatorChanges</function></primary></indexterm>
21040f8248bfSmrg<funcsynopsis id="XkbNoteIndicatorChanges">
21050f8248bfSmrg  <funcprototype>
21060f8248bfSmrg    <funcdef>void <function>XkbNoteIndicatorChanges</function></funcdef>
21070f8248bfSmrg<!-- (
21080f8248bfSmrg<parameter>old</parameter>,
21090f8248bfSmrg<parameter>new</parameter>,
21100f8248bfSmrg<parameter>wanted</parameter>
21110f8248bfSmrg) -->
21120f8248bfSmrg
21130f8248bfSmrg    <paramdef>XkbIndicatorChangesPtr <parameter>old</parameter></paramdef>
21140f8248bfSmrg    <paramdef>XkbIndicatorNotifyEvent *<parameter>new</parameter></paramdef>
21150f8248bfSmrg    <paramdef>unsigned int <parameter>wanted</parameter></paramdef>
21160f8248bfSmrg  </funcprototype>
21170f8248bfSmrg</funcsynopsis>
21180f8248bfSmrg<variablelist>
21190f8248bfSmrg  <varlistentry>
21200f8248bfSmrg    <term>
21210f8248bfSmrg      <parameter>old</parameter>
21220f8248bfSmrg    </term>
21230f8248bfSmrg    <listitem>
21240f8248bfSmrg      <para>
21250f8248bfSmrg        XkbIndicatorChanges structure to be updated
21260f8248bfSmrg      </para>
21270f8248bfSmrg    </listitem>
21280f8248bfSmrg  </varlistentry>
21290f8248bfSmrg  <varlistentry>
21300f8248bfSmrg    <term>
21310f8248bfSmrg      <parameter>new</parameter>
21320f8248bfSmrg    </term>
21330f8248bfSmrg    <listitem>
21340f8248bfSmrg      <para>
21350f8248bfSmrg        event from which changes are to be copied
21360f8248bfSmrg      </para>
21370f8248bfSmrg    </listitem>
21380f8248bfSmrg  </varlistentry>
21390f8248bfSmrg  <varlistentry>
21400f8248bfSmrg    <term>
21410f8248bfSmrg      <parameter>wanted</parameter>
21420f8248bfSmrg    </term>
21430f8248bfSmrg    <listitem>
21440f8248bfSmrg      <para>
21450f8248bfSmrg        which changes are to be noted
21460f8248bfSmrg      </para>
21470f8248bfSmrg    </listitem>
21480f8248bfSmrg  </varlistentry>
21490f8248bfSmrg</variablelist>
21500f8248bfSmrg
21510f8248bfSmrg<para>
21520f8248bfSmrgThe
21530f8248bfSmrg<parameter>wanted</parameter>
21540f8248bfSmrgparameter is the bitwise inclusive OR of
21550f8248bfSmrg<symbol>XkbIndicatorMapMask</symbol>
21560f8248bfSmrgand
21570f8248bfSmrg<emphasis>XkbIndicatorStateMask</emphasis>.
21580f8248bfSmrg<function>XkbNoteIndicatorChanges</function>
21590f8248bfSmrgcopies any changes reported in
21600f8248bfSmrg<parameter>new</parameter>
21610f8248bfSmrgand specified in
21620f8248bfSmrg<parameter>wanted</parameter>
21630f8248bfSmrginto the changes record specified by
21640f8248bfSmrg<parameter>old</parameter>.
2165e9fcaa8aSmrg</para>
2166e9fcaa8aSmrg
2167e9fcaa8aSmrg
2168e9fcaa8aSmrg<para>
2169e9fcaa8aSmrgTo update a local copy of the keyboard description with the actual values, pass
21700f8248bfSmrgthe results of one or more calls to
21710f8248bfSmrg<function>XkbNoteIndicatorChanges</function>
21720f8248bfSmrgto
21730f8248bfSmrg<function>XkbGetIndicatorChanges</function>:
21740f8248bfSmrg</para>
21750f8248bfSmrg
21760f8248bfSmrg
21770f8248bfSmrg<indexterm significance="preferred" zone="XkbGetIndicatorChanges"><primary><function>XkbGetIndicatorChanges</function></primary></indexterm>
21780f8248bfSmrg<funcsynopsis id="XkbGetIndicatorChanges">
21790f8248bfSmrg  <funcprototype>
21800f8248bfSmrg    <funcdef>Status <function>XkbGetIndicatorChanges</function></funcdef>
21810f8248bfSmrg<!-- (
21820f8248bfSmrg<parameter>dpy</parameter>,
21830f8248bfSmrg<parameter>xkb</parameter>,
21840f8248bfSmrg<parameter>changes</parameter>,
21850f8248bfSmrg<parameter>state</parameter>
21860f8248bfSmrg) -->
21870f8248bfSmrg
21880f8248bfSmrg    <paramdef>Display *<parameter>dpy</parameter></paramdef>
21890f8248bfSmrg    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
21900f8248bfSmrg    <paramdef>XkbIndicatorChangesPtr <parameter>changes</parameter></paramdef>
21910f8248bfSmrg    <paramdef>unsigned int *<parameter>state</parameter></paramdef>
21920f8248bfSmrg  </funcprototype>
21930f8248bfSmrg</funcsynopsis>
21940f8248bfSmrg<variablelist>
21950f8248bfSmrg  <varlistentry>
21960f8248bfSmrg    <term>
21970f8248bfSmrg      <parameter>dpy</parameter>
21980f8248bfSmrg    </term>
21990f8248bfSmrg    <listitem>
22000f8248bfSmrg      <para>
22010f8248bfSmrg        connection to the X server
22020f8248bfSmrg      </para>
22030f8248bfSmrg    </listitem>
22040f8248bfSmrg  </varlistentry>
22050f8248bfSmrg  <varlistentry>
22060f8248bfSmrg    <term>
22070f8248bfSmrg      <parameter>xkb</parameter>
22080f8248bfSmrg    </term>
22090f8248bfSmrg    <listitem>
22100f8248bfSmrg      <para>
22110f8248bfSmrg        keyboard description to hold the new values
22120f8248bfSmrg      </para>
22130f8248bfSmrg    </listitem>
22140f8248bfSmrg  </varlistentry>
22150f8248bfSmrg  <varlistentry>
22160f8248bfSmrg    <term>
22170f8248bfSmrg      <parameter>changes</parameter>
22180f8248bfSmrg    </term>
22190f8248bfSmrg    <listitem>
22200f8248bfSmrg      <para>
22210f8248bfSmrg        indicator maps/state to be obtained from the server
22220f8248bfSmrg      </para>
22230f8248bfSmrg    </listitem>
22240f8248bfSmrg  </varlistentry>
22250f8248bfSmrg  <varlistentry>
22260f8248bfSmrg    <term>
22270f8248bfSmrg      <parameter>state</parameter>
22280f8248bfSmrg    </term>
22290f8248bfSmrg    <listitem>
22300f8248bfSmrg      <para>
22310f8248bfSmrg        backfilled with the state of the indicators
22320f8248bfSmrg      </para>
22330f8248bfSmrg    </listitem>
22340f8248bfSmrg  </varlistentry>
22350f8248bfSmrg</variablelist>
22360f8248bfSmrg
22370f8248bfSmrg<para>
22380f8248bfSmrg<function>XkbGetIndicatorChanges</function>
22390f8248bfSmrgexamines the
22400f8248bfSmrg<parameter>changes</parameter>
22410f8248bfSmrgparameter, pulls over the necessary information from the server, and copies
22420f8248bfSmrgthe results into the
22430f8248bfSmrg<parameter>xkb</parameter>
22440f8248bfSmrgkeyboard description. If any bits are set in the
22450f8248bfSmrg<structfield>state_changes</structfield>
22460f8248bfSmrgfield of
22470f8248bfSmrg<parameter>changes</parameter>,
22480f8248bfSmrg<function>XkbGetIndicatorChanges</function>
22490f8248bfSmrgalso places the state of those indicators in
22500f8248bfSmrg<parameter>state</parameter>.
22510f8248bfSmrgIf the
22520f8248bfSmrg<structfield>indicators</structfield>
22530f8248bfSmrgfield of
22540f8248bfSmrg<parameter>xkb</parameter>
22550f8248bfSmrgis
22560f8248bfSmrg<symbol>NULL</symbol>,
22570f8248bfSmrg<function>XkbGetIndicatorChanges</function>
22580f8248bfSmrgallocates and initializes it. To free the
22590f8248bfSmrg<structfield>indicators</structfield>
22600f8248bfSmrgfield, use
22610f8248bfSmrg<function>XkbFreeIndicatorMaps</function>
22620f8248bfSmrg(see <link linkend="Allocating_and_Freeing_Indicator_Maps">section 8.6</link>).
22630f8248bfSmrg</para>
22640f8248bfSmrg
22650f8248bfSmrg
22660f8248bfSmrg<para>
22670f8248bfSmrg<function>XkbGetIndicatorChanges</function>
22680f8248bfSmrgcan generate
22690f8248bfSmrg<errorname>BadAlloc</errorname>,
22700f8248bfSmrg<errorname>BadImplementation</errorname>,
22710f8248bfSmrgand
22720f8248bfSmrg<errorname>BadMatch</errorname>
22730f8248bfSmrgerrors.
2274e9fcaa8aSmrg</para>
2275e9fcaa8aSmrg
2276e9fcaa8aSmrg
2277e9fcaa8aSmrg</sect1>
2278eb411b4bSmrg<sect1 id='Allocating_and_Freeing_Indicator_Maps'>
2279e9fcaa8aSmrg<title>Allocating and Freeing Indicator Maps</title>
2280e9fcaa8aSmrg
2281e9fcaa8aSmrg<para>
22820f8248bfSmrgMost applications do not need to directly allocate the
22830f8248bfSmrg<structfield>indicators</structfield>
22840f8248bfSmrgmember of the keyboard description record (the keyboard description record is
22850f8248bfSmrgdescribed in <xref linkend="Complete_Keyboard_Description" />). If the need arises, however, use
22860f8248bfSmrg<function>XkbAllocIndicatorMaps</function>.
22870f8248bfSmrg</para>
22880f8248bfSmrg
22890f8248bfSmrg<indexterm significance="preferred" zone="XkbAllocIndicatorMaps"><primary><function>XkbAllocIndicatorMaps</function></primary></indexterm>
22900f8248bfSmrg<funcsynopsis id="XkbAllocIndicatorMaps">
22910f8248bfSmrg  <funcprototype>
22920f8248bfSmrg    <funcdef>Status <function>XkbAllocIndicatorMaps</function></funcdef>
22930f8248bfSmrg<!-- (
22940f8248bfSmrg<parameter>xkb</parameter>
22950f8248bfSmrg) -->
22960f8248bfSmrg
22970f8248bfSmrg    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
22980f8248bfSmrg  </funcprototype>
22990f8248bfSmrg</funcsynopsis>
23000f8248bfSmrg<variablelist>
23010f8248bfSmrg  <varlistentry>
23020f8248bfSmrg    <term>
23030f8248bfSmrg      <parameter>xkb</parameter>
23040f8248bfSmrg    </term>
23050f8248bfSmrg    <listitem>
23060f8248bfSmrg      <para>
23070f8248bfSmrg        keyboard description structure
23080f8248bfSmrg      </para>
23090f8248bfSmrg    </listitem>
23100f8248bfSmrg  </varlistentry>
23110f8248bfSmrg</variablelist>
23120f8248bfSmrg
23130f8248bfSmrg<para>
23140f8248bfSmrgThe
23150f8248bfSmrg<parameter>xkb</parameter>
23160f8248bfSmrgparameter must point to a valid keyboard description. If it doesn’t,
23170f8248bfSmrg<function>XkbAllocIndicatorMaps</function>
23180f8248bfSmrgreturns a
23190f8248bfSmrg<errorname>BadMatch</errorname>
23200f8248bfSmrgerror. Otherwise,
23210f8248bfSmrg<function>XkbAllocIndicatorMaps</function>
23220f8248bfSmrgallocates and initializes the
23230f8248bfSmrg<structfield>indicators</structfield>
23240f8248bfSmrgmember of the keyboard description record and returns
23250f8248bfSmrg<symbol>Success</symbol>.
23260f8248bfSmrgIf
23270f8248bfSmrg<function>XkbAllocIndicatorMaps</function>
23280f8248bfSmrgwas unable to allocate the indicators record, it reports a
23290f8248bfSmrg<errorname>BadAlloc</errorname>
23300f8248bfSmrgerror.
23310f8248bfSmrg</para>
23320f8248bfSmrg
23330f8248bfSmrg<para>
23340f8248bfSmrgTo free memory used by the
23350f8248bfSmrg<structfield>indicators</structfield>
23360f8248bfSmrgmember of an
23370f8248bfSmrg<structname>XkbDescRec</structname>
23380f8248bfSmrgstructure, use
23390f8248bfSmrg<function>XkbFreeIndicatorMaps</function>.
23400f8248bfSmrg</para>
23410f8248bfSmrg
23420f8248bfSmrg<indexterm significance="preferred" zone="XkbFreeIndicatorMaps"><primary><function>XkbFreeIndicatorMaps</function></primary></indexterm>
23430f8248bfSmrg<funcsynopsis id="XkbFreeIndicatorMaps">
23440f8248bfSmrg  <funcprototype>
23450f8248bfSmrg    <funcdef>void <function>XkbFreeIndicatorMaps</function></funcdef>
23460f8248bfSmrg<!-- (
23470f8248bfSmrg<parameter>xkb</parameter>
23480f8248bfSmrg) -->
23490f8248bfSmrg
23500f8248bfSmrg    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
23510f8248bfSmrg  </funcprototype>
23520f8248bfSmrg</funcsynopsis>
23530f8248bfSmrg<variablelist>
23540f8248bfSmrg  <varlistentry>
23550f8248bfSmrg    <term>
23560f8248bfSmrg      <parameter>xkb</parameter>
23570f8248bfSmrg    </term>
23580f8248bfSmrg    <listitem>
23590f8248bfSmrg      <para>
23600f8248bfSmrg        keyboard description structure
23610f8248bfSmrg      </para>
23620f8248bfSmrg    </listitem>
23630f8248bfSmrg  </varlistentry>
23640f8248bfSmrg</variablelist>
23650f8248bfSmrg
23660f8248bfSmrg<para>
23670f8248bfSmrgIf the <structfield>indicators</structfield>
23680f8248bfSmrgmember of the keyboard description record
23690f8248bfSmrgpointed to by <parameter>xkb</parameter>
23700f8248bfSmrgis not <symbol>NULL</symbol>,
23710f8248bfSmrg<function>XkbFreeIndicatorMaps</function>
2372e9fcaa8aSmrgfrees the memory associated with
23730f8248bfSmrgthe <structfield>indicators</structfield>
23740f8248bfSmrgmember of <parameter>xkb</parameter>.
2375e9fcaa8aSmrg</para>
2376e9fcaa8aSmrg
2377e9fcaa8aSmrg</sect1>
2378e9fcaa8aSmrg</chapter>
2379