ch12.xml revision eb411b4b
1<chapter id='Interpreting_Key_Events'>
2<title>Interpreting Key Events</title>
3
4<para>
5Xkb provides functions to help developers interpret key events without having
6to directly interpret Xkb data structures. Xkb also modifies the behavior of
7several core X library functions.
8</para>
9
10<sect1 id='Effects_of_Xkb_on_the_Core_X_Library'>
11<title>Effects of Xkb on the Core X Library</title>
12
13<para>
14When support for Xkb is built into the X library, the <emphasis>
15XOpenDisplay</emphasis>
16 function looks for a compatible version of Xkb on the server. If it finds a
17compatible version, it initializes the extension and enables <emphasis>
18implicit support</emphasis>
19 for Xkb in a number of X library functions. This makes it possible for clients
20to take advantage of nearly all Xkb features without having to be rewritten or
21even recompiled, if they are built with shared libraries. This implicit support
22is invisible to most clients, but it can have side effects, so the extension
23includes ways to control or disable it.
24</para>
25
26
27<sect2 id='Effects_of_Xkb_on_Event_State'>
28<title>Effects of Xkb on Event State</title>
29
30<para>
31Because <emphasis>
32XOpenDisplay</emphasis>
33 initializes Xkb, some events contain an Xkb description of the keyboard state
34instead of that normally used by the core protocol. See section 17.1.1 for more
35information about the differences between Xkb keyboard state and that reported
36by the core protocol.
37</para>
38
39
40</sect2>
41<sect2 id='Effects_of_Xkb_on_MappingNotify_Events'>
42<title>Effects of Xkb on MappingNotify Events</title>
43
44<para>
45When Xkb is missing or disabled, the X library tracks changes to the keyboard
46mapping using <emphasis>
47MappingNotify</emphasis>
48 events. Whenever the keyboard mapping is changed, the server sends all clients
49a <emphasis>
50MappingNotify</emphasis>
51 event to report the change. When a client receives a <emphasis>
52MappingNotify</emphasis>
53 event, it is supposed to call <emphasis>
54XRefreshKeyboardMapping</emphasis>
55 to update the keyboard description used internally by the X library.
56</para>
57
58
59<para>
60The X Keyboard Extension uses <emphasis>
61XkbMapNotify</emphasis>
62 and <emphasis>
63XkbNewKeyboardNotify</emphasis>
64 events to track changes to the keyboard mapping. When an Xkb-aware client
65receives either event, it should call <emphasis>
66XkbRefreshKeyboardMapping</emphasis>
67 to update the keyboard description used internally by the X library. To avoid
68duplicate events, the X server does not send core protocol <emphasis>
69MappingNotify</emphasis>
70 events to a client that has selected for <emphasis>
71XkbMapNotify</emphasis>
72 events.
73</para>
74
75
76<para>
77The implicit support for Xkb selects for <emphasis>
78XkbMapNotify</emphasis>
79 events. This means that clients that do not explicitly use Xkb but that are
80using a version of the X library that has implicit support for Xkb do not
81receive <emphasis>
82MappingNotify</emphasis>
83 events over the wire. Clients that were not written with Xkb in mind do not
84recognize or properly handle the new Xkb events, so the implicit support
85converts them to <emphasis>
86MappingNotify</emphasis>
87 events that report approximately the same information, unless the client has
88explicitly selected for the Xkb version of the event.
89</para>
90
91
92<para>
93An Xkb-capable X server does not send events from keys that fall outside the
94legal range of keycodes expected by that client. Once the server sends a client
95an <emphasis>
96XkbNewKeyboardNotify</emphasis>
97 event, it reports events from all keys because it assumes that any client that
98has receieved an <emphasis>
99XkbNewKeyboardNotify</emphasis>
100 event expects key events from the new range of keycodes. The implicit support
101for Xkb asks for <emphasis>
102XkbNewKeyboardNotify</emphasis>
103 events, so the range of keycodes reported to the client might vary without the
104client’s knowledge. Most clients don’t really care about the range of legal
105keycodes, but some clients maintain information about each key and might have
106problems with events that come from unexpected keys. Such clients can set the
107<emphasis>
108XkbLC_IgnoreNewKeyboards</emphasis>
109 library control (see section 11.3.1) to prevent the implicit support from
110requesting notification of changes to the legal range of keycodes.
111</para>
112
113
114</sect2>
115<sect2 id='X_Library_Functions_Affected_by_Xkb'>
116<title>X Library Functions Affected by Xkb</title>
117
118<para>
119The following X library functions are modified by Xkb:
120</para>
121
122<para><programlisting>
123     <emphasis>XKeycodeToKeysym</emphasis>
124     <emphasis>XKeysymToKeycode</emphasis>
125     <emphasis>XLookupKeysym</emphasis>
126     <emphasis>XLookupString</emphasis>
127     <emphasis>XRefreshKeyboardMapping</emphasis>
128     <emphasis>XRebindKeysym</emphasis>
129</programlisting></para>
130
131<para>
132The implicit support for Xkb replaces a number of X library functions with
133versions that understand and use the X Keyboard Extension. In most cases, the
134semantics of the new versions are identical to those of the old, but there are
135occasional visible differences. This section lists all of the functions that
136are affected and the differences in behavior, if any, that are visible to
137clients.
138</para>
139
140
141<para>
142The <emphasis>
143XKeycodeToKeysym</emphasis>
144 function reports the keysym associated with a particular index for a single
145key. The index specifies a column of symbols in the core keyboard mapping (that
146is, as reported by the core protocol <emphasis>
147GetKeyboardMapping</emphasis>
148 request). The order of the symbols in the core mapping does not necessarily
149correspond to the order of the symbols used by Xkb; section 17.1.3 describes
150the differences.
151</para>
152
153
154<para>
155The <emphasis>
156XKeysymToKeycode</emphasis>
157 function reports a keycode to which a particular keysym is bound. When Xkb is
158missing or disabled, this function looks in each column of the core keyboard
159mapping in turn and returns the lowest numbered key that matches in the lowest
160numbered group. When Xkb is present, this function uses the Xkb ordering for
161symbols instead.
162</para>
163
164
165<para>
166The <emphasis>
167XLookupKeysym</emphasis>
168 function reports the symbol in a specific column of the key associated with an
169event. Whether or not Xkb is present, the column specifies an index into the
170core symbol mapping.
171</para>
172
173
174<para>
175The <emphasis>
176XLookupString</emphasis>
177 function reports the symbol and string associated with a key event, taking
178into account the keycode and keyboard state as reported in the event. When Xkb
179is disabled or missing, <emphasis>
180XLookupString</emphasis>
181 uses the rules specified by the core protocol and reports only ISO Latin-1
182characters. When Xkb is present, <emphasis>
183XLookupString</emphasis>
184 uses the explicit keyboard group, key types, and rules specified by Xkb. When
185Xkb is present, <emphasis>
186XLookupString</emphasis>
187 is allowed, but not required, to return strings in character sets other than
188ISO Latin-1, depending on the current locale. If any key bindings are defined,
189<emphasis>
190XLookupString</emphasis>
191 does not use any consumed modifiers (see sections 11.1.2 and 15.2) to
192determine matching bindings.
193</para>
194
195
196<para>
197The <emphasis>
198XRefreshKeyboardMapping</emphasis>
199 function updates the X library’s internal representation of the keyboard to
200reflect changes reported via <emphasis>
201MappingNotify</emphasis>
202 events. When Xkb is missing or disabled, this function reloads the entire
203modifier map or keyboard mapping. When Xkb is present, the implicit Xkb support
204keeps track of the changed components reported by each <emphasis>
205XkbMapNotify</emphasis>
206 event and updates only those pieces of the keyboard description that have
207changed. If the implicit support has not noted any keyboard mapping changes,
208<emphasis>
209XRefreshKeyboardMapping</emphasis>
210 updates the entire keyboard description.
211</para>
212
213
214<para>
215The <emphasis>
216XRebindKeysym</emphasis>
217 function associates a string with a keysym and a set of modifiers. Xkb does
218not directly change this function, but it does affect the way that the state
219reported in the event is compared to the state specified to <emphasis>
220XRebindKeysym</emphasis>
221. When Xkb is missing or disabled, <emphasis>
222XLookupString</emphasis>
223 returns the specified string if the modifiers in the event exactly match the
224modifiers from this call. When Xkb is present, any modifiers used to determine
225the keysym are consumed and are not used to look up the string.
226</para>
227
228
229</sect2>
230</sect1>
231<sect1 id='Xkb_Event_and_Keymap_Functions'>
232<title>Xkb Event and Keymap Functions</title>
233
234<para>
235To find the keysym bound to a particular key at a specified group and shift
236level, use <emphasis>XkbKeycodeToKeysym</emphasis>.
237</para>
238
239<informaltable frame='none'>
240<?dbfo keep-together="always" ?>
241<tgroup cols='1' align='left' colsep='0' rowsep='0'>
242<colspec colname='c1' colwidth='1.0*'/>
243<tbody>
244  <row>
245    <entry role='functiondecl'>
246KeySym <emphasis>
247XkbKeycodeToKeysym</emphasis>
248(<emphasis>
249dpy, kc, group, level</emphasis>
250)
251    </entry>
252  </row>
253  <row>
254    <entry role='functionargdecl'>
255Display *            dpy;            /* connection to X server */
256    </entry>
257  </row>
258  <row>
259    <entry role='functionargdecl'>
260KeyCode            kc;            /* key of interest */
261    </entry>
262  </row>
263  <row>
264    <entry role='functionargdecl'>
265unsigned int            group;            /* group of interest */
266    </entry>
267  </row>
268  <row>
269    <entry role='functionargdecl'>
270unsigned int            level;            /* shift level of interest */
271    </entry>
272</row>
273</tbody>
274</tgroup>
275</informaltable>
276
277<para>
278<emphasis>
279XkbKeycodeToKeysym</emphasis>
280 returns the keysym bound to a particular group and shift level for a
281particular key on the core keyboard. If <emphasis>
282kc</emphasis>
283 is not a legal keycode for the core keyboard, or if <emphasis>
284group</emphasis>
285 or <emphasis>
286level</emphasis>
287 are out of range for the specified key, <emphasis>
288XkbKeycodeToKeysym</emphasis>
289 returns <emphasis>
290NoSymbol</emphasis>
291.
292</para>
293
294
295<para>
296To find the set of modifiers bound to a particular keysym on the core keyboard,
297use <emphasis>
298XkbKeysymToModifiers</emphasis>
299.
300</para>
301
302
303<informaltable frame='none'>
304<?dbfo keep-together="always" ?>
305<tgroup cols='1' align='left' colsep='0' rowsep='0'>
306<colspec colname='c1' colwidth='1.0*'/>
307<tbody>
308  <row>
309    <entry role='functiondecl'>
310unsigned<emphasis>
311 </emphasis>
312int <emphasis>
313XkbKeysymToModifiers</emphasis>
314(<emphasis>
315dpy</emphasis>
316,<emphasis>
317 ks</emphasis>
318)
319    </entry>
320  </row>
321  <row>
322    <entry role='functionargdecl'>
323Display *<emphasis>
324            dpy</emphasis>
325;            /* connection to X server */
326    </entry>
327  </row>
328  <row>
329    <entry role='functionargdecl'>
330KeySym <emphasis>
331            ks</emphasis>
332;            /* keysym of interest */
333    </entry>
334</row>
335</tbody>
336</tgroup>
337</informaltable>
338
339<para>
340<emphasis>
341XkbKeysymToModifiers</emphasis>
342 finds the set of modifiers currently bound to the keysym <emphasis>
343ks</emphasis>
344 on the core keyboard. The value returned is the mask of modifiers bound to the
345keysym <emphasis>
346ks</emphasis>
347. If no modifiers are bound to the keysym, <emphasis>
348XkbKeysymToModifiers</emphasis>
349 returns zero; otherwise, it returns the inclusive OR of zero or more of the
350following: <emphasis>
351ShiftMask</emphasis>
352, <emphasis>
353ControlMask</emphasis>
354, <emphasis>
355LockMask</emphasis>
356, <emphasis>
357Mod1Mask</emphasis>
358, <emphasis>
359Mod2Mask</emphasis>
360, <emphasis>
361Mod3Mask</emphasis>
362, <emphasis>
363Mod4Mask,</emphasis>
364 and <emphasis>
365Mod5Mask</emphasis>
366.
367</para>
368
369
370<para>
371Use <emphasis>
372XkbLookupKeySym</emphasis>
373 to find the symbol associated with a key for a particular state.
374</para>
375
376
377<informaltable frame='none'>
378<?dbfo keep-together="always" ?>
379<tgroup cols='1' align='left' colsep='0' rowsep='0'>
380<colspec colname='c1' colwidth='1.0*'/>
381<tbody>
382  <row>
383    <entry role='functiondecl'>
384Bool <emphasis>
385XkbLookupKeySym</emphasis>
386(<emphasis>
387dpy</emphasis>
388,<emphasis>
389 key</emphasis>
390,<emphasis>
391 state</emphasis>
392,<emphasis>
393 mods_rtrn</emphasis>
394,<emphasis>
395 sym_rtrn</emphasis>
396)
397    </entry>
398  </row>
399  <row>
400    <entry role='functionargdecl'>
401Display * <emphasis>
402            dpy</emphasis>
403;            /* connection to X server */
404    </entry>
405  </row>
406  <row>
407    <entry role='functionargdecl'>
408KeyCode <emphasis>
409            key</emphasis>
410;            /* key for which symbols are to be found */
411    </entry>
412  </row>
413  <row>
414    <entry role='functionargdecl'>
415unsigned int <emphasis>
416            state</emphasis>
417;            /* state for which symbol should be found */
418    </entry>
419  </row>
420  <row>
421    <entry role='functionargdecl'>
422unsigned int * <emphasis>
423            mods_rtrn</emphasis>
424;            /* backfilled with unconsumed modifiers */
425    </entry>
426  </row>
427  <row>
428    <entry role='functionargdecl'>
429KeySym *<emphasis>
430            sym_rtrn</emphasis>
431;            /* backfilled with symbol associated with key + state */
432    </entry>
433</row>
434</tbody>
435</tgroup>
436</informaltable>
437
438<para>
439<emphasis>
440XkbLookupKeySym</emphasis>
441 is the equivalent of the core <emphasis>
442XLookupKeySym</emphasis>
443 function. For the core keyboard, given a keycode <emphasis>
444key</emphasis>
445 and an Xkb state <emphasis>
446state</emphasis>
447, <emphasis>
448XkbLookupKeySym</emphasis>
449 returns the symbol associated with the key  in <emphasis>
450sym_rtrn</emphasis>
451 and the list of modifiers that should still be applied in <emphasis>
452mods_rtrn</emphasis>
453. The <emphasis>
454state</emphasis>
455 parameter is the state from a <emphasis>
456KeyPress</emphasis>
457 or <emphasis>
458KeyRelease</emphasis>
459 event. <emphasis>
460XkbLookupKeySym</emphasis>
461 returns <emphasis>
462True</emphasis>
463 if it succeeds.
464</para>
465
466
467<para>
468Use <emphasis>
469XkbLookupKeyBinding</emphasis>
470 to find the string bound to a key by <emphasis>
471XRebindKeySym</emphasis>
472. <emphasis>
473XkbLookupKeyBinding</emphasis>
474 is the equivalent of the core <emphasis>
475XLookupString</emphasis>
476 function.
477</para>
478
479
480<informaltable frame='none'>
481<?dbfo keep-together="always" ?>
482<tgroup cols='1' align='left' colsep='0' rowsep='0'>
483<colspec colname='c1' colwidth='1.0*'/>
484<tbody>
485  <row>
486    <entry role='functiondecl'>
487int <emphasis>
488XkbLookupKeyBinding</emphasis>
489(<emphasis>
490dpy</emphasis>
491,<emphasis>
492 sym</emphasis>
493,<emphasis>
494 state</emphasis>
495,<emphasis>
496 buf</emphasis>
497,<emphasis>
498 nbytes</emphasis>
499,<emphasis>
500 extra_rtrn</emphasis>
501)
502    </entry>
503  </row>
504  <row>
505    <entry role='functionargdecl'>
506Display * <emphasis>
507            dpy</emphasis>
508;            /* connection to server */
509    </entry>
510  </row>
511  <row>
512    <entry role='functionargdecl'>
513KeySym<emphasis>
514            sym</emphasis>
515;            /* symbol to be looked up */
516    </entry>
517  </row>
518  <row>
519    <entry role='functionargdecl'>
520unsigned int            <emphasis>
521state</emphasis>
522;            /* state for which string is to be looked up */
523    </entry>
524  </row>
525  <row>
526    <entry role='functionargdecl'>
527char * <emphasis>
528            buf</emphasis>
529;            /* buffer into which returned string is written */
530    </entry>
531  </row>
532  <row>
533    <entry role='functionargdecl'>
534int <emphasis>
535            nbytes</emphasis>
536;            /* size of buffer in bytes */
537    </entry>
538  </row>
539  <row>
540    <entry role='functionargdecl'>
541int * <emphasis>
542            extra_rtrn</emphasis>
543;            /* backfilled with number bytes overflow */
544    </entry>
545</row>
546</tbody>
547</tgroup>
548</informaltable>
549
550<para>
551<emphasis>
552XRebindKeysym</emphasis>
553 binds an ASCII string to a specified keysym, so that the string and keysym are
554returned when the key is pressed and a specified list of modifiers are also
555being held down. <emphasis>
556XkbLookupKeyBinding</emphasis>
557 returns in <emphasis>
558buf</emphasis>
559 the string associated with the keysym <emphasis>
560sym</emphasis>
561 and modifier state <emphasis>
562state</emphasis>
563. <emphasis>
564buf</emphasis>
565 is <emphasis>
566NULL</emphasis>
567 terminated unless there’s an overflow. If the string returned is larger than
568<emphasis>
569nbytes</emphasis>
570, a count of bytes that does not fit into the buffer is returned in extra_rtrn.
571<emphasis>
572XkbTranslateKeySym</emphasis>
573 returns the number of bytes that it placed into <emphasis>
574buf</emphasis>
575.
576</para>
577
578
579<para>
580To find the string and symbol associated with a keysym for a given keyboard
581state, use <emphasis>
582XkbTranslateKeySym</emphasis>
583.
584</para>
585
586
587<informaltable frame='none'>
588<?dbfo keep-together="always" ?>
589<tgroup cols='1' align='left' colsep='0' rowsep='0'>
590<colspec colname='c1' colwidth='1.0*'/>
591<tbody>
592  <row>
593    <entry role='functiondecl'>
594int <emphasis>
595XkbTranslateKeySym</emphasis>
596(<emphasis>
597dpy</emphasis>
598,<emphasis>
599 sym_inout</emphasis>
600,<emphasis>
601 mods</emphasis>
602,<emphasis>
603 buf</emphasis>
604,<emphasis>
605 nbytes</emphasis>
606, <emphasis>
607extra_rtrn</emphasis>
608)
609    </entry>
610  </row>
611  <row>
612    <entry role='functionargdecl'>
613Display * <emphasis>
614            dpy</emphasis>
615;            /* connection to X server */
616    </entry>
617  </row>
618  <row>
619    <entry role='functionargdecl'>
620KeySym * <emphasis>
621            sym_inout</emphasis>
622;            /* symbol to be translated; result of translation */
623    </entry>
624  </row>
625  <row>
626    <entry role='functionargdecl'>
627unsigned int <emphasis>
628            mods</emphasis>
629;            /* modifiers to apply to <emphasis>
630sym_inout</emphasis>
631 */
632    </entry>
633  </row>
634  <row>
635    <entry role='functionargdecl'>
636char * <emphasis>
637            buf</emphasis>
638;            /* buffer into which returned string is written */
639    </entry>
640  </row>
641  <row>
642    <entry role='functionargdecl'>
643int <emphasis>
644            nbytes</emphasis>
645;            /* size of buffer in bytes */
646    </entry>
647  </row>
648  <row>
649    <entry role='functionargdecl'>
650int *<emphasis>
651            extra_rtrn</emphasis>
652;            /* number of bytes overflow*/
653    </entry>
654</row>
655</tbody>
656</tgroup>
657</informaltable>
658
659<para>
660<emphasis>
661XkbTranslateKeySym</emphasis>
662 applies the transformations specified in <emphasis>
663mods</emphasis>
664 to the symbol specified by <emphasis>
665sym_inout</emphasis>
666. It returns in <emphasis>
667buf</emphasis>
668 the string, if any, associated with the keysym for the current locale. If the
669transformations in <emphasis>
670mods</emphasis>
671 changes the keysym, <emphasis>
672sym_inout</emphasis>
673 is updated accordingly. If the string returned is larger than <emphasis>
674nbytes</emphasis>
675, a count of bytes that does not fit into the buffer is returned in extra_rtrn.
676<emphasis>
677XkbTranslateKeySym</emphasis>
678 returns the number of bytes it placed into <emphasis>
679buf</emphasis>
680.
681</para>
682
683
684<para>
685To update the keyboard description that is internal to the X library, use
686<emphasis>
687XkbRefreshKeyboardMapping</emphasis>
688.
689</para>
690
691
692<informaltable frame='none'>
693<?dbfo keep-together="always" ?>
694<tgroup cols='1' align='left' colsep='0' rowsep='0'>
695<colspec colname='c1' colwidth='1.0*'/>
696<tbody>
697  <row>
698    <entry role='functiondecl'>
699Status <emphasis>
700XkbRefreshKeyboardMapping</emphasis>
701(<emphasis>
702event)</emphasis>
703    </entry>
704  </row>
705  <row>
706    <entry role='functionargdecl'>
707XkbMapNotifyEvent * <emphasis>
708            event</emphasis>
709;            /* event initiating remapping */
710    </entry>
711</row>
712</tbody>
713</tgroup>
714</informaltable>
715
716<para>
717<emphasis>
718XkbRefreshKeyboardMapping</emphasis>
719 is the Xkb equivalent of the core <emphasis>
720XRefreshKeyboardMapping</emphasis>
721 function. It requests that the X server send the current key mapping
722information to this client. A client usually invokes <emphasis>
723XkbRefreshKeyboardMapping</emphasis>
724 after receiving an <emphasis>
725XkbMapNotify</emphasis>
726 event. <emphasis>
727XkbRefreshKeyboardMapping</emphasis>
728 returns <emphasis>
729Success</emphasis>
730 if it succeeds and <emphasis>
731BadMatch</emphasis>
732 if the event is not an Xkb event.
733</para>
734
735
736<para>
737The <emphasis>
738XkbMapNotify</emphasis>
739 event can be generated when some client calls <emphasis>
740XkbSetMap</emphasis>
741, <emphasis>
742XkbChangeMap</emphasis>
743, <emphasis>
744XkbGetKeyboardByName</emphasis>
745, or any of the standard X library functions that change the keyboard mapping
746or modifier mapping.
747</para>
748
749
750<para>
751To translate a keycode to a key symbol and modifiers, use <emphasis>
752XkbTranslateKeyCode</emphasis>
753.
754</para>
755
756
757<informaltable frame='none'>
758<?dbfo keep-together="always" ?>
759<tgroup cols='1' align='left' colsep='0' rowsep='0'>
760<colspec colname='c1' colwidth='1.0*'/>
761<tbody>
762  <row>
763    <entry role='functiondecl'>
764Booll <emphasis>
765XkbTranslateKeyCode</emphasis>
766(<emphasis>
767xkb, key, mods, mods_rtrn, keysym_rtrn)</emphasis>
768    </entry>
769  </row>
770  <row>
771    <entry role='functionargdecl'>
772XkbDescPtr            <emphasis>
773xkb</emphasis>
774;            /* keyboard description to use for translation */
775    </entry>
776  </row>
777  <row>
778    <entry role='functionargdecl'>
779KeyCode            <emphasis>
780key</emphasis>
781;            /* keycode to translate */
782    </entry>
783  </row>
784  <row>
785    <entry role='functionargdecl'>
786unsigned int            <emphasis>
787mods</emphasis>
788;            /* modifiers to apply when translating <emphasis>
789key</emphasis>
790 */
791    </entry>
792  </row>
793  <row>
794    <entry role='functionargdecl'>
795unsigned int *            <emphasis>
796mods_rtrn</emphasis>
797;            /* backfilled with unconsumed modifiers */
798    </entry>
799  </row>
800  <row>
801    <entry role='functionargdecl'>
802KeySym *            <emphasis>
803keysym_rtrn</emphasis>
804;            /* keysym resulting from translation */
805    </entry>
806</row>
807</tbody>
808</tgroup>
809</informaltable>
810
811<para>
812<emphasis>
813mods_rtrn</emphasis>
814 is backfilled with the modifiers consumed by the translation process.
815<emphasis>
816mods</emphasis>
817 is a bitwise inclusive OR of the legal modifier masks: <emphasis>
818ShiftMask</emphasis>
819, <emphasis>
820LockMask</emphasis>
821, <emphasis>
822ControlMask</emphasis>
823, <emphasis>
824Mod1Mask</emphasis>
825, <emphasis>
826Mod2Mask</emphasis>
827, <emphasis>
828Mod3Mask</emphasis>
829, <emphasis>
830Mod4Mask</emphasis>
831, <emphasis>
832Mod5Mask</emphasis>
833.The <emphasis>
834AlwaysConsumeShiftAndLock</emphasis>
835 library control (see section 11.1.3), if enabled, causes <emphasis>
836XkbTranslateKeyCode</emphasis>
837 to consume shift and lock.<emphasis>
838 XkbTranslateKeyCode</emphasis>
839 returns <emphasis>
840True</emphasis>
841 if the translation resulted in a keysym, and <emphasis>
842False</emphasis>
843 if it resulted in <emphasis>
844NoSymbol</emphasis>
845.
846</para>
847</sect1>
848</chapter>
849