2 * Copyright (C) 2012 Ulteo SAS
4 * Author Jocelyn DELALANDE <j.delalande@ulteo.com> 2012
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; version 2
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include "unicode_convtable.h"
24 int keysym2uni(int keysym) {
25 init_unicode_tables();
26 /* Default: no exception */
29 if (keysym < 0x100000) {
30 // Look for a 4-digits-form exception
31 exception = keysym2uni_base[keysym];
33 // Look for a 7-digits-form exception
34 /* Switch to look for 0x1001XXX 0x1002XXX or 0x1002XXX
35 the tables only indexes on XXX
37 switch(keysym & 0xFFFF000) {
39 exception = keysym2uni_ext0[keysym & 0x0000FFF];
42 exception = keysym2uni_ext1[keysym & 0x0000FFF];
45 exception = keysym2uni_ext2[keysym & 0x0000FFF];
49 /* If the keysym is not within exceptions, keysym = unicode */