2 Copyright 1985, 1987, 1990, 1998 The Open Group
3 Copyright 2008 Dan Nicholson
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the "Software"),
7 to deal in the Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 and/or sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the names of the authors or their
23 institutions shall not be used in advertising or otherwise to promote the
24 sale, use or other dealings in this Software without prior written
25 authorization from the authors.
28 /************************************************************
29 Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
31 Permission to use, copy, modify, and distribute this
32 software and its documentation for any purpose and without
33 fee is hereby granted, provided that the above copyright
34 notice appear in all copies and that both that copyright
35 notice and this permission notice appear in supporting
36 documentation, and that the name of Silicon Graphics not be
37 used in advertising or publicity pertaining to distribution
38 of the software without specific prior written permission.
39 Silicon Graphics makes no representation about the suitability
40 of this software for any purpose. It is provided "as is"
41 without any express or implied warranty.
43 SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
44 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
45 AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
46 GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
47 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
48 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
49 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
50 THE USE OR PERFORMANCE OF THIS SOFTWARE.
52 ********************************************************/
60 #include <X11/Xfuncproto.h>
61 #include <X11/extensions/XKB.h>
64 typedef unsigned char KeyCode;
67 /* Duplicate the modifier mask defines so libxkcommon can be used
69 #define XKB_COMMON_SHIFT_MASK (1<<0)
70 #define XKB_COMMON_LOCK_MASK (1<<1)
71 #define XKB_COMMON_CONTROL_MASK (1<<2)
72 #define XKB_COMMON_MOD1_MASK (1<<3)
73 #define XKB_COMMON_MOD2_MASK (1<<4)
74 #define XKB_COMMON_MOD3_MASK (1<<5)
75 #define XKB_COMMON_MOD4_MASK (1<<6)
76 #define XKB_COMMON_MOD5_MASK (1<<7)
79 struct xkb_rule_names {
87 struct xkb_any_action {
92 struct xkb_mod_action {
100 struct xkb_group_action {
106 struct xkb_iso_action {
116 struct xkb_controls_action {
122 struct xkb_device_button_action {
130 struct xkb_device_valuator_action {
141 struct xkb_pointer_default_action {
148 struct xkb_switch_screen_action {
154 struct xkb_redirect_key_action {
163 struct xkb_pointer_action {
170 struct xkb_message_action {
176 struct xkb_pointer_button_action {
184 struct xkb_any_action any;
185 struct xkb_mod_action mods;
186 struct xkb_group_action group;
187 struct xkb_iso_action iso;
188 struct xkb_controls_action ctrls;
189 struct xkb_device_button_action devbtn;
190 struct xkb_device_valuator_action devval;
191 struct xkb_pointer_default_action dflt;
192 struct xkb_switch_screen_action screen;
193 struct xkb_redirect_key_action redirect; /* XXX wholly unnecessary? */
194 struct xkb_pointer_action ptr; /* XXX delete for DeviceValuator */
195 struct xkb_pointer_button_action btn; /* XXX delete for DeviceBtn */
196 struct xkb_message_action msg; /* XXX just delete */
201 uint32_t mask; /* effective mods */
206 struct xkb_kt_map_entry {
209 struct xkb_mods mods;
212 struct xkb_key_type {
213 struct xkb_mods mods;
215 unsigned char map_count;
216 struct xkb_kt_map_entry * map;
217 struct xkb_mods * preserve;
219 uint32_t *level_names;
222 struct xkb_sym_interpret {
226 uint8_t mods; /* XXX real or virt? */
227 uint32_t virtual_mod;
228 struct xkb_any_action act;
231 struct xkb_compat_map {
232 struct xkb_sym_interpret * sym_interpret;
233 struct xkb_mods groups[XkbNumKbdGroups];
234 unsigned short num_si;
235 unsigned short size_si;
239 unsigned char kt_index[XkbNumKbdGroups];
240 unsigned char group_info;
242 unsigned short offset;
245 #define XkbNumGroups(g) ((g)&0x0f)
246 #define XkbOutOfRangeGroupInfo(g) ((g)&0xf0)
247 #define XkbOutOfRangeGroupAction(g) ((g)&0xc0)
248 #define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4)
249 #define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f))
250 #define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f))
252 struct xkb_client_map {
253 unsigned char size_types;
254 unsigned char num_types;
255 struct xkb_key_type * types;
257 unsigned short size_syms;
258 unsigned short num_syms;
260 struct xkb_sym_map * key_sym_map;
262 unsigned char *modmap;
265 #define XkbCMKeyGroupInfo(m,k) ((m)->key_sym_map[k].group_info)
266 #define XkbCMKeyNumGroups(m,k) (XkbNumGroups((m)->key_sym_map[k].group_info))
267 #define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels)
268 #define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width)
269 #define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3])
270 #define XkbCMKeyType(m,k,g) (&(m)->types[XkbCMKeyTypeIndex(m,k,g)])
271 #define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k))
272 #define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset)
273 #define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)])
275 struct xkb_behavior {
280 struct xkb_server_map {
281 unsigned short num_acts;
282 unsigned short size_acts;
284 #if defined(__cplusplus) || defined(c_plusplus)
285 /* explicit is a C++ reserved word */
286 unsigned char * c_explicit;
288 unsigned char * explicit;
291 union xkb_action *acts;
292 struct xkb_behavior *behaviors;
293 unsigned short *key_acts;
294 unsigned char *explicits;
295 uint32_t vmods[XkbNumVirtualMods];
299 #define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]])
301 struct xkb_indicator_map {
303 unsigned char which_groups;
304 unsigned char groups;
305 unsigned char which_mods;
306 struct xkb_mods mods;
310 struct xkb_indicator {
311 unsigned long phys_indicators;
312 struct xkb_indicator_map maps[XkbNumIndicators];
315 struct xkb_key_name {
316 char name[XkbKeyNameLength];
319 struct xkb_key_alias {
320 char real[XkbKeyNameLength];
321 char alias[XkbKeyNameLength];
330 uint32_t vmods[XkbNumVirtualMods];
331 uint32_t indicators[XkbNumIndicators];
332 uint32_t groups[XkbNumKbdGroups];
333 struct xkb_key_name * keys;
334 struct xkb_key_alias * key_aliases;
335 uint32_t *radio_groups;
336 uint32_t phys_symbols;
338 unsigned char num_keys;
339 unsigned char num_key_aliases;
340 unsigned short num_rg;
343 struct xkb_property {
364 unsigned short num_points;
365 unsigned short sz_points;
366 unsigned short corner_radius;
367 struct xkb_point * points;
372 unsigned short num_outlines;
373 unsigned short sz_outlines;
374 struct xkb_outline * outlines;
375 struct xkb_outline * approx;
376 struct xkb_outline * primary;
377 struct xkb_bounds bounds;
380 struct xkb_shape_doodad {
383 unsigned char priority;
387 unsigned short color_ndx;
388 unsigned short shape_ndx;
390 #define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
391 #define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
392 #define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
393 #define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
395 struct xkb_text_doodad {
398 unsigned char priority;
404 unsigned short color_ndx;
408 #define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
409 #define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
411 struct xkb_indicator_doodad {
414 unsigned char priority;
418 unsigned short shape_ndx;
419 unsigned short on_color_ndx;
420 unsigned short off_color_ndx;
422 #define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
423 #define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx])
424 #define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx])
425 #define XkbSetIndicatorDoodadOnColor(g,d,c) \
426 ((d)->on_color_ndx= (c)-&(g)->colors[0])
427 #define XkbSetIndicatorDoodadOffColor(g,d,c) \
428 ((d)->off_color_ndx= (c)-&(g)->colors[0])
429 #define XkbSetIndicatorDoodadShape(g,d,s) \
430 ((d)->shape_ndx= (s)-&(g)->shapes[0])
432 struct xkb_logo_doodad {
435 unsigned char priority;
439 unsigned short color_ndx;
440 unsigned short shape_ndx;
443 #define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
444 #define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
445 #define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
446 #define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
448 struct xkb_any_doodad {
451 unsigned char priority;
458 struct xkb_any_doodad any;
459 struct xkb_shape_doodad shape;
460 struct xkb_text_doodad text;
461 struct xkb_indicator_doodad indicator;
462 struct xkb_logo_doodad logo;
465 #define XkbUnknownDoodad 0
466 #define XkbOutlineDoodad 1
467 #define XkbSolidDoodad 2
468 #define XkbTextDoodad 3
469 #define XkbIndicatorDoodad 4
470 #define XkbLogoDoodad 5
473 struct xkb_key_name name;
475 unsigned char shape_ndx;
476 unsigned char color_ndx;
478 #define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx])
479 #define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx])
480 #define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0])
481 #define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0])
486 unsigned short num_keys;
487 unsigned short sz_keys;
489 struct xkb_key * keys;
490 struct xkb_bounds bounds;
495 unsigned char priority;
498 unsigned short width;
499 unsigned short height;
501 unsigned short num_rows;
502 unsigned short num_doodads;
503 unsigned short num_overlays;
504 unsigned short sz_rows;
505 unsigned short sz_doodads;
506 unsigned short sz_overlays;
507 struct xkb_row * rows;
508 union xkb_doodad * doodads;
509 struct xkb_bounds bounds;
510 struct xkb_overlay *overlays;
513 struct xkb_overlay_key {
514 struct xkb_key_name over;
515 struct xkb_key_name under;
518 struct xkb_overlay_row {
519 unsigned short row_under;
520 unsigned short num_keys;
521 unsigned short sz_keys;
522 struct xkb_overlay_key * keys;
527 struct xkb_section * section_under;
528 unsigned short num_rows;
529 unsigned short sz_rows;
530 struct xkb_overlay_row * rows;
531 struct xkb_bounds * bounds;
534 struct xkb_geometry {
536 unsigned short width_mm;
537 unsigned short height_mm;
539 struct xkb_color * label_color;
540 struct xkb_color * base_color;
541 unsigned short sz_properties;
542 unsigned short sz_colors;
543 unsigned short sz_shapes;
544 unsigned short sz_sections;
545 unsigned short sz_doodads;
546 unsigned short sz_key_aliases;
547 unsigned short num_properties;
548 unsigned short num_colors;
549 unsigned short num_shapes;
550 unsigned short num_sections;
551 unsigned short num_doodads;
552 unsigned short num_key_aliases;
553 struct xkb_property * properties;
554 struct xkb_color * colors;
555 struct xkb_shape * shapes;
556 struct xkb_section * sections;
557 union xkb_doodad * doodads;
558 struct xkb_key_alias * key_aliases;
560 #define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0]))
562 #define XkbGeomPropertiesMask (1<<0)
563 #define XkbGeomColorsMask (1<<1)
564 #define XkbGeomShapesMask (1<<2)
565 #define XkbGeomSectionsMask (1<<3)
566 #define XkbGeomDoodadsMask (1<<4)
567 #define XkbGeomKeyAliasesMask (1<<5)
568 #define XkbGeomAllMask (0x3f)
570 struct xkb_geometry_sizes {
572 unsigned short num_properties;
573 unsigned short num_colors;
574 unsigned short num_shapes;
575 unsigned short num_sections;
576 unsigned short num_doodads;
577 unsigned short num_key_aliases;
580 struct xkb_controls {
581 unsigned char mk_dflt_btn;
582 unsigned char num_groups;
583 unsigned char groups_wrap;
584 struct xkb_mods internal;
585 struct xkb_mods ignore_lock;
586 unsigned int enabled_ctrls;
587 unsigned short repeat_delay;
588 unsigned short repeat_interval;
589 unsigned short slow_keys_delay;
590 unsigned short debounce_delay;
591 unsigned short mk_delay;
592 unsigned short mk_interval;
593 unsigned short mk_time_to_max;
594 unsigned short mk_max_speed;
596 unsigned short ax_options;
597 unsigned short ax_timeout;
598 unsigned short axt_opts_mask;
599 unsigned short axt_opts_values;
600 unsigned int axt_ctrls_mask;
601 unsigned int axt_ctrls_values;
602 unsigned char per_key_repeat[XkbPerKeyBitArraySize];
605 /* Common keyboard description structure */
607 unsigned int defined;
608 unsigned short flags;
609 unsigned short device_spec;
610 KeyCode min_key_code;
611 KeyCode max_key_code;
613 struct xkb_controls * ctrls;
614 struct xkb_server_map * server;
615 struct xkb_client_map * map;
616 struct xkb_indicator * indicators;
617 struct xkb_names * names;
618 struct xkb_compat_map * compat;
619 struct xkb_geometry * geom;
622 #define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g))
623 #define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g))
624 #define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g))
625 #define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k))
626 #define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k)))
627 #define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k)))
628 #define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k)))
629 #define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k)))
630 #define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n])
631 #define XkbKeySymEntry(d,k,sl,g) \
632 (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))))
633 #define XkbKeyAction(d,k,n) \
634 (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL)
635 #define XkbKeyActionEntry(d,k,sl,g) \
636 (XkbKeyHasActions(d,k)?\
637 XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL)
639 #define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0)
640 #define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1)
641 #define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k))
642 #define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&\
643 ((k)<=(d)->max_key_code))
644 #define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1)
646 struct xkb_map_changes {
647 unsigned short changed;
648 KeyCode min_key_code;
649 KeyCode max_key_code;
650 unsigned char first_type;
651 unsigned char num_types;
652 KeyCode first_key_sym;
653 unsigned char num_key_syms;
654 KeyCode first_key_act;
655 unsigned char num_key_acts;
656 KeyCode first_key_behavior;
657 unsigned char num_key_behaviors;
658 KeyCode first_key_explicit;
659 unsigned char num_key_explicit;
660 KeyCode first_modmap_key;
661 unsigned char num_modmap_keys;
662 KeyCode first_vmodmap_key;
663 unsigned char num_vmodmap_keys;
665 unsigned short vmods;
668 struct xkb_controls_changes {
669 unsigned int changed_ctrls;
670 unsigned int enabled_ctrls_changes;
671 int num_groups_changed;
674 struct xkb_indicator_changes {
675 unsigned int state_changes;
676 unsigned int map_changes;
679 struct xkb_name_changes {
680 unsigned int changed;
681 unsigned char first_type;
682 unsigned char num_types;
683 unsigned char first_lvl;
684 unsigned char num_lvls;
685 unsigned char num_aliases;
686 unsigned char num_rg;
687 unsigned char first_key;
688 unsigned char num_keys;
689 unsigned short changed_vmods;
690 unsigned long changed_indicators;
691 unsigned char changed_groups;
694 struct xkb_compat_changes {
695 unsigned char changed_groups;
696 unsigned short first_si;
697 unsigned short num_si;
701 unsigned short device_spec;
702 unsigned short state_changes;
703 struct xkb_map_changes map;
704 struct xkb_controls_changes ctrls;
705 struct xkb_indicator_changes indicators;
706 struct xkb_name_changes names;
707 struct xkb_compat_changes compat;
710 struct xkb_component_names {
719 struct xkb_component_name {
720 unsigned short flags;
724 struct xkb_component_list {
731 struct xkb_component_name * keymaps;
732 struct xkb_component_name * keycodes;
733 struct xkb_component_name * types;
734 struct xkb_component_name * compat;
735 struct xkb_component_name * symbols;
736 struct xkb_component_name * geometry;
740 unsigned char group; /* base + latched + locked */
741 /* FIXME: Why are base + latched short and not char?? */
742 unsigned short base_group; /* physically ... down? */
743 unsigned short latched_group;
744 unsigned char locked_group;
746 unsigned char mods; /* base + latched + locked */
747 unsigned char base_mods; /* physically down */
748 unsigned char latched_mods;
749 unsigned char locked_mods;
751 unsigned char compat_state; /* mods + group for core state */
753 /* grab mods = all depressed and latched mods, _not_ locked mods */
754 unsigned char grab_mods; /* grab mods minus internal mods */
755 unsigned char compat_grab_mods; /* grab mods + group for core state,
756 but not locked groups if
757 IgnoreGroupLocks set */
759 /* effective mods = all mods (depressed, latched, locked) */
760 unsigned char lookup_mods; /* effective mods minus internal mods */
761 unsigned char compat_lookup_mods; /* effective mods + group */
763 unsigned short ptr_buttons; /* core pointer buttons */
766 #define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group)
767 #define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group)
769 #define XkbNumGroups(g) ((g)&0x0f)
770 #define XkbOutOfRangeGroupInfo(g) ((g)&0xf0)
771 #define XkbOutOfRangeGroupAction(g) ((g)&0xc0)
772 #define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4)
773 #define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f))
777 typedef uint32_t (*InternAtomFuncPtr)(const char *val);
778 typedef const char *(*GetAtomValueFuncPtr)(uint32_t atom);
780 _X_EXPORT extern void
781 xkb_init_atoms(InternAtomFuncPtr intern, GetAtomValueFuncPtr get_atom_value);
783 _X_EXPORT extern uint32_t
784 xkb_intern_atom(const char *name);
786 _X_EXPORT extern struct xkb_desc *
787 xkb_compile_keymap_from_rules(const struct xkb_rule_names *rules);
789 _X_EXPORT extern struct xkb_desc *
790 xkb_compile_keymap_from_components(const struct xkb_component_names * ktcsg);
792 _X_EXPORT extern struct xkb_desc *
793 xkb_compile_keymap_from_file(FILE *inputFile, const char *mapName);
795 _X_EXPORT extern struct xkb_desc *
796 xkb_compile_keymap_from_string(const char *string, const char *mapName);
798 _X_EXPORT extern void
799 xkb_free_keymap(struct xkb_desc *xkb);
801 _X_EXPORT extern struct xkb_component_list *
802 xkb_list_components(struct xkb_component_names * ptrns, int *maxMatch);
805 * Canonicalises component names by prepending the relevant component from
806 * 'old' to the one in 'names' when the latter has a leading '+' or '|', and
807 * by replacing a '%' with the relevant component, e.g.:
810 * ------------------------------------------
813 * foo+%|baz bar foo+bar|baz
815 * If a component in names needs to be modified, the existing value will be
816 * free()d, and a new one allocated with malloc().
818 _X_EXPORT extern void
819 xkb_canonicalise_components(struct xkb_component_names * names,
820 const struct xkb_component_names * old);
823 * Converts a keysym to a string; will return unknown Unicode codepoints
824 * as "Ua1b2", and other unknown keysyms as "0xabcd1234".
826 * This is uint32_t rather than KeySym, as KeySym changes size between
827 * client and server (no, really).
829 _X_EXPORT extern void
830 xkb_keysym_to_string(uint32_t ks, char *buffer, size_t size);
833 * See xkb_keysym_to_string comments: this function will accept any string
834 * from that function.
836 _X_EXPORT extern uint32_t
837 xkb_string_to_keysym(const char *s);
841 #endif /* _XKBCOMMON_H_ */