1 /************************************************************
2 Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
4 Permission to use, copy, modify, and distribute this
5 software and its documentation for any purpose and without
6 fee is hereby granted, provided that the above copyright
7 notice appear in all copies and that both that copyright
8 notice and this permission notice appear in supporting
9 documentation, and that the name of Silicon Graphics not be
10 used in advertising or publicity pertaining to distribution
11 of the software without specific prior written permission.
12 Silicon Graphics makes no representation about the suitability
13 of this software for any purpose. It is provided "as is"
14 without any express or implied warranty.
16 SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18 AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
19 GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
20 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
23 THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 ********************************************************/
31 _XkbcKSCheckCase(xkb_keysym_t ks)
33 unsigned set = (ks & (~0xff)) >> 8;
38 if ((ks >= XKB_KEY_A && ks <= XKB_KEY_Z) ||
39 (ks >= XKB_KEY_Agrave && ks <= XKB_KEY_THORN && ks != XKB_KEY_multiply))
41 if ((ks >= XKB_KEY_a && ks <= XKB_KEY_z) ||
42 (ks >= XKB_KEY_agrave && ks <= XKB_KEY_ydiaeresis))
46 if ((ks >= XKB_KEY_Aogonek && ks <= XKB_KEY_Zabovedot && ks != XKB_KEY_breve) ||
47 (ks >= XKB_KEY_Racute && ks<=XKB_KEY_Tcedilla))
49 if ((ks >= XKB_KEY_aogonek && ks <= XKB_KEY_zabovedot && ks != XKB_KEY_caron) ||
50 (ks >= XKB_KEY_racute && ks <= XKB_KEY_tcedilla))
54 if ((ks >= XKB_KEY_Hstroke && ks <= XKB_KEY_Jcircumflex) ||
55 (ks >= XKB_KEY_Cabovedot && ks <= XKB_KEY_Scircumflex))
57 if ((ks >= XKB_KEY_hstroke && ks <= XKB_KEY_jcircumflex) ||
58 (ks >= XKB_KEY_cabovedot && ks <= XKB_KEY_scircumflex))
62 if ((ks >= XKB_KEY_Rcedilla && ks <= XKB_KEY_Tslash) ||
63 (ks == XKB_KEY_ENG) ||
64 (ks >= XKB_KEY_Amacron && ks <= XKB_KEY_Umacron))
66 if ((ks >= XKB_KEY_rcedilla && ks <= XKB_KEY_tslash) ||
67 (ks == XKB_KEY_eng) ||
68 (ks >= XKB_KEY_amacron && ks <= XKB_KEY_umacron))
71 case 6: /* Cyrillic */
72 if ((ks >= XKB_KEY_Serbian_DJE && ks <= XKB_KEY_Serbian_DZE) ||
73 (ks >= XKB_KEY_Cyrillic_YU && ks <= XKB_KEY_Cyrillic_HARDSIGN))
75 if ((ks >= XKB_KEY_Serbian_dje && ks <= XKB_KEY_Serbian_dze) ||
76 (ks >= XKB_KEY_Cyrillic_yu && ks <= XKB_KEY_Cyrillic_hardsign))
80 if ((ks >= XKB_KEY_Greek_ALPHAaccent &&
81 ks <= XKB_KEY_Greek_OMEGAaccent) ||
82 (ks >= XKB_KEY_Greek_ALPHA && ks <= XKB_KEY_Greek_OMEGA))
84 if ((ks >= XKB_KEY_Greek_alphaaccent &&
85 ks <= XKB_KEY_Greek_omegaaccent) ||
86 (ks >= XKB_KEY_Greek_alpha && ks <= XKB_KEY_Greek_OMEGA))
89 case 18: /* latin 8 */
90 if ((ks == XKB_KEY_Wcircumflex) ||
91 (ks == XKB_KEY_Ycircumflex) ||
92 (ks == XKB_KEY_Babovedot) ||
93 (ks == XKB_KEY_Dabovedot) ||
94 (ks == XKB_KEY_Fabovedot) ||
95 (ks == XKB_KEY_Mabovedot) ||
96 (ks == XKB_KEY_Pabovedot) ||
97 (ks == XKB_KEY_Sabovedot) ||
98 (ks == XKB_KEY_Tabovedot) ||
99 (ks == XKB_KEY_Wdiaeresis) ||
100 (ks == XKB_KEY_Ygrave))
102 if ((ks == XKB_KEY_wcircumflex) ||
103 (ks == XKB_KEY_ycircumflex) ||
104 (ks == XKB_KEY_babovedot) ||
105 (ks == XKB_KEY_dabovedot) ||
106 (ks == XKB_KEY_fabovedot) ||
107 (ks == XKB_KEY_mabovedot) ||
108 (ks == XKB_KEY_pabovedot) ||
109 (ks == XKB_KEY_sabovedot) ||
110 (ks == XKB_KEY_tabovedot) ||
111 (ks == XKB_KEY_wdiaeresis) ||
112 (ks == XKB_KEY_ygrave))
115 case 19: /* latin 9 */
116 if (ks == XKB_KEY_OE || ks == XKB_KEY_Ydiaeresis)
118 if (ks == XKB_KEY_oe)
127 XkbcFindKeycodeByName(struct xkb_keymap *keymap, const char *name,
130 struct xkb_key_alias *alias;
133 for (i = keymap->min_key_code; i <= keymap->max_key_code; i++) {
134 if (strncmp(darray_item(keymap->names->keys, i).name, name,
135 XkbKeyNameLength) == 0)
143 darray_foreach(alias, keymap->names->key_aliases)
144 if (strncmp(name, alias->alias, XkbKeyNameLength) == 0)
145 return XkbcFindKeycodeByName(keymap, alias->real, false);