diff options
52 files changed, 32720 insertions, 19 deletions
@@ -901,7 +901,7 @@ CFG_USE_GNUMAKE=no CFG_XINPUT2=auto CFG_XINPUT=runtime CFG_XKB=auto -CFG_XKBCOMMON=no +CFG_XKBCOMMON=auto CFG_XCB=auto CFG_XCB_GLX=no CFG_EGLFS=auto @@ -1839,6 +1839,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + xkbcommon) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "qt" ] || [ "$VAL" = "system" ]; then + CFG_XKBCOMMON="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; xcb) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ] || [ "$VAL" = "qt" ]; then CFG_XCB="$VAL" @@ -2360,6 +2367,11 @@ if [ "$PLATFORM_MAC" = "no" -a "$CFG_DEBUG_RELEASE" = "yes" ]; then echo fi +if [ "$CFG_XCB" != "no" ] && [ "$CFG_XKBCOMMON" = "no" ]; then + echo "Error: -no-xkbcommon is not supported on XCB platform plugin." + exit 101 +fi + if [ "$CFG_SILENT" = "yes" ]; then QMAKE_CONFIG="$QMAKE_CONFIG silent" fi @@ -3436,6 +3448,9 @@ Third Party Libraries: (libxcb.so will still be used from operating system). + -system-xcb ........ Use xcb- libraries from the operating system. + -qt-xkbcommon ...... Use the xkbcommon library bundled with Qt. + + -system-xkbcommon .. Use the xkbcommon library from the operating system. + Additional options: -make <part> ....... Add part to the list of parts to be built at make time. @@ -5168,7 +5183,7 @@ if [ "$CFG_XCB" != "no" ]; then fi else echo "The test for linking against libxcb and support libraries failed!" - echo " You might need install dependency packages, or pass -qt-xcb." + echo " You might need to install dependency packages, or pass -qt-xcb." echo " See src/plugins/platforms/xcb/README." exit 1 fi @@ -5258,18 +5273,32 @@ if [ "$CFG_KMS" != "no" ]; then fi # Detect libxkbcommon -if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon >= 0.2.0" 2>/dev/null; then - QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`" - QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon 2>/dev/null`" - QT_CONFIG="$QT_CONFIG xkbcommon" - CFG_XKBCOMMON=yes -elif [ "$CFG_XCB" != "no" ]; then - QMakeVar add DEFINES QT_NO_XKBCOMMON +ORIG_CFG_XKBCOMMON="$CFG_XKBCOMMON" +if [ "$CFG_XKBCOMMON" != "qt" ]; then + # currently only xcb platform plugin requires xkbcommon, for other platforms it can be set to 'no' + if [ "$CFG_XKBCOMMON" != "no" ]; then + if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon >= 0.2.0" 2>/dev/null; then + QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`" + QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon 2>/dev/null`" + + QMakeVar set QMAKE_CFLAGS_XKBCOMMON "$QMAKE_CFLAGS_XKBCOMMON" + QMakeVar set QMAKE_LIBS_XKBCOMMON "$QMAKE_LIBS_XKBCOMMON" + CFG_XKBCOMMON=yes + else + CFG_XKBCOMMON=no + fi + + if [ "$CFG_XCB" != "no" ] && [ "$CFG_XKBCOMMON" = "no" ]; then + # use the bundled version instead + CFG_XKBCOMMON=qt + fi + fi fi -if [ "$CFG_XKBCOMMON" != "no" ]; then - QMakeVar set QMAKE_CFLAGS_XKBCOMMON "$QMAKE_CFLAGS_XKBCOMMON" - QMakeVar set QMAKE_LIBS_XKBCOMMON "$QMAKE_LIBS_XKBCOMMON" +if [ "$CFG_XKBCOMMON" = "qt" ]; then + QT_CONFIG="$QT_CONFIG xkbcommon-qt" +elif [ "$CFG_XKBCOMMON" = "no" ]; then + QMakeVar add DEFINES QT_NO_XKBCOMMON fi # EGL Support @@ -6744,7 +6773,14 @@ echo " SQLite 2 ............. $CFG_SQL_sqlite2" echo " SQLite ............... $CFG_SQL_sqlite ($CFG_SQLITE)" echo " TDS .................. $CFG_SQL_tds" echo " udev ................... $CFG_LIBUDEV" -echo " xkbcommon .............. $CFG_XKBCOMMON" +if [ "$CFG_XKBCOMMON" = "no" ]; then + echo " xkbcommon............... no" +else + xkbcommon_sys=system + [ "$CFG_XKBCOMMON" = "qt" ] && xkbcommon_sys=qt + echo " xkbcommon............... yes ($xkbcommon_sys)" + unset xkbcommon_sys +fi if [ "$CFG_ZLIB" = "no" ]; then echo " zlib ................... no" else @@ -6772,10 +6808,9 @@ if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then echo " OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked" echo fi -if [ "$CFG_XCB" != no ] && [ "$CFG_XKBCOMMON" = "no" ]; then - echo "WARNING: XCB support enabled but libxkbcommon 0.2.0 (or higher) not found." - echo "Not satisfying this requirement will disable the compose key functionality," - echo "which includes text input with dead keys." +if [ "$ORIG_CFG_XKBCOMMON" != qt ] && [ "$CFG_XKBCOMMON" = qt ]; then + echo "NOTE: libxkbcommon 0.2.0 (or higher) not found on the system, will use " + echo "the bundled version from 3rd party directory." fi exec 1>&3 3>&- # restore stdout diff --git a/src/3rdparty/xkbcommon.pri b/src/3rdparty/xkbcommon.pri new file mode 100644 index 0000000000..99536576f7 --- /dev/null +++ b/src/3rdparty/xkbcommon.pri @@ -0,0 +1,40 @@ +QMAKE_CFLAGS = -std=gnu99 -w +INCLUDEPATH += $$PWD/xkbcommon $$PWD/xkbcommon/src $$PWD/xkbcommon/src/xkbcomp + +DEFINES += DFLT_XKB_CONFIG_ROOT='\\"/usr/share/X11/xkb\\"' + +### RMLVO names can be overwritten with environmental variables (See libxkbcommon documentation) +DEFINES += DEFAULT_XKB_RULES='\\"evdev\\"' +DEFINES += DEFAULT_XKB_MODEL='\\"pc105\\"' +DEFINES += DEFAULT_XKB_LAYOUT='\\"us\\"' + +# Need to rename 2 files, qmake has problems processing a project when +# directories contain files with equal names. +SOURCES += \ + $$PWD/xkbcommon/src/atom.c \ + $$PWD/xkbcommon/src/xkb-compat.c \ # renamed: compat.c -> xkb-compat.c + $$PWD/xkbcommon/src/context.c \ + $$PWD/xkbcommon/src/xkb-keymap.c \ # renamed: keymap.c -> xkb-keymap.c + $$PWD/xkbcommon/src/keysym.c \ + $$PWD/xkbcommon/src/keysym-utf.c \ + $$PWD/xkbcommon/src/state.c \ + $$PWD/xkbcommon/src/text.c + +SOURCES += \ + $$PWD/xkbcommon/src/xkbcomp/action.c \ + $$PWD/xkbcommon/src/xkbcomp/ast-build.c \ + $$PWD/xkbcommon/src/xkbcomp/compat.c \ + $$PWD/xkbcommon/src/xkbcomp/expr.c \ + $$PWD/xkbcommon/src/xkbcomp/include.c \ + $$PWD/xkbcommon/src/xkbcomp/keycodes.c \ + $$PWD/xkbcommon/src/xkbcomp/keymap-dump.c \ + $$PWD/xkbcommon/src/xkbcomp/keymap.c \ + $$PWD/xkbcommon/src/xkbcomp/parser.c \ + $$PWD/xkbcommon/src/xkbcomp/rules.c \ + $$PWD/xkbcommon/src/xkbcomp/scanner.c \ + $$PWD/xkbcommon/src/xkbcomp/symbols.c \ + $$PWD/xkbcommon/src/xkbcomp/types.c \ + $$PWD/xkbcommon/src/xkbcomp/vmod.c \ + $$PWD/xkbcommon/src/xkbcomp/xkbcomp.c + +TR_EXCLUDE += $$PWD/* diff --git a/src/3rdparty/xkbcommon/COPYING b/src/3rdparty/xkbcommon/COPYING new file mode 100644 index 0000000000..2d3b55a962 --- /dev/null +++ b/src/3rdparty/xkbcommon/COPYING @@ -0,0 +1,188 @@ +The following is a list of all copyright notices and license statements which +appear in the xkbcommon source tree. + +If making new contributions, the first form (i.e. Daniel Stone, Ran Benita, +etc) is vastly preferred. + +All licenses are derivative of the MIT/X11 license, mostly identical other +than no-endorsement clauses (e.g. paragraph 4 of The Open Group's license). + +These statements are split into two sections: one for the code compiled and +distributed as part of the libxkbcommon shared library and the code +component of all tests (i.e. everything under src/ and xkbcommon/, plus the +.c and .h files under test/), and another for the test data under test/data, +which is distributed with the xkbcommon source tarball, but not installed to +the system. + + +BEGINNING OF SOFTWARE COPYRIGHT/LICENSE STATEMENTS: + + +------------------------------------------------------------------------------- + +Copyright © 2009-2012 Daniel Stone +Copyright © 2012 Ran Benita <ran234@gmail.com> +Copyright © 2010, 2012 Intel Corporation +Copyright © 2008, 2009 Dan Nicholson +Copyright © 2010 Francisco Jerez <currojerez@riseup.net> + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + +------------------------------------------------------------------------------- + + +Copyright 1985, 1987, 1988, 1990, 1998 The Open Group + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or their +institutions shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization from the authors. + + +------------------------------------------------------------------------------- + + +Copyright (c) 1993, 1994, 1995, 1996 by Silicon Graphics Computer Systems, Inc. + +Permission to use, copy, modify, and distribute this +software and its documentation for any purpose and without +fee is hereby granted, provided that the above copyright +notice appear in all copies and that both that copyright +notice and this permission notice appear in supporting +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH +THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +------------------------------------------------------------------------------- + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + +------------------------------------------------------------------------------- + + +Copyright (C) 2011 Joseph Adams <joeyadams3.14159@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +------------------------------------------------------------------------------- + + + +END OF SOFTWARE COPYRIGHT/LICENSE STATEMENTS + + +BEGINNING OF LICENSE STATEMENTS FOR UNDISTRIBUTED DATA FILES IN test/data, +derived from xkeyboard-config: + + + +------------------------------------------------------------------------------- + +Copyright 1996 by Joseph Moss +Copyright (C) 2002-2007 Free Software Foundation, Inc. +Copyright (C) Dmitry Golubev <lastguru@mail.ru>, 2003-2004 +Copyright (C) 2004, Gregory Mokhin <mokhin@bog.msu.ru> +Copyright (C) 2006 Erdal Ronahî + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of the copyright holder(s) not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. The copyright holder(s) makes no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +THE COPYRIGHT HOLDER(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/src/3rdparty/xkbcommon/README b/src/3rdparty/xkbcommon/README new file mode 100644 index 0000000000..fa8e94c81c --- /dev/null +++ b/src/3rdparty/xkbcommon/README @@ -0,0 +1,119 @@ +Overview {#mainpage} +======== + +xkbcommon is a keymap compiler and support library which processes a +reduced subset of keymaps as defined by the XKB specification. Primarily, +a keymap is created from a set of Rules/Model/Layout/Variant/Options names, +processed through an XKB ruleset, and compiled into a struct xkb_keymap, +which is the base type for all xkbcommon operations. + +From an xkb_keymap, an xkb_state object is created which holds the current +state of all modifiers, groups, LEDs, etc, relating to that keymap. All +key events must be fed into the xkb_state object using xkb_state_update_key(). +Once this is done, the xkb_state object will be properly updated, and the +keysyms to use can be obtained with xkb_state_key_get_syms(). + +libxkbcommon does not distribute a dataset itself, other than for testing +purposes. The most common dataset is xkeyboard-config, as used by all +current distributions for their X11 XKB data. More information on +xkeyboard-config is available here: + http://www.freedesktop.org/wiki/Software/XKeyboardConfig + + +API +=== + +While xkbcommon's API is somewhat derived from the classic XKB API as found +in <X11/extensions/XKB.h> and friends, it has been substantially reworked to +expose fewer internal details to clients. The only supported API is available +in <xkbcommon/xkbcommon.h>. Any definition not in this header (including +accessing internal structures through the old macros previously available) +should be regarded as an implementation detail and is liable to change at any +time. + +During its early development, xkbcommon does not promise API or ABI stability. +Regardless, we will attempt to not break ABI during a minor release series, +so applications written against 0.1.0 should be completely compatible with +0.1.3, but not necessarily with 0.2.0. However, new symbols may be introduced +in any release. Thus, anyone packaging xkbcommon should make sure any package +depending on it depends on a release greater than or equal to the version it +was built against (or earlier, if it doesn't use any newly-introduced +symbols), but less than the next major release. + +xkbcommon 1.x will offer full API and ABI stability for its lifetime, with a +soname of libxkbcommon.so.1. Any ABI breaks will wait until xkbcommon 2.0, +which will be libxkbcommon.so.2. + +The xkbcomp command-line tool has also been removed, although this will +likely reappear in a later release. + + +Relation to X11 +=============== + +Relative to the XKB 1.1 specification implemented in current X servers, +xkbcommon has removed support for some parts of the specification which +introduced unnecessary complications. Many of these removals were in fact +not implemented, or half-implemented at best, as well as being totally +unused in the standard dataset. + +Notable removals: + - geometry support + + there were very few geometry definitions available, and while + xkbcommon was responsible for parsing this insanely complex format, + it never actually did anything with it + + hopefully someone will develop a companion library which supports + keyboard geometries in a more useful format + - KcCGST (keycodes/compat/geometry/symbols/types) API + + use RMLVO instead; KcCGST is now an implementation detail + + including pre-defined keymap files + - XKM support + + may come in an optional X11 support/compatibility library + - around half of the interpret actions + + pointer device, message and redirect actions in particular + - non-virtual modifiers + + core and virtual modifiers have been collapsed into the same + namespace, with a 'significant' flag that largely parallels the + core/virtual split + - radio groups + + completely unused in current keymaps, never fully implemented + - overlays + + almost completely unused in current keymaps + - key behaviors + + used to implement radio groups and overlays, and to deal with things + like keys that physically lock; unused in current keymaps + - indicator behaviours such as LED-controls-key + + the only supported LED behaviour is key-controls-LED; again this + was never really used in current keymaps + +Notable additions: + - 32-bit keycodes + - extended number of modifiers + - extended number of groups + - multiple keysyms per level + + this requires incompatible dataset changes, such that X11 would + not be able to parse these + + +Development +=========== + +An extremely rudimentary homepage can be found at: + http://xkbcommon.org + +xkbcommon is maintained in git at freedesktop.org: + git://anongit.freedesktop.org/git/libxkbcommon + +Patches are always welcome, and may be sent to either xorg-devel@lists.x.org, +or wayland-devel@lists.freedesktop.org. Bugs are tracked in Bugzilla at: + http://bugs.freedesktop.org + +The maintainer is Daniel Stone, who can be reached at: + <daniel@fooishbar.org> + + +Credits +======= + +Many thanks are due to Dan Nicholson for his heroic work in getting xkbcommon +off the ground initially, as well as to Ran Benita for subsequent development. diff --git a/src/3rdparty/xkbcommon/src/atom.c b/src/3rdparty/xkbcommon/src/atom.c new file mode 100644 index 0000000000..a77502336e --- /dev/null +++ b/src/3rdparty/xkbcommon/src/atom.c @@ -0,0 +1,248 @@ +/*********************************************************** + * Copyright 1987, 1998 The Open Group + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of The Open Group shall not be + * used in advertising or otherwise to promote the sale, use or other dealings + * in this Software without prior written authorization from The Open Group. + * + * + * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + * + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * + ******************************************************************/ + +/************************************************************ + * Copyright 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +#include "utils.h" +#include "atom.h" + +struct atom_node { + struct atom_node *left, *right; + xkb_atom_t atom; + unsigned int fingerprint; + char *string; +}; + +struct atom_table { + struct atom_node *root; + darray(struct atom_node *) table; +}; + +struct atom_table * +atom_table_new(void) +{ + struct atom_table *table; + + table = calloc(1, sizeof(*table)); + if (!table) + return NULL; + + darray_init(table->table); + darray_growalloc(table->table, 100); + darray_append(table->table, NULL); + + return table; +} + +static void +free_atom(struct atom_node *patom) +{ + if (!patom) + return; + + free_atom(patom->left); + free_atom(patom->right); + free(patom->string); + free(patom); +} + +void +atom_table_free(struct atom_table *table) +{ + if (!table) + return; + + free_atom(table->root); + darray_free(table->table); + free(table); +} + +const char * +atom_text(struct atom_table *table, xkb_atom_t atom) +{ + if (atom >= darray_size(table->table) || + darray_item(table->table, atom) == NULL) + return NULL; + + return darray_item(table->table, atom)->string; +} + +char * +atom_strdup(struct atom_table *table, xkb_atom_t atom) +{ + return strdup_safe(atom_text(table, atom)); +} + +static bool +find_node_pointer(struct atom_table *table, const char *string, + struct atom_node ***np_out, unsigned int *fingerprint_out) +{ + struct atom_node **np; + unsigned i; + int comp; + unsigned int fp = 0; + size_t len; + bool found = false; + + len = strlen(string); + np = &table->root; + for (i = 0; i < (len + 1) / 2; i++) { + fp = fp * 27 + string[i]; + fp = fp * 27 + string[len - 1 - i]; + } + + while (*np) { + if (fp < (*np)->fingerprint) { + np = &((*np)->left); + } + else if (fp > (*np)->fingerprint) { + np = &((*np)->right); + } + else { + /* now start testing the strings */ + comp = strncmp(string, (*np)->string, len); + if (comp < 0 || (comp == 0 && len < strlen((*np)->string))) { + np = &((*np)->left); + } + else if (comp > 0) { + np = &((*np)->right); + } + else { + found = true; + break; + } + } + } + + *fingerprint_out = fp; + *np_out = np; + return found; +} + +xkb_atom_t +atom_lookup(struct atom_table *table, const char *string) +{ + struct atom_node **np; + unsigned int fp; + + if (!string) + return XKB_ATOM_NONE; + + if (!find_node_pointer(table, string, &np, &fp)) + return XKB_ATOM_NONE; + + return (*np)->atom; +} + +/* + * If steal is true, we do not strdup @string; therefore it must be + * dynamically allocated, not be free'd by the caller and not be used + * afterwards. Use to avoid some redundant allocations. + */ +xkb_atom_t +atom_intern(struct atom_table *table, const char *string, + bool steal) +{ + struct atom_node **np; + struct atom_node *nd; + unsigned int fp; + + if (!string) + return XKB_ATOM_NONE; + + if (find_node_pointer(table, string, &np, &fp)) { + if (steal) + free(UNCONSTIFY(string)); + return (*np)->atom; + } + + nd = malloc(sizeof(*nd)); + if (!nd) + return XKB_ATOM_NONE; + + if (steal) { + nd->string = UNCONSTIFY(string); + } + else { + nd->string = strdup(string); + if (!nd->string) { + free(nd); + return XKB_ATOM_NONE; + } + } + + *np = nd; + nd->left = nd->right = NULL; + nd->fingerprint = fp; + nd->atom = darray_size(table->table); + darray_append(table->table, nd); + + return nd->atom; +} diff --git a/src/3rdparty/xkbcommon/src/atom.h b/src/3rdparty/xkbcommon/src/atom.h new file mode 100644 index 0000000000..f1abf1b72f --- /dev/null +++ b/src/3rdparty/xkbcommon/src/atom.h @@ -0,0 +1,52 @@ +/* + * Copyright © 2009 Dan Nicholson + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef ATOM_H +#define ATOM_H + +typedef uint32_t xkb_atom_t; + +#define XKB_ATOM_NONE 0 + +struct atom_table; + +struct atom_table * +atom_table_new(void); + +void +atom_table_free(struct atom_table *table); + +xkb_atom_t +atom_lookup(struct atom_table *table, const char *string); + +xkb_atom_t +atom_intern(struct atom_table *table, const char *string, + bool steal); + +char * +atom_strdup(struct atom_table *table, xkb_atom_t atom); + +const char * +atom_text(struct atom_table *table, xkb_atom_t atom); + +#endif /* ATOM_H */ diff --git a/src/3rdparty/xkbcommon/src/context.c b/src/3rdparty/xkbcommon/src/context.c new file mode 100644 index 0000000000..8d56487004 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/context.c @@ -0,0 +1,492 @@ +/* + * Copyright © 2012 Intel Corporation + * Copyright © 2012 Ran Benita + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + */ + +#include <sys/types.h> +#include <sys/stat.h> +#include <ctype.h> +#include <errno.h> +#include <unistd.h> + +#include "xkbcommon/xkbcommon.h" +#include "utils.h" +#include "context.h" + +struct xkb_context { + int refcnt; + + ATTR_PRINTF(3, 0) void (*log_fn)(struct xkb_context *ctx, + enum xkb_log_level level, + const char *fmt, va_list args); + enum xkb_log_level log_level; + int log_verbosity; + void *user_data; + + struct xkb_rule_names names_dflt; + + darray(char *) includes; + darray(char *) failed_includes; + + struct atom_table *atom_table; + + /* Buffer for the *Text() functions. */ + char text_buffer[2048]; + size_t text_next; + + unsigned int use_environment_names : 1; +}; + +/** + * Append one directory to the context's include path. + */ +XKB_EXPORT int +xkb_context_include_path_append(struct xkb_context *ctx, const char *path) +{ + struct stat stat_buf; + int err; + char *tmp; + + tmp = strdup(path); + if (!tmp) + goto err; + + err = stat(path, &stat_buf); + if (err != 0) + goto err; + if (!S_ISDIR(stat_buf.st_mode)) + goto err; + +#if defined(HAVE_EACCESS) + if (eaccess(path, R_OK | X_OK) != 0) + goto err; +#elif defined(HAVE_EUIDACCESS) + if (euidaccess(path, R_OK | X_OK) != 0) + goto err; +#endif + + darray_append(ctx->includes, tmp); + return 1; + +err: + darray_append(ctx->failed_includes, tmp); + return 0; +} + +/** + * Append the default include directories to the context. + */ +XKB_EXPORT int +xkb_context_include_path_append_default(struct xkb_context *ctx) +{ + const char *home; + char *user_path; + int err; + int ret = 0; + + ret |= xkb_context_include_path_append(ctx, DFLT_XKB_CONFIG_ROOT); + + home = getenv("HOME"); + if (!home) + return ret; + err = asprintf(&user_path, "%s/.xkb", home); + if (err <= 0) + return ret; + ret |= xkb_context_include_path_append(ctx, user_path); + free(user_path); + + return ret; +} + +/** + * Remove all entries in the context's include path. + */ +XKB_EXPORT void +xkb_context_include_path_clear(struct xkb_context *ctx) +{ + char **path; + + darray_foreach(path, ctx->includes) + free(*path); + darray_free(ctx->includes); + + darray_foreach(path, ctx->failed_includes) + free(*path); + darray_free(ctx->failed_includes); +} + +/** + * xkb_context_include_path_clear() + xkb_context_include_path_append_default() + */ +XKB_EXPORT int +xkb_context_include_path_reset_defaults(struct xkb_context *ctx) +{ + xkb_context_include_path_clear(ctx); + return xkb_context_include_path_append_default(ctx); +} + +/** + * Returns the number of entries in the context's include path. + */ +XKB_EXPORT unsigned int +xkb_context_num_include_paths(struct xkb_context *ctx) +{ + return darray_size(ctx->includes); +} + +unsigned int +xkb_context_num_failed_include_paths(struct xkb_context *ctx) +{ + return darray_size(ctx->failed_includes); +} + +/** + * Returns the given entry in the context's include path, or NULL if an + * invalid index is passed. + */ +XKB_EXPORT const char * +xkb_context_include_path_get(struct xkb_context *ctx, unsigned int idx) +{ + if (idx >= xkb_context_num_include_paths(ctx)) + return NULL; + + return darray_item(ctx->includes, idx); +} + +const char * +xkb_context_failed_include_path_get(struct xkb_context *ctx, + unsigned int idx) +{ + if (idx >= xkb_context_num_failed_include_paths(ctx)) + return NULL; + + return darray_item(ctx->failed_includes, idx); +} + +/** + * Take a new reference on the context. + */ +XKB_EXPORT struct xkb_context * +xkb_context_ref(struct xkb_context *ctx) +{ + ctx->refcnt++; + return ctx; +} + +/** + * Drop an existing reference on the context, and free it if the refcnt is + * now 0. + */ +XKB_EXPORT void +xkb_context_unref(struct xkb_context *ctx) +{ + if (!ctx || --ctx->refcnt > 0) + return; + + xkb_context_include_path_clear(ctx); + atom_table_free(ctx->atom_table); + free(ctx); +} + +static const char * +log_level_to_prefix(enum xkb_log_level level) +{ + switch (level) { + case XKB_LOG_LEVEL_DEBUG: + return "Debug:"; + case XKB_LOG_LEVEL_INFO: + return "Info:"; + case XKB_LOG_LEVEL_WARNING: + return "Warning:"; + case XKB_LOG_LEVEL_ERROR: + return "Error:"; + case XKB_LOG_LEVEL_CRITICAL: + return "Critical:"; + default: + return NULL; + } +} + +ATTR_PRINTF(3, 0) static void +default_log_fn(struct xkb_context *ctx, enum xkb_log_level level, + const char *fmt, va_list args) +{ + const char *prefix = log_level_to_prefix(level); + + if (prefix) + fprintf(stderr, "%-10s", prefix); + vfprintf(stderr, fmt, args); +} + +static enum xkb_log_level +log_level(const char *level) { + char *endptr; + enum xkb_log_level lvl; + + errno = 0; + lvl = strtol(level, &endptr, 10); + if (errno == 0 && (endptr[0] == '\0' || isspace(endptr[0]))) + return lvl; + if (istreq_prefix("crit", level)) + return XKB_LOG_LEVEL_CRITICAL; + if (istreq_prefix("err", level)) + return XKB_LOG_LEVEL_ERROR; + if (istreq_prefix("warn", level)) + return XKB_LOG_LEVEL_WARNING; + if (istreq_prefix("info", level)) + return XKB_LOG_LEVEL_INFO; + if (istreq_prefix("debug", level) || istreq_prefix("dbg", level)) + return XKB_LOG_LEVEL_DEBUG; + + return XKB_LOG_LEVEL_ERROR; +} + +static int +log_verbosity(const char *verbosity) { + char *endptr; + int v; + + errno = 0; + v = strtol(verbosity, &endptr, 10); + if (errno == 0) + return v; + + return 0; +} + +#ifndef DEFAULT_XKB_VARIANT +#define DEFAULT_XKB_VARIANT NULL +#endif + +#ifndef DEFAULT_XKB_OPTIONS +#define DEFAULT_XKB_OPTIONS NULL +#endif + +/** + * Create a new context. + */ +XKB_EXPORT struct xkb_context * +xkb_context_new(enum xkb_context_flags flags) +{ + const char *env; + struct xkb_context *ctx = calloc(1, sizeof(*ctx)); + + if (!ctx) + return NULL; + + ctx->refcnt = 1; + ctx->log_fn = default_log_fn; + ctx->log_level = XKB_LOG_LEVEL_ERROR; + ctx->log_verbosity = 0; + + /* Environment overwrites defaults. */ + env = getenv("XKB_LOG_LEVEL"); + if (env) + xkb_context_set_log_level(ctx, log_level(env)); + + env = getenv("XKB_LOG_VERBOSITY"); + if (env) + xkb_context_set_log_verbosity(ctx, log_verbosity(env)); + + if (!(flags & XKB_CONTEXT_NO_DEFAULT_INCLUDES) && + !xkb_context_include_path_append_default(ctx)) { + log_err(ctx, "failed to add default include path %s\n", + DFLT_XKB_CONFIG_ROOT); + xkb_context_unref(ctx); + return NULL; + } + + ctx->use_environment_names = !(flags & XKB_CONTEXT_NO_ENVIRONMENT_NAMES); + + ctx->atom_table = atom_table_new(); + if (!ctx->atom_table) { + xkb_context_unref(ctx); + return NULL; + } + + return ctx; +} + +xkb_atom_t +xkb_atom_lookup(struct xkb_context *ctx, const char *string) +{ + return atom_lookup(ctx->atom_table, string); +} + +xkb_atom_t +xkb_atom_intern(struct xkb_context *ctx, const char *string) +{ + return atom_intern(ctx->atom_table, string, false); +} + +xkb_atom_t +xkb_atom_steal(struct xkb_context *ctx, char *string) +{ + return atom_intern(ctx->atom_table, string, true); +} + +char * +xkb_atom_strdup(struct xkb_context *ctx, xkb_atom_t atom) +{ + return atom_strdup(ctx->atom_table, atom); +} + +const char * +xkb_atom_text(struct xkb_context *ctx, xkb_atom_t atom) +{ + return atom_text(ctx->atom_table, atom); +} + +void +xkb_log(struct xkb_context *ctx, enum xkb_log_level level, + const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + ctx->log_fn(ctx, level, fmt, args); + va_end(args); +} + +XKB_EXPORT void +xkb_context_set_log_fn(struct xkb_context *ctx, + void (*log_fn)(struct xkb_context *ctx, + enum xkb_log_level level, + const char *fmt, va_list args)) +{ + ctx->log_fn = (log_fn ? log_fn : default_log_fn); +} + +XKB_EXPORT enum xkb_log_level +xkb_context_get_log_level(struct xkb_context *ctx) +{ + return ctx->log_level; +} + +XKB_EXPORT void +xkb_context_set_log_level(struct xkb_context *ctx, enum xkb_log_level level) +{ + ctx->log_level = level; +} + +XKB_EXPORT int +xkb_context_get_log_verbosity(struct xkb_context *ctx) +{ + return ctx->log_verbosity; +} + +XKB_EXPORT void +xkb_context_set_log_verbosity(struct xkb_context *ctx, int verbosity) +{ + ctx->log_verbosity = verbosity; +} + +XKB_EXPORT void * +xkb_context_get_user_data(struct xkb_context *ctx) +{ + if (ctx) + return ctx->user_data; + return NULL; +} + +XKB_EXPORT void +xkb_context_set_user_data(struct xkb_context *ctx, void *user_data) +{ + ctx->user_data = user_data; +} + +char * +xkb_context_get_buffer(struct xkb_context *ctx, size_t size) +{ + char *rtrn; + + if (size >= sizeof(ctx->text_buffer)) + return NULL; + + if (sizeof(ctx->text_buffer) - ctx->text_next <= size) + ctx->text_next = 0; + + rtrn = &ctx->text_buffer[ctx->text_next]; + ctx->text_next += size; + + return rtrn; +} + +const char * +xkb_context_get_default_rules(struct xkb_context *ctx) +{ + const char *env = NULL; + + if (ctx->use_environment_names) + env = getenv("XKB_DEFAULT_RULES"); + + return env ? env : DEFAULT_XKB_RULES; +} + +const char * +xkb_context_get_default_model(struct xkb_context *ctx) +{ + const char *env = NULL; + + if (ctx->use_environment_names) + env = getenv("XKB_DEFAULT_MODEL"); + + return env ? env : DEFAULT_XKB_MODEL; +} + +const char * +xkb_context_get_default_layout(struct xkb_context *ctx) +{ + const char *env = NULL; + + if (ctx->use_environment_names) + env = getenv("XKB_DEFAULT_LAYOUT"); + + return env ? env : DEFAULT_XKB_LAYOUT; +} + +const char * +xkb_context_get_default_variant(struct xkb_context *ctx) +{ + const char *env = NULL; + const char *layout = getenv("XKB_DEFAULT_VARIANT"); + + /* We don't want to inherit the variant if they haven't also set a + * layout, since they're so closely paired. */ + if (layout && ctx->use_environment_names) + env = getenv("XKB_DEFAULT_VARIANT"); + + return env ? env : DEFAULT_XKB_VARIANT; +} + +const char * +xkb_context_get_default_options(struct xkb_context *ctx) +{ + const char *env = NULL; + + if (ctx->use_environment_names) + env = getenv("XKB_DEFAULT_OPTIONS"); + + return env ? env : DEFAULT_XKB_OPTIONS; +} diff --git a/src/3rdparty/xkbcommon/src/context.h b/src/3rdparty/xkbcommon/src/context.h new file mode 100644 index 0000000000..7c061a086f --- /dev/null +++ b/src/3rdparty/xkbcommon/src/context.h @@ -0,0 +1,124 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + */ + +#ifndef CONTEXT_H +#define CONTEXT_H + +#include "atom.h" + +unsigned int +xkb_context_num_failed_include_paths(struct xkb_context *ctx); + +const char * +xkb_context_failed_include_path_get(struct xkb_context *ctx, + unsigned int idx); + +/* + * Returns XKB_ATOM_NONE if @string was not previously interned, + * otherwise returns the atom. + */ +xkb_atom_t +xkb_atom_lookup(struct xkb_context *ctx, const char *string); + +xkb_atom_t +xkb_atom_intern(struct xkb_context *ctx, const char *string); + +/** + * If @string is dynamically allocated, free'd immediately after + * being interned, and not used afterwards, use this function + * instead of xkb_atom_intern to avoid some unnecessary allocations. + * The caller should not use or free the passed in string afterwards. + */ +xkb_atom_t +xkb_atom_steal(struct xkb_context *ctx, char *string); + +char * +xkb_atom_strdup(struct xkb_context *ctx, xkb_atom_t atom); + +const char * +xkb_atom_text(struct xkb_context *ctx, xkb_atom_t atom); + +char * +xkb_context_get_buffer(struct xkb_context *ctx, size_t size); + +ATTR_PRINTF(3, 4) void +xkb_log(struct xkb_context *ctx, enum xkb_log_level level, + const char *fmt, ...); + +#define xkb_log_cond_level(ctx, level, ...) do { \ + if (xkb_context_get_log_level(ctx) >= (level)) \ + xkb_log((ctx), (level), __VA_ARGS__); \ +} while (0) + +#define xkb_log_cond_verbosity(ctx, level, vrb, ...) do { \ + if (xkb_context_get_log_verbosity(ctx) >= (vrb)) \ + xkb_log_cond_level((ctx), (level), __VA_ARGS__); \ +} while (0) + +const char * +xkb_context_get_default_rules(struct xkb_context *ctx); + +const char * +xkb_context_get_default_model(struct xkb_context *ctx); + +const char * +xkb_context_get_default_layout(struct xkb_context *ctx); + +const char * +xkb_context_get_default_variant(struct xkb_context *ctx); + +const char * +xkb_context_get_default_options(struct xkb_context *ctx); + +/* + * The format is not part of the argument list in order to avoid the + * "ISO C99 requires rest arguments to be used" warning when only the + * format is supplied without arguments. Not supplying it would still + * result in an error, though. + */ +#define log_dbg(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_DEBUG, __VA_ARGS__) +#define log_info(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_INFO, __VA_ARGS__) +#define log_warn(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_WARNING, __VA_ARGS__) +#define log_err(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_ERROR, __VA_ARGS__) +#define log_wsgo(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_CRITICAL, __VA_ARGS__) +#define log_vrb(ctx, vrb, ...) \ + xkb_log_cond_verbosity((ctx), XKB_LOG_LEVEL_WARNING, (vrb), __VA_ARGS__) + +/* + * Variants which are prefixed by the name of the function they're + * called from. + * Here we must have the silly 1 variant. + */ +#define log_err_func(ctx, fmt, ...) \ + log_err(ctx, "%s: " fmt, __func__, __VA_ARGS__) +#define log_err_func1(ctx, fmt) \ + log_err(ctx, "%s: " fmt, __func__) + +#endif diff --git a/src/3rdparty/xkbcommon/src/darray.h b/src/3rdparty/xkbcommon/src/darray.h new file mode 100644 index 0000000000..0cf3747be7 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/darray.h @@ -0,0 +1,388 @@ +/* + * Copyright (C) 2011 Joseph Adams <joeyadams3.14159@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef CCAN_DARRAY_H +#define CCAN_DARRAY_H + +#include <stdlib.h> +#include <string.h> + +/* + * SYNOPSIS + * + * Life cycle of a darray (dynamically-allocated array): + * + * darray(int) a = darray_new(); + * darray_free(a); + * + * struct {darray(int) a;} foo; + * darray_init(foo.a); + * darray_free(foo.a); + * + * Typedefs for darrays of common types: + * + * darray_char, darray_schar, darray_uchar + * darray_short, darray_int, darray_long + * darray_ushort, darray_uint, darray_ulong + * + * Access: + * + * T darray_item(darray(T) arr, size_t index); + * size_t darray_size(darray(T) arr); + * size_t darray_alloc(darray(T) arr); + * bool darray_empty(darray(T) arr); + * + * // Access raw memory, starting from the item in offset. + * // Not safe, be careful, etc. + * T* darray_mem(darray(T) arr, size_t offset); + * + * Insertion (single item): + * + * void darray_append(darray(T) arr, T item); + * void darray_prepend(darray(T) arr, T item); + * void darray_push(darray(T) arr, T item); // same as darray_append + * + * Insertion (multiple items): + * + * void darray_append_items(darray(T) arr, T *items, size_t count); + * void darray_prepend_items(darray(T) arr, T *items, size_t count); + * + * void darray_appends(darray(T) arr, [T item, [...]]); + * void darray_prepends(darray(T) arr, [T item, [...]]); + * + * Removal: + * + * T darray_pop(darray(T) arr | darray_size(arr) != 0); + * T* darray_pop_check(darray(T*) arr); + * + * Replacement: + * + * void darray_from_items(darray(T) arr, T *items, size_t count); + * void darray_from_c(darray(T) arr, T c_array[N]); + * + * String buffer: + * + * void darray_append_string(darray(char) arr, const char *str); + * void darray_append_lit(darray(char) arr, char stringLiteral[N+1]); + * + * void darray_prepend_string(darray(char) arr, const char *str); + * void darray_prepend_lit(darray(char) arr, char stringLiteral[N+1]); + * + * void darray_from_string(darray(T) arr, const char *str); + * void darray_from_lit(darray(char) arr, char stringLiteral[N+1]); + * + * Size management: + * + * void darray_resize(darray(T) arr, size_t newSize); + * void darray_resize0(darray(T) arr, size_t newSize); + * + * void darray_realloc(darray(T) arr, size_t newAlloc); + * void darray_growalloc(darray(T) arr, size_t newAlloc); + * + * Traversal: + * + * darray_foreach(T *&i, darray(T) arr) {...} + * darray_foreach_reverse(T *&i, darray(T) arr) {...} + * + * Except for darray_foreach and darray_foreach_reverse, + * all macros evaluate their non-darray arguments only once. + */ + +/*** Life cycle ***/ + +#define darray(type) struct { type *item; size_t size; size_t alloc; } + +#define darray_new() { 0, 0, 0 } + +#define darray_init(arr) do { \ + (arr).item = 0; (arr).size = 0; (arr).alloc = 0; \ +} while (0) + +#define darray_free(arr) do { \ + free((arr).item); darray_init(arr); \ +} while (0) + +/* + * Typedefs for darrays of common types. These are useful + * when you want to pass a pointer to an darray(T) around. + * + * The following will produce an incompatible pointer warning: + * + * void foo(darray(int) *arr); + * darray(int) arr = darray_new(); + * foo(&arr); + * + * The workaround: + * + * void foo(darray_int *arr); + * darray_int arr = darray_new(); + * foo(&arr); + */ + +typedef darray (char) darray_char; +typedef darray (signed char) darray_schar; +typedef darray (unsigned char) darray_uchar; + +typedef darray (short) darray_short; +typedef darray (int) darray_int; +typedef darray (long) darray_long; + +typedef darray (unsigned short) darray_ushort; +typedef darray (unsigned int) darray_uint; +typedef darray (unsigned long) darray_ulong; + +/*** Access ***/ + +#define darray_item(arr, i) ((arr).item[i]) +#define darray_size(arr) ((arr).size) +#define darray_alloc(arr) ((arr).alloc) +#define darray_empty(arr) ((arr).size == 0) + +#define darray_mem(arr, offset) ((arr).item + (offset)) +#define darray_same(arr1, arr2) ((arr1).item == (arr2).item) + +/*** Insertion (single item) ***/ + +#define darray_append(arr, ...) do { \ + darray_resize(arr, (arr).size + 1); \ + (arr).item[(arr).size - 1] = (__VA_ARGS__); \ +} while (0) + +#define darray_prepend(arr, ...) do { \ + darray_resize(arr, (arr).size + 1); \ + memmove((arr).item + 1, (arr).item, \ + ((arr).size - 1) * sizeof(*(arr).item)); \ + (arr).item[0] = (__VA_ARGS__); \ +} while (0) + +#define darray_push(arr, ...) darray_append(arr, __VA_ARGS__) + +/*** Insertion (multiple items) ***/ + +#define darray_append_items(arr, items, count) do { \ + size_t __count = (count), __oldSize = (arr).size; \ + darray_resize(arr, __oldSize + __count); \ + memcpy((arr).item + __oldSize, items, __count * sizeof(*(arr).item)); \ +} while (0) + +#define darray_prepend_items(arr, items, count) do { \ + size_t __count = (count), __oldSize = (arr).size; \ + darray_resize(arr, __count + __oldSize); \ + memmove((arr).item + __count, (arr).item, \ + __oldSize * sizeof(*(arr).item)); \ + memcpy((arr).item, items, __count * sizeof(*(arr).item)); \ +} while (0) + +#define darray_append_items_nullterminate(arr, items, count) do { \ + size_t __count = (count), __oldSize = (arr).size; \ + darray_resize(arr, __oldSize + __count + 1); \ + memcpy((arr).item + __oldSize, items, __count * sizeof(*(arr).item)); \ + (arr).item[--(arr).size] = 0; \ +} while (0) + +#define darray_prepend_items_nullterminate(arr, items, count) do { \ + size_t __count = (count), __oldSize = (arr).size; \ + darray_resize(arr, __count + __oldSize + 1); \ + memmove((arr).item + __count, (arr).item, \ + __oldSize * sizeof(*(arr).item)); \ + memcpy((arr).item, items, __count * sizeof(*(arr).item)); \ + (arr).item[--(arr).size] = 0; \ +} while (0) + +#define darray_appends_t(arr, type, ...) do { \ + type __src[] = { __VA_ARGS__ }; \ + darray_append_items(arr, __src, sizeof(__src) / sizeof(*__src)); \ +} while (0) + +#define darray_prepends_t(arr, type, ...) do { \ + type __src[] = { __VA_ARGS__ }; \ + darray_prepend_items(arr, __src, sizeof(__src) / sizeof(*__src)); \ +} while (0) + +/*** Removal ***/ + +/* Warning: Do not call darray_pop on an empty darray. */ +#define darray_pop(arr) ((arr).item[--(arr).size]) +#define darray_pop_check(arr) ((arr).size ? darray_pop(arr) : NULL) + +/*** Replacement ***/ + +#define darray_from_items(arr, items, count) do { \ + size_t __count = (count); \ + darray_resize(arr, __count); \ + memcpy((arr).item, items, __count * sizeof(*(arr).item)); \ +} while (0) + +#define darray_from_c(arr, c_array) \ + darray_from_items(arr, c_array, sizeof(c_array) / sizeof(*(c_array))) + +#define darray_copy(arr_to, arr_from) \ + darray_from_items((arr_to), (arr_from).item, (arr_from).size) + +/*** String buffer ***/ + +#define darray_append_string(arr, str) do { \ + const char *__str = (str); \ + darray_append_items(arr, __str, strlen(__str) + 1); \ + (arr).size--; \ +} while (0) + +#define darray_append_lit(arr, stringLiteral) do { \ + darray_append_items(arr, stringLiteral, sizeof(stringLiteral)); \ + (arr).size--; \ +} while (0) + +#define darray_prepend_string(arr, str) do { \ + const char *__str = (str); \ + darray_prepend_items_nullterminate(arr, __str, strlen(__str)); \ +} while (0) + +#define darray_prepend_lit(arr, stringLiteral) \ + darray_prepend_items_nullterminate(arr, stringLiteral, \ + sizeof(stringLiteral) - 1) + +#define darray_from_string(arr, str) do { \ + const char *__str = (str); \ + darray_from_items(arr, __str, strlen(__str) + 1); \ + (arr).size--; \ +} while (0) + +#define darray_from_lit(arr, stringLiteral) do { \ + darray_from_items(arr, stringLiteral, sizeof(stringLiteral)); \ + (arr).size--; \ +} while (0) + +/*** Size management ***/ + +#define darray_resize(arr, newSize) \ + darray_growalloc(arr, (arr).size = (newSize)) + +#define darray_resize0(arr, newSize) do { \ + size_t __oldSize = (arr).size, __newSize = (newSize); \ + (arr).size = __newSize; \ + if (__newSize > __oldSize) { \ + darray_growalloc(arr, __newSize); \ + memset(&(arr).item[__oldSize], 0, \ + (__newSize - __oldSize) * sizeof(*(arr).item)); \ + } \ +} while (0) + +#define darray_realloc(arr, newAlloc) do { \ + (arr).item = realloc((arr).item, \ + ((arr).alloc = (newAlloc)) * sizeof(*(arr).item)); \ +} while (0) + +#define darray_growalloc(arr, need) do { \ + size_t __need = (need); \ + if (__need > (arr).alloc) \ + darray_realloc(arr, darray_next_alloc((arr).alloc, __need)); \ +} while (0) + +static inline size_t +darray_next_alloc(size_t alloc, size_t need) +{ + if (alloc == 0) + alloc = 4; + while (alloc < need) + alloc *= 2; + return alloc; +} + +/*** Traversal ***/ + +/* + * darray_foreach(T *&i, darray(T) arr) {...} + * + * Traverse a darray. `i` must be declared in advance as a pointer to an item. + */ +#define darray_foreach(i, arr) \ + for ((i) = &(arr).item[0]; (i) < &(arr).item[(arr).size]; (i)++) + +#define darray_foreach_from(i, arr, from) \ + for ((i) = &(arr).item[from]; (i) < &(arr).item[(arr).size]; (i)++) + +/* Iterate on index and value at the same time, like Python's enumerate. */ +#define darray_enumerate(idx, val, arr) \ + for ((idx) = 0, (val) = &(arr).item[0]; \ + (idx) < (arr).size; \ + (idx)++, (val)++) + +#define darray_enumerate_from(idx, val, arr, from) \ + for ((idx) = (from), (val) = &(arr).item[0]; \ + (idx) < (arr).size; \ + (idx)++, (val)++) + +/* + * darray_foreach_reverse(T *&i, darray(T) arr) {...} + * + * Like darray_foreach, but traverse in reverse order. + */ +#define darray_foreach_reverse(i, arr) \ + for ((i) = &(arr).item[(arr).size]; (i)-- > &(arr).item[0]; ) + +#endif /* CCAN_DARRAY_H */ + +/* + * + * darray_growalloc(arr, newAlloc) sees if the darray can currently hold newAlloc items; + * if not, it increases the alloc to satisfy this requirement, allocating slack + * space to avoid having to reallocate for every size increment. + * + * darray_from_string(arr, str) copies a string to an darray_char. + * + * darray_push(arr, item) pushes an item to the end of the darray. + * darray_pop(arr) pops it back out. Be sure there is at least one item in the darray before calling. + * darray_pop_check(arr) does the same as darray_pop, but returns NULL if there are no more items left in the darray. + * + * darray_make_room(arr, room) ensures there's 'room' elements of space after the end of the darray, and it returns a pointer to this space. + * Currently requires HAVE_STATEMENT_EXPR, but I plan to remove this dependency by creating an inline function. + * + * The following require HAVE_TYPEOF==1 : + * + * darray_appends(arr, item0, item1...) appends a collection of comma-delimited items to the darray. + * darray_prepends(arr, item0, item1...) prepends a collection of comma-delimited items to the darray.\ + * + * + * Examples: + * + * darray(int) arr; + * int *i; + * + * darray_appends(arr, 0,1,2,3,4); + * darray_appends(arr, -5,-4,-3,-2,-1); + * darray_foreach(i, arr) + * printf("%d ", *i); + * printf("\n"); + * + * darray_free(arr); + * + * + * typedef struct {int n,d;} Fraction; + * darray(Fraction) fractions; + * Fraction *i; + * + * darray_appends(fractions, {3,4}, {3,5}, {2,1}); + * darray_foreach(i, fractions) + * printf("%d/%d\n", i->n, i->d); + * + * darray_free(fractions); + */ diff --git a/src/3rdparty/xkbcommon/src/keymap.h b/src/3rdparty/xkbcommon/src/keymap.h new file mode 100644 index 0000000000..c6b884d6bc --- /dev/null +++ b/src/3rdparty/xkbcommon/src/keymap.h @@ -0,0 +1,451 @@ +/* + * Copyright 1985, 1987, 1990, 1998 The Open Group + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the names of the authors or their + * institutions shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the authors. + */ + +/************************************************************ + * Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +/* + * Copyright © 2009 Dan Nicholson + * Copyright © 2012 Intel Corporation + * Copyright © 2012 Ran Benita + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + * Dan Nicholson <dbn.lists@gmail.com> + */ + +#ifndef KEYMAP_H +#define KEYMAP_H + + /* Don't use compat names in internal code. */ +#define _XKBCOMMON_COMPAT_H +#include "xkbcommon/xkbcommon.h" + +#include "utils.h" +#include "context.h" + +/* This limit is artificially enforced, we do not depend on it any where. + * The reason it's still here is that the rules file format does not + * support multiple groups very well, and the rules shipped with + * xkeyboard-config (see rules/evdev) depend on this limit extensively. + * So just lifting this limit would cause problems for people who will use + * more than 4 layouts. + * TODO: Fix the group index syntax in the rules format, preferably in a + * backwards compatible way. + * See e.g. https://bugs.freedesktop.org/show_bug.cgi?id=14372 + * Note: A limit on the number of groups we *do* depend on is imposed by + * the size of the xkb_layout_mask_t type (32). This is more than enough + * though. + */ +#define XKB_MAX_GROUPS 4 + +/* Don't allow more modifiers than we can hold in xkb_mod_mask_t. */ +#define XKB_MAX_MODS ((xkb_mod_index_t) (sizeof(xkb_mod_mask_t) * 8)) + +/* Don't allow more leds than we can hold in xkb_led_mask_t. */ +#define XKB_MAX_LEDS ((xkb_led_index_t) (sizeof(xkb_led_mask_t) * 8)) + +/* These should all go away. */ +enum mod_type { + MOD_REAL = (1 << 0), + MOD_VIRT = (1 << 1), + MOD_BOTH = (MOD_REAL | MOD_VIRT), +}; +#define MOD_REAL_MASK_ALL ((xkb_mod_mask_t) 0x000000ff) + +enum xkb_action_type { + ACTION_TYPE_NONE = 0, + ACTION_TYPE_MOD_SET, + ACTION_TYPE_MOD_LATCH, + ACTION_TYPE_MOD_LOCK, + ACTION_TYPE_GROUP_SET, + ACTION_TYPE_GROUP_LATCH, + ACTION_TYPE_GROUP_LOCK, + ACTION_TYPE_PTR_MOVE, + ACTION_TYPE_PTR_BUTTON, + ACTION_TYPE_PTR_LOCK, + ACTION_TYPE_PTR_DEFAULT, + ACTION_TYPE_TERMINATE, + ACTION_TYPE_SWITCH_VT, + ACTION_TYPE_CTRL_SET, + ACTION_TYPE_CTRL_LOCK, + ACTION_TYPE_KEY_REDIRECT, + ACTION_TYPE_PRIVATE, + _ACTION_TYPE_NUM_ENTRIES +}; + +enum xkb_action_flags { + ACTION_LOCK_CLEAR = (1 << 0), + ACTION_LATCH_TO_LOCK = (1 << 1), + ACTION_LOCK_NO_LOCK = (1 << 2), + ACTION_LOCK_NO_UNLOCK = (1 << 3), + ACTION_MODS_LOOKUP_MODMAP = (1 << 4), + ACTION_ABSOLUTE_SWITCH = (1 << 5), + ACTION_ABSOLUTE_X = (1 << 6), + ACTION_ABSOLUTE_Y = (1 << 7), + ACTION_NO_ACCEL = (1 << 8), + ACTION_SAME_SCREEN = (1 << 9), +}; + +enum xkb_action_controls { + CONTROL_REPEAT = (1 << 0), + CONTROL_SLOW = (1 << 1), + CONTROL_DEBOUNCE = (1 << 2), + CONTROL_STICKY = (1 << 3), + CONTROL_MOUSEKEYS = (1 << 4), + CONTROL_MOUSEKEYS_ACCEL = (1 << 5), + CONTROL_AX = (1 << 6), + CONTROL_AX_TIMEOUT = (1 << 7), + CONTROL_AX_FEEDBACK = (1 << 8), + CONTROL_BELL = (1 << 9), + CONTROL_IGNORE_GROUP_LOCK = (1 << 10), + CONTROL_ALL = \ + (CONTROL_REPEAT | CONTROL_SLOW | CONTROL_DEBOUNCE | CONTROL_STICKY | \ + CONTROL_MOUSEKEYS | CONTROL_MOUSEKEYS_ACCEL | CONTROL_AX | \ + CONTROL_AX_TIMEOUT | CONTROL_AX_FEEDBACK | CONTROL_BELL | \ + CONTROL_IGNORE_GROUP_LOCK) +}; + +enum xkb_match_operation { + MATCH_NONE, + MATCH_ANY_OR_NONE, + MATCH_ANY, + MATCH_ALL, + MATCH_EXACTLY, +}; + +struct xkb_mods { + xkb_mod_mask_t mods; /* original real+virtual mods in definition */ + xkb_mod_mask_t mask; /* computed effective mask */ +}; + +struct xkb_mod_action { + enum xkb_action_type type; + enum xkb_action_flags flags; + struct xkb_mods mods; +}; + +struct xkb_group_action { + enum xkb_action_type type; + enum xkb_action_flags flags; + int32_t group; +}; + +struct xkb_controls_action { + enum xkb_action_type type; + enum xkb_action_flags flags; + enum xkb_action_controls ctrls; +}; + +struct xkb_pointer_default_action { + enum xkb_action_type type; + enum xkb_action_flags flags; + int8_t value; +}; + +struct xkb_switch_screen_action { + enum xkb_action_type type; + enum xkb_action_flags flags; + int8_t screen; +}; + +struct xkb_redirect_key_action { + enum xkb_action_type type; + enum xkb_action_flags flags; + xkb_keycode_t new_kc; + uint8_t mods_mask; + uint8_t mods; + uint16_t vmods_mask; + uint16_t vmods; +}; + +struct xkb_pointer_action { + enum xkb_action_type type; + enum xkb_action_flags flags; + int16_t x; + int16_t y; +}; + +struct xkb_pointer_button_action { + enum xkb_action_type type; + enum xkb_action_flags flags; + uint8_t count; + int8_t button; +}; + +struct xkb_private_action { + enum xkb_action_type type; + enum xkb_action_flags flags; + uint8_t data[7]; +}; + +union xkb_action { + enum xkb_action_type type; + struct xkb_mod_action mods; + struct xkb_group_action group; + struct xkb_controls_action ctrls; + struct xkb_pointer_default_action dflt; + struct xkb_switch_screen_action screen; + struct xkb_redirect_key_action redirect; /* XXX wholly unnecessary? */ + struct xkb_pointer_action ptr; + struct xkb_pointer_button_action btn; + struct xkb_private_action priv; +}; + +struct xkb_key_type_entry { + xkb_level_index_t level; + struct xkb_mods mods; + struct xkb_mods preserve; +}; + +struct xkb_key_type { + xkb_atom_t name; + struct xkb_mods mods; + xkb_level_index_t num_levels; + xkb_atom_t *level_names; + unsigned int num_entries; + struct xkb_key_type_entry *entries; +}; + +struct xkb_sym_interpret { + xkb_keysym_t sym; + enum xkb_match_operation match; + bool level_one_only; + xkb_mod_mask_t mods; + xkb_mod_index_t virtual_mod; + union xkb_action action; + bool repeat; +}; + +struct xkb_led { + xkb_atom_t name; + enum xkb_state_component which_groups; + xkb_layout_mask_t groups; + enum xkb_state_component which_mods; + struct xkb_mods mods; + enum xkb_action_controls ctrls; +}; + +struct xkb_key_alias { + xkb_atom_t real; + xkb_atom_t alias; +}; + +struct xkb_controls { + unsigned char groups_wrap; + struct xkb_mods internal; + struct xkb_mods ignore_lock; + unsigned short repeat_delay; + unsigned short repeat_interval; + unsigned short slow_keys_delay; + unsigned short debounce_delay; + unsigned short ax_options; + unsigned short ax_timeout; + unsigned short axt_opts_mask; + unsigned short axt_opts_values; + unsigned int axt_ctrls_mask; + unsigned int axt_ctrls_values; +}; + +/* Such an awkward name. Oh well. */ +enum xkb_range_exceed_type { + RANGE_SATURATE, + RANGE_WRAP, + RANGE_REDIRECT, +}; + +enum xkb_explicit_components { + EXPLICIT_INTERP = (1 << 0), + EXPLICIT_VMODMAP = (1 << 1), + EXPLICIT_REPEAT = (1 << 2), +}; + +struct xkb_level { + union xkb_action action; + unsigned int num_syms; + union { + xkb_keysym_t sym; /* num_syms == 1 */ + xkb_keysym_t *syms; /* num_syms > 1 */ + } u; +}; + +struct xkb_group { + bool explicit_type; + /* Points to a type in keymap->types. */ + const struct xkb_key_type *type; + /* Use XkbKeyGroupWidth for the number of levels. */ + struct xkb_level *levels; +}; + +struct xkb_key { + xkb_keycode_t keycode; + xkb_atom_t name; + + enum xkb_explicit_components explicit; + + xkb_mod_mask_t modmap; + xkb_mod_mask_t vmodmap; + + bool repeats; + + enum xkb_range_exceed_type out_of_range_group_action; + xkb_layout_index_t out_of_range_group_number; + + xkb_layout_index_t num_groups; + struct xkb_group *groups; +}; + +struct xkb_mod { + xkb_atom_t name; + enum mod_type type; + xkb_mod_mask_t mapping; /* vmod -> real mod mapping */ +}; + +/* Common keyboard description structure */ +struct xkb_keymap { + struct xkb_context *ctx; + + int refcnt; + enum xkb_keymap_compile_flags flags; + enum xkb_keymap_format format; + + enum xkb_action_controls enabled_ctrls; + + xkb_keycode_t min_key_code; + xkb_keycode_t max_key_code; + struct xkb_key *keys; + + /* aliases in no particular order */ + unsigned int num_key_aliases; + struct xkb_key_alias *key_aliases; + + struct xkb_key_type *types; + unsigned int num_types; + + darray(struct xkb_sym_interpret) sym_interprets; + + darray(struct xkb_mod) mods; + + /* Number of groups in the key with the most groups. */ + xkb_layout_index_t num_groups; + /* Not all groups must have names. */ + xkb_layout_index_t num_group_names; + xkb_atom_t *group_names; + + darray(struct xkb_led) leds; + + char *keycodes_section_name; + char *symbols_section_name; + char *types_section_name; + char *compat_section_name; +}; + +#define xkb_foreach_key(iter, keymap) \ + for (iter = keymap->keys + keymap->min_key_code; \ + iter <= keymap->keys + keymap->max_key_code; \ + iter++) + +static inline const struct xkb_key * +XkbKey(struct xkb_keymap *keymap, xkb_keycode_t kc) +{ + if (kc < keymap->min_key_code || kc > keymap->max_key_code) + return NULL; + return &keymap->keys[kc]; +} + +static inline xkb_level_index_t +XkbKeyGroupWidth(const struct xkb_key *key, xkb_layout_index_t layout) +{ + return key->groups[layout].type->num_levels; +} + +struct xkb_key * +XkbKeyByName(struct xkb_keymap *keymap, xkb_atom_t name, bool use_aliases); + +xkb_atom_t +XkbResolveKeyAlias(struct xkb_keymap *keymap, xkb_atom_t name); + +xkb_layout_index_t +wrap_group_into_range(int32_t group, + xkb_layout_index_t num_groups, + enum xkb_range_exceed_type out_of_range_group_action, + xkb_layout_index_t out_of_range_group_number); + +struct xkb_keymap_format_ops { + bool (*keymap_new_from_names)(struct xkb_keymap *keymap, + const struct xkb_rule_names *names); + bool (*keymap_new_from_string)(struct xkb_keymap *keymap, + const char *string); + bool (*keymap_new_from_buffer)(struct xkb_keymap *keymap, + const char *buffer, size_t length); + bool (*keymap_new_from_file)(struct xkb_keymap *keymap, FILE *file); + char *(*keymap_get_as_string)(struct xkb_keymap *keymap); +}; + +extern const struct xkb_keymap_format_ops text_v1_keymap_format_ops; + +#endif diff --git a/src/3rdparty/xkbcommon/src/keysym-utf.c b/src/3rdparty/xkbcommon/src/keysym-utf.c new file mode 100644 index 0000000000..5484a8311d --- /dev/null +++ b/src/3rdparty/xkbcommon/src/keysym-utf.c @@ -0,0 +1,971 @@ +/* The table and comments below along with the function xkb_keysym_to_ucs4 + * are under the public domain and are derived as described below. + */ +/* This module converts keysym values into the corresponding ISO 10646 + * (UCS, Unicode) values. + * + * The array keysymtab[] contains pairs of X11 keysym values for graphical + * characters and the corresponding Unicode value. The function + * keysym2ucs() maps a keysym onto a Unicode value using a binary search, + * therefore keysymtab[] must remain SORTED by keysym value. + * + * The keysym -> UTF-8 conversion will hopefully one day be provided + * by Xlib via XmbLookupString() and should ideally not have to be + * done in X applications. But we are not there yet. + * + * We allow to represent any UCS character in the range U-00000000 to + * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff. + * This admittedly does not cover the entire 31-bit space of UCS, but + * it does cover all of the characters up to U-10FFFF, which can be + * represented by UTF-16, and more, and it is very unlikely that higher + * UCS codes will ever be assigned by ISO. So to get Unicode character + * U+ABCD you can directly use keysym 0x0100abcd. + * + * NOTE: The comments in the table below contain the actual character + * encoded in UTF-8, so for viewing and editing best use an editor in + * UTF-8 mode. + * + * Author: Markus G. Kuhn <http://www.cl.cam.ac.uk/~mgk25/>, + * University of Cambridge, April 2001 + * + * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing + * an initial draft of the mapping table. + * + * This software is in the public domain. Share and enjoy! + * + */ + +#include "xkbcommon/xkbcommon.h" +#include "utils.h" + +/* We don't use the uint32_t types here, to save some space. */ +struct codepair { + uint16_t keysym; + uint16_t ucs; +}; + +static const struct codepair keysymtab[] = { + { 0x01a1, 0x0104 }, /* Aogonek Ą LATIN CAPITAL LETTER A WITH OGONEK */ + { 0x01a2, 0x02d8 }, /* breve ˘ BREVE */ + { 0x01a3, 0x0141 }, /* Lstroke Ł LATIN CAPITAL LETTER L WITH STROKE */ + { 0x01a5, 0x013d }, /* Lcaron Ľ LATIN CAPITAL LETTER L WITH CARON */ + { 0x01a6, 0x015a }, /* Sacute Ś LATIN CAPITAL LETTER S WITH ACUTE */ + { 0x01a9, 0x0160 }, /* Scaron Š LATIN CAPITAL LETTER S WITH CARON */ + { 0x01aa, 0x015e }, /* Scedilla Ş LATIN CAPITAL LETTER S WITH CEDILLA */ + { 0x01ab, 0x0164 }, /* Tcaron Ť LATIN CAPITAL LETTER T WITH CARON */ + { 0x01ac, 0x0179 }, /* Zacute Ź LATIN CAPITAL LETTER Z WITH ACUTE */ + { 0x01ae, 0x017d }, /* Zcaron Ž LATIN CAPITAL LETTER Z WITH CARON */ + { 0x01af, 0x017b }, /* Zabovedot Ż LATIN CAPITAL LETTER Z WITH DOT ABOVE */ + { 0x01b1, 0x0105 }, /* aogonek ą LATIN SMALL LETTER A WITH OGONEK */ + { 0x01b2, 0x02db }, /* ogonek ˛ OGONEK */ + { 0x01b3, 0x0142 }, /* lstroke ł LATIN SMALL LETTER L WITH STROKE */ + { 0x01b5, 0x013e }, /* lcaron ľ LATIN SMALL LETTER L WITH CARON */ + { 0x01b6, 0x015b }, /* sacute ś LATIN SMALL LETTER S WITH ACUTE */ + { 0x01b7, 0x02c7 }, /* caron ˇ CARON */ + { 0x01b9, 0x0161 }, /* scaron š LATIN SMALL LETTER S WITH CARON */ + { 0x01ba, 0x015f }, /* scedilla ş LATIN SMALL LETTER S WITH CEDILLA */ + { 0x01bb, 0x0165 }, /* tcaron ť LATIN SMALL LETTER T WITH CARON */ + { 0x01bc, 0x017a }, /* zacute ź LATIN SMALL LETTER Z WITH ACUTE */ + { 0x01bd, 0x02dd }, /* doubleacute ˝ DOUBLE ACUTE ACCENT */ + { 0x01be, 0x017e }, /* zcaron ž LATIN SMALL LETTER Z WITH CARON */ + { 0x01bf, 0x017c }, /* zabovedot ż LATIN SMALL LETTER Z WITH DOT ABOVE */ + { 0x01c0, 0x0154 }, /* Racute Ŕ LATIN CAPITAL LETTER R WITH ACUTE */ + { 0x01c3, 0x0102 }, /* Abreve Ă LATIN CAPITAL LETTER A WITH BREVE */ + { 0x01c5, 0x0139 }, /* Lacute Ĺ LATIN CAPITAL LETTER L WITH ACUTE */ + { 0x01c6, 0x0106 }, /* Cacute Ć LATIN CAPITAL LETTER C WITH ACUTE */ + { 0x01c8, 0x010c }, /* Ccaron Č LATIN CAPITAL LETTER C WITH CARON */ + { 0x01ca, 0x0118 }, /* Eogonek Ę LATIN CAPITAL LETTER E WITH OGONEK */ + { 0x01cc, 0x011a }, /* Ecaron Ě LATIN CAPITAL LETTER E WITH CARON */ + { 0x01cf, 0x010e }, /* Dcaron Ď LATIN CAPITAL LETTER D WITH CARON */ + { 0x01d0, 0x0110 }, /* Dstroke Đ LATIN CAPITAL LETTER D WITH STROKE */ + { 0x01d1, 0x0143 }, /* Nacute Ń LATIN CAPITAL LETTER N WITH ACUTE */ + { 0x01d2, 0x0147 }, /* Ncaron Ň LATIN CAPITAL LETTER N WITH CARON */ + { 0x01d5, 0x0150 }, /* Odoubleacute Ő LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ + { 0x01d8, 0x0158 }, /* Rcaron Ř LATIN CAPITAL LETTER R WITH CARON */ + { 0x01d9, 0x016e }, /* Uring Ů LATIN CAPITAL LETTER U WITH RING ABOVE */ + { 0x01db, 0x0170 }, /* Udoubleacute Ű LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ + { 0x01de, 0x0162 }, /* Tcedilla Ţ LATIN CAPITAL LETTER T WITH CEDILLA */ + { 0x01e0, 0x0155 }, /* racute ŕ LATIN SMALL LETTER R WITH ACUTE */ + { 0x01e3, 0x0103 }, /* abreve ă LATIN SMALL LETTER A WITH BREVE */ + { 0x01e5, 0x013a }, /* lacute ĺ LATIN SMALL LETTER L WITH ACUTE */ + { 0x01e6, 0x0107 }, /* cacute ć LATIN SMALL LETTER C WITH ACUTE */ + { 0x01e8, 0x010d }, /* ccaron č LATIN SMALL LETTER C WITH CARON */ + { 0x01ea, 0x0119 }, /* eogonek ę LATIN SMALL LETTER E WITH OGONEK */ + { 0x01ec, 0x011b }, /* ecaron ě LATIN SMALL LETTER E WITH CARON */ + { 0x01ef, 0x010f }, /* dcaron ď LATIN SMALL LETTER D WITH CARON */ + { 0x01f0, 0x0111 }, /* dstroke đ LATIN SMALL LETTER D WITH STROKE */ + { 0x01f1, 0x0144 }, /* nacute ń LATIN SMALL LETTER N WITH ACUTE */ + { 0x01f2, 0x0148 }, /* ncaron ň LATIN SMALL LETTER N WITH CARON */ + { 0x01f5, 0x0151 }, /* odoubleacute ő LATIN SMALL LETTER O WITH DOUBLE ACUTE */ + { 0x01f8, 0x0159 }, /* rcaron ř LATIN SMALL LETTER R WITH CARON */ + { 0x01f9, 0x016f }, /* uring ů LATIN SMALL LETTER U WITH RING ABOVE */ + { 0x01fb, 0x0171 }, /* udoubleacute ű LATIN SMALL LETTER U WITH DOUBLE ACUTE */ + { 0x01fe, 0x0163 }, /* tcedilla ţ LATIN SMALL LETTER T WITH CEDILLA */ + { 0x01ff, 0x02d9 }, /* abovedot ˙ DOT ABOVE */ + { 0x02a1, 0x0126 }, /* Hstroke Ħ LATIN CAPITAL LETTER H WITH STROKE */ + { 0x02a6, 0x0124 }, /* Hcircumflex Ĥ LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ + { 0x02a9, 0x0130 }, /* Iabovedot İ LATIN CAPITAL LETTER I WITH DOT ABOVE */ + { 0x02ab, 0x011e }, /* Gbreve Ğ LATIN CAPITAL LETTER G WITH BREVE */ + { 0x02ac, 0x0134 }, /* Jcircumflex Ĵ LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ + { 0x02b1, 0x0127 }, /* hstroke ħ LATIN SMALL LETTER H WITH STROKE */ + { 0x02b6, 0x0125 }, /* hcircumflex ĥ LATIN SMALL LETTER H WITH CIRCUMFLEX */ + { 0x02b9, 0x0131 }, /* idotless ı LATIN SMALL LETTER DOTLESS I */ + { 0x02bb, 0x011f }, /* gbreve ğ LATIN SMALL LETTER G WITH BREVE */ + { 0x02bc, 0x0135 }, /* jcircumflex ĵ LATIN SMALL LETTER J WITH CIRCUMFLEX */ + { 0x02c5, 0x010a }, /* Cabovedot Ċ LATIN CAPITAL LETTER C WITH DOT ABOVE */ + { 0x02c6, 0x0108 }, /* Ccircumflex Ĉ LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ + { 0x02d5, 0x0120 }, /* Gabovedot Ġ LATIN CAPITAL LETTER G WITH DOT ABOVE */ + { 0x02d8, 0x011c }, /* Gcircumflex Ĝ LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ + { 0x02dd, 0x016c }, /* Ubreve Ŭ LATIN CAPITAL LETTER U WITH BREVE */ + { 0x02de, 0x015c }, /* Scircumflex Ŝ LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ + { 0x02e5, 0x010b }, /* cabovedot ċ LATIN SMALL LETTER C WITH DOT ABOVE */ + { 0x02e6, 0x0109 }, /* ccircumflex ĉ LATIN SMALL LETTER C WITH CIRCUMFLEX */ + { 0x02f5, 0x0121 }, /* gabovedot ġ LATIN SMALL LETTER G WITH DOT ABOVE */ + { 0x02f8, 0x011d }, /* gcircumflex ĝ LATIN SMALL LETTER G WITH CIRCUMFLEX */ + { 0x02fd, 0x016d }, /* ubreve ŭ LATIN SMALL LETTER U WITH BREVE */ + { 0x02fe, 0x015d }, /* scircumflex ŝ LATIN SMALL LETTER S WITH CIRCUMFLEX */ + { 0x03a2, 0x0138 }, /* kra ĸ LATIN SMALL LETTER KRA */ + { 0x03a3, 0x0156 }, /* Rcedilla Ŗ LATIN CAPITAL LETTER R WITH CEDILLA */ + { 0x03a5, 0x0128 }, /* Itilde Ĩ LATIN CAPITAL LETTER I WITH TILDE */ + { 0x03a6, 0x013b }, /* Lcedilla Ļ LATIN CAPITAL LETTER L WITH CEDILLA */ + { 0x03aa, 0x0112 }, /* Emacron Ē LATIN CAPITAL LETTER E WITH MACRON */ + { 0x03ab, 0x0122 }, /* Gcedilla Ģ LATIN CAPITAL LETTER G WITH CEDILLA */ + { 0x03ac, 0x0166 }, /* Tslash Ŧ LATIN CAPITAL LETTER T WITH STROKE */ + { 0x03b3, 0x0157 }, /* rcedilla ŗ LATIN SMALL LETTER R WITH CEDILLA */ + { 0x03b5, 0x0129 }, /* itilde ĩ LATIN SMALL LETTER I WITH TILDE */ + { 0x03b6, 0x013c }, /* lcedilla ļ LATIN SMALL LETTER L WITH CEDILLA */ + { 0x03ba, 0x0113 }, /* emacron ē LATIN SMALL LETTER E WITH MACRON */ + { 0x03bb, 0x0123 }, /* gcedilla ģ LATIN SMALL LETTER G WITH CEDILLA */ + { 0x03bc, 0x0167 }, /* tslash ŧ LATIN SMALL LETTER T WITH STROKE */ + { 0x03bd, 0x014a }, /* ENG Ŋ LATIN CAPITAL LETTER ENG */ + { 0x03bf, 0x014b }, /* eng ŋ LATIN SMALL LETTER ENG */ + { 0x03c0, 0x0100 }, /* Amacron Ā LATIN CAPITAL LETTER A WITH MACRON */ + { 0x03c7, 0x012e }, /* Iogonek Į LATIN CAPITAL LETTER I WITH OGONEK */ + { 0x03cc, 0x0116 }, /* Eabovedot Ė LATIN CAPITAL LETTER E WITH DOT ABOVE */ + { 0x03cf, 0x012a }, /* Imacron Ī LATIN CAPITAL LETTER I WITH MACRON */ + { 0x03d1, 0x0145 }, /* Ncedilla Ņ LATIN CAPITAL LETTER N WITH CEDILLA */ + { 0x03d2, 0x014c }, /* Omacron Ō LATIN CAPITAL LETTER O WITH MACRON */ + { 0x03d3, 0x0136 }, /* Kcedilla Ķ LATIN CAPITAL LETTER K WITH CEDILLA */ + { 0x03d9, 0x0172 }, /* Uogonek Ų LATIN CAPITAL LETTER U WITH OGONEK */ + { 0x03dd, 0x0168 }, /* Utilde Ũ LATIN CAPITAL LETTER U WITH TILDE */ + { 0x03de, 0x016a }, /* Umacron Ū LATIN CAPITAL LETTER U WITH MACRON */ + { 0x03e0, 0x0101 }, /* amacron ā LATIN SMALL LETTER A WITH MACRON */ + { 0x03e7, 0x012f }, /* iogonek į LATIN SMALL LETTER I WITH OGONEK */ + { 0x03ec, 0x0117 }, /* eabovedot ė LATIN SMALL LETTER E WITH DOT ABOVE */ + { 0x03ef, 0x012b }, /* imacron ī LATIN SMALL LETTER I WITH MACRON */ + { 0x03f1, 0x0146 }, /* ncedilla ņ LATIN SMALL LETTER N WITH CEDILLA */ + { 0x03f2, 0x014d }, /* omacron ō LATIN SMALL LETTER O WITH MACRON */ + { 0x03f3, 0x0137 }, /* kcedilla ķ LATIN SMALL LETTER K WITH CEDILLA */ + { 0x03f9, 0x0173 }, /* uogonek ų LATIN SMALL LETTER U WITH OGONEK */ + { 0x03fd, 0x0169 }, /* utilde ũ LATIN SMALL LETTER U WITH TILDE */ + { 0x03fe, 0x016b }, /* umacron ū LATIN SMALL LETTER U WITH MACRON */ + { 0x047e, 0x203e }, /* overline ‾ OVERLINE */ + { 0x04a1, 0x3002 }, /* kana_fullstop 。 IDEOGRAPHIC FULL STOP */ + { 0x04a2, 0x300c }, /* kana_openingbracket 「 LEFT CORNER BRACKET */ + { 0x04a3, 0x300d }, /* kana_closingbracket 」 RIGHT CORNER BRACKET */ + { 0x04a4, 0x3001 }, /* kana_comma 、 IDEOGRAPHIC COMMA */ + { 0x04a5, 0x30fb }, /* kana_conjunctive ・ KATAKANA MIDDLE DOT */ + { 0x04a6, 0x30f2 }, /* kana_WO ヲ KATAKANA LETTER WO */ + { 0x04a7, 0x30a1 }, /* kana_a ァ KATAKANA LETTER SMALL A */ + { 0x04a8, 0x30a3 }, /* kana_i ィ KATAKANA LETTER SMALL I */ + { 0x04a9, 0x30a5 }, /* kana_u ゥ KATAKANA LETTER SMALL U */ + { 0x04aa, 0x30a7 }, /* kana_e ェ KATAKANA LETTER SMALL E */ + { 0x04ab, 0x30a9 }, /* kana_o ォ KATAKANA LETTER SMALL O */ + { 0x04ac, 0x30e3 }, /* kana_ya ャ KATAKANA LETTER SMALL YA */ + { 0x04ad, 0x30e5 }, /* kana_yu ュ KATAKANA LETTER SMALL YU */ + { 0x04ae, 0x30e7 }, /* kana_yo ョ KATAKANA LETTER SMALL YO */ + { 0x04af, 0x30c3 }, /* kana_tsu ッ KATAKANA LETTER SMALL TU */ + { 0x04b0, 0x30fc }, /* prolongedsound ー KATAKANA-HIRAGANA PROLONGED SOUND MARK */ + { 0x04b1, 0x30a2 }, /* kana_A ア KATAKANA LETTER A */ + { 0x04b2, 0x30a4 }, /* kana_I イ KATAKANA LETTER I */ + { 0x04b3, 0x30a6 }, /* kana_U ウ KATAKANA LETTER U */ + { 0x04b4, 0x30a8 }, /* kana_E エ KATAKANA LETTER E */ + { 0x04b5, 0x30aa }, /* kana_O オ KATAKANA LETTER O */ + { 0x04b6, 0x30ab }, /* kana_KA カ KATAKANA LETTER KA */ + { 0x04b7, 0x30ad }, /* kana_KI キ KATAKANA LETTER KI */ + { 0x04b8, 0x30af }, /* kana_KU ク KATAKANA LETTER KU */ + { 0x04b9, 0x30b1 }, /* kana_KE ケ KATAKANA LETTER KE */ + { 0x04ba, 0x30b3 }, /* kana_KO コ KATAKANA LETTER KO */ + { 0x04bb, 0x30b5 }, /* kana_SA サ KATAKANA LETTER SA */ + { 0x04bc, 0x30b7 }, /* kana_SHI シ KATAKANA LETTER SI */ + { 0x04bd, 0x30b9 }, /* kana_SU ス KATAKANA LETTER SU */ + { 0x04be, 0x30bb }, /* kana_SE セ KATAKANA LETTER SE */ + { 0x04bf, 0x30bd }, /* kana_SO ソ KATAKANA LETTER SO */ + { 0x04c0, 0x30bf }, /* kana_TA タ KATAKANA LETTER TA */ + { 0x04c1, 0x30c1 }, /* kana_CHI チ KATAKANA LETTER TI */ + { 0x04c2, 0x30c4 }, /* kana_TSU ツ KATAKANA LETTER TU */ + { 0x04c3, 0x30c6 }, /* kana_TE テ KATAKANA LETTER TE */ + { 0x04c4, 0x30c8 }, /* kana_TO ト KATAKANA LETTER TO */ + { 0x04c5, 0x30ca }, /* kana_NA ナ KATAKANA LETTER NA */ + { 0x04c6, 0x30cb }, /* kana_NI ニ KATAKANA LETTER NI */ + { 0x04c7, 0x30cc }, /* kana_NU ヌ KATAKANA LETTER NU */ + { 0x04c8, 0x30cd }, /* kana_NE ネ KATAKANA LETTER NE */ + { 0x04c9, 0x30ce }, /* kana_NO ノ KATAKANA LETTER NO */ + { 0x04ca, 0x30cf }, /* kana_HA ハ KATAKANA LETTER HA */ + { 0x04cb, 0x30d2 }, /* kana_HI ヒ KATAKANA LETTER HI */ + { 0x04cc, 0x30d5 }, /* kana_FU フ KATAKANA LETTER HU */ + { 0x04cd, 0x30d8 }, /* kana_HE ヘ KATAKANA LETTER HE */ + { 0x04ce, 0x30db }, /* kana_HO ホ KATAKANA LETTER HO */ + { 0x04cf, 0x30de }, /* kana_MA マ KATAKANA LETTER MA */ + { 0x04d0, 0x30df }, /* kana_MI ミ KATAKANA LETTER MI */ + { 0x04d1, 0x30e0 }, /* kana_MU ム KATAKANA LETTER MU */ + { 0x04d2, 0x30e1 }, /* kana_ME メ KATAKANA LETTER ME */ + { 0x04d3, 0x30e2 }, /* kana_MO モ KATAKANA LETTER MO */ + { 0x04d4, 0x30e4 }, /* kana_YA ヤ KATAKANA LETTER YA */ + { 0x04d5, 0x30e6 }, /* kana_YU ユ KATAKANA LETTER YU */ + { 0x04d6, 0x30e8 }, /* kana_YO ヨ KATAKANA LETTER YO */ + { 0x04d7, 0x30e9 }, /* kana_RA ラ KATAKANA LETTER RA */ + { 0x04d8, 0x30ea }, /* kana_RI リ KATAKANA LETTER RI */ + { 0x04d9, 0x30eb }, /* kana_RU ル KATAKANA LETTER RU */ + { 0x04da, 0x30ec }, /* kana_RE レ KATAKANA LETTER RE */ + { 0x04db, 0x30ed }, /* kana_RO ロ KATAKANA LETTER RO */ + { 0x04dc, 0x30ef }, /* kana_WA ワ KATAKANA LETTER WA */ + { 0x04dd, 0x30f3 }, /* kana_N ン KATAKANA LETTER N */ + { 0x04de, 0x309b }, /* voicedsound ゛ KATAKANA-HIRAGANA VOICED SOUND MARK */ + { 0x04df, 0x309c }, /* semivoicedsound ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK */ + { 0x05ac, 0x060c }, /* Arabic_comma ، ARABIC COMMA */ + { 0x05bb, 0x061b }, /* Arabic_semicolon ؛ ARABIC SEMICOLON */ + { 0x05bf, 0x061f }, /* Arabic_question_mark ؟ ARABIC QUESTION MARK */ + { 0x05c1, 0x0621 }, /* Arabic_hamza ء ARABIC LETTER HAMZA */ + { 0x05c2, 0x0622 }, /* Arabic_maddaonalef آ ARABIC LETTER ALEF WITH MADDA ABOVE */ + { 0x05c3, 0x0623 }, /* Arabic_hamzaonalef أ ARABIC LETTER ALEF WITH HAMZA ABOVE */ + { 0x05c4, 0x0624 }, /* Arabic_hamzaonwaw ؤ ARABIC LETTER WAW WITH HAMZA ABOVE */ + { 0x05c5, 0x0625 }, /* Arabic_hamzaunderalef إ ARABIC LETTER ALEF WITH HAMZA BELOW */ + { 0x05c6, 0x0626 }, /* Arabic_hamzaonyeh ئ ARABIC LETTER YEH WITH HAMZA ABOVE */ + { 0x05c7, 0x0627 }, /* Arabic_alef ا ARABIC LETTER ALEF */ + { 0x05c8, 0x0628 }, /* Arabic_beh ب ARABIC LETTER BEH */ + { 0x05c9, 0x0629 }, /* Arabic_tehmarbuta ة ARABIC LETTER TEH MARBUTA */ + { 0x05ca, 0x062a }, /* Arabic_teh ت ARABIC LETTER TEH */ + { 0x05cb, 0x062b }, /* Arabic_theh ث ARABIC LETTER THEH */ + { 0x05cc, 0x062c }, /* Arabic_jeem ج ARABIC LETTER JEEM */ + { 0x05cd, 0x062d }, /* Arabic_hah ح ARABIC LETTER HAH */ + { 0x05ce, 0x062e }, /* Arabic_khah خ ARABIC LETTER KHAH */ + { 0x05cf, 0x062f }, /* Arabic_dal د ARABIC LETTER DAL */ + { 0x05d0, 0x0630 }, /* Arabic_thal ذ ARABIC LETTER THAL */ + { 0x05d1, 0x0631 }, /* Arabic_ra ر ARABIC LETTER REH */ + { 0x05d2, 0x0632 }, /* Arabic_zain ز ARABIC LETTER ZAIN */ + { 0x05d3, 0x0633 }, /* Arabic_seen س ARABIC LETTER SEEN */ + { 0x05d4, 0x0634 }, /* Arabic_sheen ش ARABIC LETTER SHEEN */ + { 0x05d5, 0x0635 }, /* Arabic_sad ص ARABIC LETTER SAD */ + { 0x05d6, 0x0636 }, /* Arabic_dad ض ARABIC LETTER DAD */ + { 0x05d7, 0x0637 }, /* Arabic_tah ط ARABIC LETTER TAH */ + { 0x05d8, 0x0638 }, /* Arabic_zah ظ ARABIC LETTER ZAH */ + { 0x05d9, 0x0639 }, /* Arabic_ain ع ARABIC LETTER AIN */ + { 0x05da, 0x063a }, /* Arabic_ghain غ ARABIC LETTER GHAIN */ + { 0x05e0, 0x0640 }, /* Arabic_tatweel ـ ARABIC TATWEEL */ + { 0x05e1, 0x0641 }, /* Arabic_feh ف ARABIC LETTER FEH */ + { 0x05e2, 0x0642 }, /* Arabic_qaf ق ARABIC LETTER QAF */ + { 0x05e3, 0x0643 }, /* Arabic_kaf ك ARABIC LETTER KAF */ + { 0x05e4, 0x0644 }, /* Arabic_lam ل ARABIC LETTER LAM */ + { 0x05e5, 0x0645 }, /* Arabic_meem م ARABIC LETTER MEEM */ + { 0x05e6, 0x0646 }, /* Arabic_noon ن ARABIC LETTER NOON */ + { 0x05e7, 0x0647 }, /* Arabic_ha ه ARABIC LETTER HEH */ + { 0x05e8, 0x0648 }, /* Arabic_waw و ARABIC LETTER WAW */ + { 0x05e9, 0x0649 }, /* Arabic_alefmaksura ى ARABIC LETTER ALEF MAKSURA */ + { 0x05ea, 0x064a }, /* Arabic_yeh ي ARABIC LETTER YEH */ + { 0x05eb, 0x064b }, /* Arabic_fathatan ً ARABIC FATHATAN */ + { 0x05ec, 0x064c }, /* Arabic_dammatan ٌ ARABIC DAMMATAN */ + { 0x05ed, 0x064d }, /* Arabic_kasratan ٍ ARABIC KASRATAN */ + { 0x05ee, 0x064e }, /* Arabic_fatha َ ARABIC FATHA */ + { 0x05ef, 0x064f }, /* Arabic_damma ُ ARABIC DAMMA */ + { 0x05f0, 0x0650 }, /* Arabic_kasra ِ ARABIC KASRA */ + { 0x05f1, 0x0651 }, /* Arabic_shadda ّ ARABIC SHADDA */ + { 0x05f2, 0x0652 }, /* Arabic_sukun ْ ARABIC SUKUN */ + { 0x06a1, 0x0452 }, /* Serbian_dje ђ CYRILLIC SMALL LETTER DJE */ + { 0x06a2, 0x0453 }, /* Macedonia_gje ѓ CYRILLIC SMALL LETTER GJE */ + { 0x06a3, 0x0451 }, /* Cyrillic_io ё CYRILLIC SMALL LETTER IO */ + { 0x06a4, 0x0454 }, /* Ukrainian_ie є CYRILLIC SMALL LETTER UKRAINIAN IE */ + { 0x06a5, 0x0455 }, /* Macedonia_dse ѕ CYRILLIC SMALL LETTER DZE */ + { 0x06a6, 0x0456 }, /* Ukrainian_i і CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ + { 0x06a7, 0x0457 }, /* Ukrainian_yi ї CYRILLIC SMALL LETTER YI */ + { 0x06a8, 0x0458 }, /* Cyrillic_je ј CYRILLIC SMALL LETTER JE */ + { 0x06a9, 0x0459 }, /* Cyrillic_lje љ CYRILLIC SMALL LETTER LJE */ + { 0x06aa, 0x045a }, /* Cyrillic_nje њ CYRILLIC SMALL LETTER NJE */ + { 0x06ab, 0x045b }, /* Serbian_tshe ћ CYRILLIC SMALL LETTER TSHE */ + { 0x06ac, 0x045c }, /* Macedonia_kje ќ CYRILLIC SMALL LETTER KJE */ + { 0x06ad, 0x0491 }, /* Ukrainian_ghe_with_upturn ґ CYRILLIC SMALL LETTER GHE WITH UPTURN */ + { 0x06ae, 0x045e }, /* Byelorussian_shortu ў CYRILLIC SMALL LETTER SHORT U */ + { 0x06af, 0x045f }, /* Cyrillic_dzhe џ CYRILLIC SMALL LETTER DZHE */ + { 0x06b0, 0x2116 }, /* numerosign № NUMERO SIGN */ + { 0x06b1, 0x0402 }, /* Serbian_DJE Ђ CYRILLIC CAPITAL LETTER DJE */ + { 0x06b2, 0x0403 }, /* Macedonia_GJE Ѓ CYRILLIC CAPITAL LETTER GJE */ + { 0x06b3, 0x0401 }, /* Cyrillic_IO Ё CYRILLIC CAPITAL LETTER IO */ + { 0x06b4, 0x0404 }, /* Ukrainian_IE Є CYRILLIC CAPITAL LETTER UKRAINIAN IE */ + { 0x06b5, 0x0405 }, /* Macedonia_DSE Ѕ CYRILLIC CAPITAL LETTER DZE */ + { 0x06b6, 0x0406 }, /* Ukrainian_I І CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ + { 0x06b7, 0x0407 }, /* Ukrainian_YI Ї CYRILLIC CAPITAL LETTER YI */ + { 0x06b8, 0x0408 }, /* Cyrillic_JE Ј CYRILLIC CAPITAL LETTER JE */ + { 0x06b9, 0x0409 }, /* Cyrillic_LJE Љ CYRILLIC CAPITAL LETTER LJE */ + { 0x06ba, 0x040a }, /* Cyrillic_NJE Њ CYRILLIC CAPITAL LETTER NJE */ + { 0x06bb, 0x040b }, /* Serbian_TSHE Ћ CYRILLIC CAPITAL LETTER TSHE */ + { 0x06bc, 0x040c }, /* Macedonia_KJE Ќ CYRILLIC CAPITAL LETTER KJE */ + { 0x06bd, 0x0490 }, /* Ukrainian_GHE_WITH_UPTURN Ґ CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ + { 0x06be, 0x040e }, /* Byelorussian_SHORTU Ў CYRILLIC CAPITAL LETTER SHORT U */ + { 0x06bf, 0x040f }, /* Cyrillic_DZHE Џ CYRILLIC CAPITAL LETTER DZHE */ + { 0x06c0, 0x044e }, /* Cyrillic_yu ю CYRILLIC SMALL LETTER YU */ + { 0x06c1, 0x0430 }, /* Cyrillic_a а CYRILLIC SMALL LETTER A */ + { 0x06c2, 0x0431 }, /* Cyrillic_be б CYRILLIC SMALL LETTER BE */ + { 0x06c3, 0x0446 }, /* Cyrillic_tse ц CYRILLIC SMALL LETTER TSE */ + { 0x06c4, 0x0434 }, /* Cyrillic_de д CYRILLIC SMALL LETTER DE */ + { 0x06c5, 0x0435 }, /* Cyrillic_ie е CYRILLIC SMALL LETTER IE */ + { 0x06c6, 0x0444 }, /* Cyrillic_ef ф CYRILLIC SMALL LETTER EF */ + { 0x06c7, 0x0433 }, /* Cyrillic_ghe г CYRILLIC SMALL LETTER GHE */ + { 0x06c8, 0x0445 }, /* Cyrillic_ha х CYRILLIC SMALL LETTER HA */ + { 0x06c9, 0x0438 }, /* Cyrillic_i и CYRILLIC SMALL LETTER I */ + { 0x06ca, 0x0439 }, /* Cyrillic_shorti й CYRILLIC SMALL LETTER SHORT I */ + { 0x06cb, 0x043a }, /* Cyrillic_ka к CYRILLIC SMALL LETTER KA */ + { 0x06cc, 0x043b }, /* Cyrillic_el л CYRILLIC SMALL LETTER EL */ + { 0x06cd, 0x043c }, /* Cyrillic_em м CYRILLIC SMALL LETTER EM */ + { 0x06ce, 0x043d }, /* Cyrillic_en н CYRILLIC SMALL LETTER EN */ + { 0x06cf, 0x043e }, /* Cyrillic_o о CYRILLIC SMALL LETTER O */ + { 0x06d0, 0x043f }, /* Cyrillic_pe п CYRILLIC SMALL LETTER PE */ + { 0x06d1, 0x044f }, /* Cyrillic_ya я CYRILLIC SMALL LETTER YA */ + { 0x06d2, 0x0440 }, /* Cyrillic_er р CYRILLIC SMALL LETTER ER */ + { 0x06d3, 0x0441 }, /* Cyrillic_es с CYRILLIC SMALL LETTER ES */ + { 0x06d4, 0x0442 }, /* Cyrillic_te т CYRILLIC SMALL LETTER TE */ + { 0x06d5, 0x0443 }, /* Cyrillic_u у CYRILLIC SMALL LETTER U */ + { 0x06d6, 0x0436 }, /* Cyrillic_zhe ж CYRILLIC SMALL LETTER ZHE */ + { 0x06d7, 0x0432 }, /* Cyrillic_ve в CYRILLIC SMALL LETTER VE */ + { 0x06d8, 0x044c }, /* Cyrillic_softsign ь CYRILLIC SMALL LETTER SOFT SIGN */ + { 0x06d9, 0x044b }, /* Cyrillic_yeru ы CYRILLIC SMALL LETTER YERU */ + { 0x06da, 0x0437 }, /* Cyrillic_ze з CYRILLIC SMALL LETTER ZE */ + { 0x06db, 0x0448 }, /* Cyrillic_sha ш CYRILLIC SMALL LETTER SHA */ + { 0x06dc, 0x044d }, /* Cyrillic_e э CYRILLIC SMALL LETTER E */ + { 0x06dd, 0x0449 }, /* Cyrillic_shcha щ CYRILLIC SMALL LETTER SHCHA */ + { 0x06de, 0x0447 }, /* Cyrillic_che ч CYRILLIC SMALL LETTER CHE */ + { 0x06df, 0x044a }, /* Cyrillic_hardsign ъ CYRILLIC SMALL LETTER HARD SIGN */ + { 0x06e0, 0x042e }, /* Cyrillic_YU Ю CYRILLIC CAPITAL LETTER YU */ + { 0x06e1, 0x0410 }, /* Cyrillic_A А CYRILLIC CAPITAL LETTER A */ + { 0x06e2, 0x0411 }, /* Cyrillic_BE Б CYRILLIC CAPITAL LETTER BE */ + { 0x06e3, 0x0426 }, /* Cyrillic_TSE Ц CYRILLIC CAPITAL LETTER TSE */ + { 0x06e4, 0x0414 }, /* Cyrillic_DE Д CYRILLIC CAPITAL LETTER DE */ + { 0x06e5, 0x0415 }, /* Cyrillic_IE Е CYRILLIC CAPITAL LETTER IE */ + { 0x06e6, 0x0424 }, /* Cyrillic_EF Ф CYRILLIC CAPITAL LETTER EF */ + { 0x06e7, 0x0413 }, /* Cyrillic_GHE Г CYRILLIC CAPITAL LETTER GHE */ + { 0x06e8, 0x0425 }, /* Cyrillic_HA Х CYRILLIC CAPITAL LETTER HA */ + { 0x06e9, 0x0418 }, /* Cyrillic_I И CYRILLIC CAPITAL LETTER I */ + { 0x06ea, 0x0419 }, /* Cyrillic_SHORTI Й CYRILLIC CAPITAL LETTER SHORT I */ + { 0x06eb, 0x041a }, /* Cyrillic_KA К CYRILLIC CAPITAL LETTER KA */ + { 0x06ec, 0x041b }, /* Cyrillic_EL Л CYRILLIC CAPITAL LETTER EL */ + { 0x06ed, 0x041c }, /* Cyrillic_EM М CYRILLIC CAPITAL LETTER EM */ + { 0x06ee, 0x041d }, /* Cyrillic_EN Н CYRILLIC CAPITAL LETTER EN */ + { 0x06ef, 0x041e }, /* Cyrillic_O О CYRILLIC CAPITAL LETTER O */ + { 0x06f0, 0x041f }, /* Cyrillic_PE П CYRILLIC CAPITAL LETTER PE */ + { 0x06f1, 0x042f }, /* Cyrillic_YA Я CYRILLIC CAPITAL LETTER YA */ + { 0x06f2, 0x0420 }, /* Cyrillic_ER Р CYRILLIC CAPITAL LETTER ER */ + { 0x06f3, 0x0421 }, /* Cyrillic_ES С CYRILLIC CAPITAL LETTER ES */ + { 0x06f4, 0x0422 }, /* Cyrillic_TE Т CYRILLIC CAPITAL LETTER TE */ + { 0x06f5, 0x0423 }, /* Cyrillic_U У CYRILLIC CAPITAL LETTER U */ + { 0x06f6, 0x0416 }, /* Cyrillic_ZHE Ж CYRILLIC CAPITAL LETTER ZHE */ + { 0x06f7, 0x0412 }, /* Cyrillic_VE В CYRILLIC CAPITAL LETTER VE */ + { 0x06f8, 0x042c }, /* Cyrillic_SOFTSIGN Ь CYRILLIC CAPITAL LETTER SOFT SIGN */ + { 0x06f9, 0x042b }, /* Cyrillic_YERU Ы CYRILLIC CAPITAL LETTER YERU */ + { 0x06fa, 0x0417 }, /* Cyrillic_ZE З CYRILLIC CAPITAL LETTER ZE */ + { 0x06fb, 0x0428 }, /* Cyrillic_SHA Ш CYRILLIC CAPITAL LETTER SHA */ + { 0x06fc, 0x042d }, /* Cyrillic_E Э CYRILLIC CAPITAL LETTER E */ + { 0x06fd, 0x0429 }, /* Cyrillic_SHCHA Щ CYRILLIC CAPITAL LETTER SHCHA */ + { 0x06fe, 0x0427 }, /* Cyrillic_CHE Ч CYRILLIC CAPITAL LETTER CHE */ + { 0x06ff, 0x042a }, /* Cyrillic_HARDSIGN Ъ CYRILLIC CAPITAL LETTER HARD SIGN */ + { 0x07a1, 0x0386 }, /* Greek_ALPHAaccent Ά GREEK CAPITAL LETTER ALPHA WITH TONOS */ + { 0x07a2, 0x0388 }, /* Greek_EPSILONaccent Έ GREEK CAPITAL LETTER EPSILON WITH TONOS */ + { 0x07a3, 0x0389 }, /* Greek_ETAaccent Ή GREEK CAPITAL LETTER ETA WITH TONOS */ + { 0x07a4, 0x038a }, /* Greek_IOTAaccent Ί GREEK CAPITAL LETTER IOTA WITH TONOS */ + { 0x07a5, 0x03aa }, /* Greek_IOTAdiaeresis Ϊ GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ + { 0x07a7, 0x038c }, /* Greek_OMICRONaccent Ό GREEK CAPITAL LETTER OMICRON WITH TONOS */ + { 0x07a8, 0x038e }, /* Greek_UPSILONaccent Ύ GREEK CAPITAL LETTER UPSILON WITH TONOS */ + { 0x07a9, 0x03ab }, /* Greek_UPSILONdieresis Ϋ GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ + { 0x07ab, 0x038f }, /* Greek_OMEGAaccent Ώ GREEK CAPITAL LETTER OMEGA WITH TONOS */ + { 0x07ae, 0x0385 }, /* Greek_accentdieresis ΅ GREEK DIALYTIKA TONOS */ + { 0x07af, 0x2015 }, /* Greek_horizbar ― HORIZONTAL BAR */ + { 0x07b1, 0x03ac }, /* Greek_alphaaccent ά GREEK SMALL LETTER ALPHA WITH TONOS */ + { 0x07b2, 0x03ad }, /* Greek_epsilonaccent έ GREEK SMALL LETTER EPSILON WITH TONOS */ + { 0x07b3, 0x03ae }, /* Greek_etaaccent ή GREEK SMALL LETTER ETA WITH TONOS */ + { 0x07b4, 0x03af }, /* Greek_iotaaccent ί GREEK SMALL LETTER IOTA WITH TONOS */ + { 0x07b5, 0x03ca }, /* Greek_iotadieresis ϊ GREEK SMALL LETTER IOTA WITH DIALYTIKA */ + { 0x07b6, 0x0390 }, /* Greek_iotaaccentdieresis ΐ GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ + { 0x07b7, 0x03cc }, /* Greek_omicronaccent ό GREEK SMALL LETTER OMICRON WITH TONOS */ + { 0x07b8, 0x03cd }, /* Greek_upsilonaccent ύ GREEK SMALL LETTER UPSILON WITH TONOS */ + { 0x07b9, 0x03cb }, /* Greek_upsilondieresis ϋ GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ + { 0x07ba, 0x03b0 }, /* Greek_upsilonaccentdieresis ΰ GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ + { 0x07bb, 0x03ce }, /* Greek_omegaaccent ώ GREEK SMALL LETTER OMEGA WITH TONOS */ + { 0x07c1, 0x0391 }, /* Greek_ALPHA Α GREEK CAPITAL LETTER ALPHA */ + { 0x07c2, 0x0392 }, /* Greek_BETA Β GREEK CAPITAL LETTER BETA */ + { 0x07c3, 0x0393 }, /* Greek_GAMMA Γ GREEK CAPITAL LETTER GAMMA */ + { 0x07c4, 0x0394 }, /* Greek_DELTA Δ GREEK CAPITAL LETTER DELTA */ + { 0x07c5, 0x0395 }, /* Greek_EPSILON Ε GREEK CAPITAL LETTER EPSILON */ + { 0x07c6, 0x0396 }, /* Greek_ZETA Ζ GREEK CAPITAL LETTER ZETA */ + { 0x07c7, 0x0397 }, /* Greek_ETA Η GREEK CAPITAL LETTER ETA */ + { 0x07c8, 0x0398 }, /* Greek_THETA Θ GREEK CAPITAL LETTER THETA */ + { 0x07c9, 0x0399 }, /* Greek_IOTA Ι GREEK CAPITAL LETTER IOTA */ + { 0x07ca, 0x039a }, /* Greek_KAPPA Κ GREEK CAPITAL LETTER KAPPA */ + { 0x07cb, 0x039b }, /* Greek_LAMBDA Λ GREEK CAPITAL LETTER LAMDA */ + { 0x07cc, 0x039c }, /* Greek_MU Μ GREEK CAPITAL LETTER MU */ + { 0x07cd, 0x039d }, /* Greek_NU Ν GREEK CAPITAL LETTER NU */ + { 0x07ce, 0x039e }, /* Greek_XI Ξ GREEK CAPITAL LETTER XI */ + { 0x07cf, 0x039f }, /* Greek_OMICRON Ο GREEK CAPITAL LETTER OMICRON */ + { 0x07d0, 0x03a0 }, /* Greek_PI Π GREEK CAPITAL LETTER PI */ + { 0x07d1, 0x03a1 }, /* Greek_RHO Ρ GREEK CAPITAL LETTER RHO */ + { 0x07d2, 0x03a3 }, /* Greek_SIGMA Σ GREEK CAPITAL LETTER SIGMA */ + { 0x07d4, 0x03a4 }, /* Greek_TAU Τ GREEK CAPITAL LETTER TAU */ + { 0x07d5, 0x03a5 }, /* Greek_UPSILON Υ GREEK CAPITAL LETTER UPSILON */ + { 0x07d6, 0x03a6 }, /* Greek_PHI Φ GREEK CAPITAL LETTER PHI */ + { 0x07d7, 0x03a7 }, /* Greek_CHI Χ GREEK CAPITAL LETTER CHI */ + { 0x07d8, 0x03a8 }, /* Greek_PSI Ψ GREEK CAPITAL LETTER PSI */ + { 0x07d9, 0x03a9 }, /* Greek_OMEGA Ω GREEK CAPITAL LETTER OMEGA */ + { 0x07e1, 0x03b1 }, /* Greek_alpha α GREEK SMALL LETTER ALPHA */ + { 0x07e2, 0x03b2 }, /* Greek_beta β GREEK SMALL LETTER BETA */ + { 0x07e3, 0x03b3 }, /* Greek_gamma γ GREEK SMALL LETTER GAMMA */ + { 0x07e4, 0x03b4 }, /* Greek_delta δ GREEK SMALL LETTER DELTA */ + { 0x07e5, 0x03b5 }, /* Greek_epsilon ε GREEK SMALL LETTER EPSILON */ + { 0x07e6, 0x03b6 }, /* Greek_zeta ζ GREEK SMALL LETTER ZETA */ + { 0x07e7, 0x03b7 }, /* Greek_eta η GREEK SMALL LETTER ETA */ + { 0x07e8, 0x03b8 }, /* Greek_theta θ GREEK SMALL LETTER THETA */ + { 0x07e9, 0x03b9 }, /* Greek_iota ι GREEK SMALL LETTER IOTA */ + { 0x07ea, 0x03ba }, /* Greek_kappa κ GREEK SMALL LETTER KAPPA */ + { 0x07eb, 0x03bb }, /* Greek_lambda λ GREEK SMALL LETTER LAMDA */ + { 0x07ec, 0x03bc }, /* Greek_mu μ GREEK SMALL LETTER MU */ + { 0x07ed, 0x03bd }, /* Greek_nu ν GREEK SMALL LETTER NU */ + { 0x07ee, 0x03be }, /* Greek_xi ξ GREEK SMALL LETTER XI */ + { 0x07ef, 0x03bf }, /* Greek_omicron ο GREEK SMALL LETTER OMICRON */ + { 0x07f0, 0x03c0 }, /* Greek_pi π GREEK SMALL LETTER PI */ + { 0x07f1, 0x03c1 }, /* Greek_rho ρ GREEK SMALL LETTER RHO */ + { 0x07f2, 0x03c3 }, /* Greek_sigma σ GREEK SMALL LETTER SIGMA */ + { 0x07f3, 0x03c2 }, /* Greek_finalsmallsigma ς GREEK SMALL LETTER FINAL SIGMA */ + { 0x07f4, 0x03c4 }, /* Greek_tau τ GREEK SMALL LETTER TAU */ + { 0x07f5, 0x03c5 }, /* Greek_upsilon υ GREEK SMALL LETTER UPSILON */ + { 0x07f6, 0x03c6 }, /* Greek_phi φ GREEK SMALL LETTER PHI */ + { 0x07f7, 0x03c7 }, /* Greek_chi χ GREEK SMALL LETTER CHI */ + { 0x07f8, 0x03c8 }, /* Greek_psi ψ GREEK SMALL LETTER PSI */ + { 0x07f9, 0x03c9 }, /* Greek_omega ω GREEK SMALL LETTER OMEGA */ + { 0x08a1, 0x23b7 }, /* leftradical ⎷ ??? */ + { 0x08a2, 0x250c }, /* topleftradical ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */ + { 0x08a3, 0x2500 }, /* horizconnector ─ BOX DRAWINGS LIGHT HORIZONTAL */ + { 0x08a4, 0x2320 }, /* topintegral ⌠ TOP HALF INTEGRAL */ + { 0x08a5, 0x2321 }, /* botintegral ⌡ BOTTOM HALF INTEGRAL */ + { 0x08a6, 0x2502 }, /* vertconnector │ BOX DRAWINGS LIGHT VERTICAL */ + { 0x08a7, 0x23a1 }, /* topleftsqbracket ⎡ ??? */ + { 0x08a8, 0x23a3 }, /* botleftsqbracket ⎣ ??? */ + { 0x08a9, 0x23a4 }, /* toprightsqbracket ⎤ ??? */ + { 0x08aa, 0x23a6 }, /* botrightsqbracket ⎦ ??? */ + { 0x08ab, 0x239b }, /* topleftparens ⎛ ??? */ + { 0x08ac, 0x239d }, /* botleftparens ⎝ ??? */ + { 0x08ad, 0x239e }, /* toprightparens ⎞ ??? */ + { 0x08ae, 0x23a0 }, /* botrightparens ⎠ ??? */ + { 0x08af, 0x23a8 }, /* leftmiddlecurlybrace ⎨ ??? */ + { 0x08b0, 0x23ac }, /* rightmiddlecurlybrace ⎬ ??? */ + /* 0x08b1 topleftsummation ? ??? */ + /* 0x08b2 botleftsummation ? ??? */ + /* 0x08b3 topvertsummationconnector ? ??? */ + /* 0x08b4 botvertsummationconnector ? ??? */ + /* 0x08b5 toprightsummation ? ??? */ + /* 0x08b6 botrightsummation ? ??? */ + /* 0x08b7 rightmiddlesummation ? ??? */ + { 0x08bc, 0x2264 }, /* lessthanequal ≤ LESS-THAN OR EQUAL TO */ + { 0x08bd, 0x2260 }, /* notequal ≠ NOT EQUAL TO */ + { 0x08be, 0x2265 }, /* greaterthanequal ≥ GREATER-THAN OR EQUAL TO */ + { 0x08bf, 0x222b }, /* integral ∫ INTEGRAL */ + { 0x08c0, 0x2234 }, /* therefore ∴ THEREFORE */ + { 0x08c1, 0x221d }, /* variation ∝ PROPORTIONAL TO */ + { 0x08c2, 0x221e }, /* infinity ∞ INFINITY */ + { 0x08c5, 0x2207 }, /* nabla ∇ NABLA */ + { 0x08c8, 0x223c }, /* approximate ∼ TILDE OPERATOR */ + { 0x08c9, 0x2243 }, /* similarequal ≃ ASYMPTOTICALLY EQUAL TO */ + { 0x08cd, 0x21d4 }, /* ifonlyif ⇔ LEFT RIGHT DOUBLE ARROW */ + { 0x08ce, 0x21d2 }, /* implies ⇒ RIGHTWARDS DOUBLE ARROW */ + { 0x08cf, 0x2261 }, /* identical ≡ IDENTICAL TO */ + { 0x08d6, 0x221a }, /* radical √ SQUARE ROOT */ + { 0x08da, 0x2282 }, /* includedin ⊂ SUBSET OF */ + { 0x08db, 0x2283 }, /* includes ⊃ SUPERSET OF */ + { 0x08dc, 0x2229 }, /* intersection ∩ INTERSECTION */ + { 0x08dd, 0x222a }, /* union ∪ UNION */ + { 0x08de, 0x2227 }, /* logicaland ∧ LOGICAL AND */ + { 0x08df, 0x2228 }, /* logicalor ∨ LOGICAL OR */ + { 0x08ef, 0x2202 }, /* partialderivative ∂ PARTIAL DIFFERENTIAL */ + { 0x08f6, 0x0192 }, /* function ƒ LATIN SMALL LETTER F WITH HOOK */ + { 0x08fb, 0x2190 }, /* leftarrow ← LEFTWARDS ARROW */ + { 0x08fc, 0x2191 }, /* uparrow ↑ UPWARDS ARROW */ + { 0x08fd, 0x2192 }, /* rightarrow → RIGHTWARDS ARROW */ + { 0x08fe, 0x2193 }, /* downarrow ↓ DOWNWARDS ARROW */ +/* 0x09df blank ? ??? */ + { 0x09e0, 0x25c6 }, /* soliddiamond ◆ BLACK DIAMOND */ + { 0x09e1, 0x2592 }, /* checkerboard ▒ MEDIUM SHADE */ + { 0x09e2, 0x2409 }, /* ht ␉ SYMBOL FOR HORIZONTAL TABULATION */ + { 0x09e3, 0x240c }, /* ff ␌ SYMBOL FOR FORM FEED */ + { 0x09e4, 0x240d }, /* cr ␍ SYMBOL FOR CARRIAGE RETURN */ + { 0x09e5, 0x240a }, /* lf ␊ SYMBOL FOR LINE FEED */ + { 0x09e8, 0x2424 }, /* nl  SYMBOL FOR NEWLINE */ + { 0x09e9, 0x240b }, /* vt ␋ SYMBOL FOR VERTICAL TABULATION */ + { 0x09ea, 0x2518 }, /* lowrightcorner ┘ BOX DRAWINGS LIGHT UP AND LEFT */ + { 0x09eb, 0x2510 }, /* uprightcorner ┐ BOX DRAWINGS LIGHT DOWN AND LEFT */ + { 0x09ec, 0x250c }, /* upleftcorner ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */ + { 0x09ed, 0x2514 }, /* lowleftcorner └ BOX DRAWINGS LIGHT UP AND RIGHT */ + { 0x09ee, 0x253c }, /* crossinglines ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ + { 0x09ef, 0x23ba }, /* horizlinescan1 ⎺ HORIZONTAL SCAN LINE-1 (Unicode 3.2 draft) */ + { 0x09f0, 0x23bb }, /* horizlinescan3 ⎻ HORIZONTAL SCAN LINE-3 (Unicode 3.2 draft) */ + { 0x09f1, 0x2500 }, /* horizlinescan5 ─ BOX DRAWINGS LIGHT HORIZONTAL */ + { 0x09f2, 0x23bc }, /* horizlinescan7 ⎼ HORIZONTAL SCAN LINE-7 (Unicode 3.2 draft) */ + { 0x09f3, 0x23bd }, /* horizlinescan9 ⎽ HORIZONTAL SCAN LINE-9 (Unicode 3.2 draft) */ + { 0x09f4, 0x251c }, /* leftt ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ + { 0x09f5, 0x2524 }, /* rightt ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT */ + { 0x09f6, 0x2534 }, /* bott ┴ BOX DRAWINGS LIGHT UP AND HORIZONTAL */ + { 0x09f7, 0x252c }, /* topt ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ + { 0x09f8, 0x2502 }, /* vertbar │ BOX DRAWINGS LIGHT VERTICAL */ + { 0x0aa1, 0x2003 }, /* emspace EM SPACE */ + { 0x0aa2, 0x2002 }, /* enspace EN SPACE */ + { 0x0aa3, 0x2004 }, /* em3space THREE-PER-EM SPACE */ + { 0x0aa4, 0x2005 }, /* em4space FOUR-PER-EM SPACE */ + { 0x0aa5, 0x2007 }, /* digitspace FIGURE SPACE */ + { 0x0aa6, 0x2008 }, /* punctspace PUNCTUATION SPACE */ + { 0x0aa7, 0x2009 }, /* thinspace THIN SPACE */ + { 0x0aa8, 0x200a }, /* hairspace HAIR SPACE */ + { 0x0aa9, 0x2014 }, /* emdash — EM DASH */ + { 0x0aaa, 0x2013 }, /* endash – EN DASH */ + /* 0x0aac signifblank ? ??? */ + { 0x0aae, 0x2026 }, /* ellipsis … HORIZONTAL ELLIPSIS */ + { 0x0aaf, 0x2025 }, /* doubbaselinedot ‥ TWO DOT LEADER */ + { 0x0ab0, 0x2153 }, /* onethird ⅓ VULGAR FRACTION ONE THIRD */ + { 0x0ab1, 0x2154 }, /* twothirds ⅔ VULGAR FRACTION TWO THIRDS */ + { 0x0ab2, 0x2155 }, /* onefifth ⅕ VULGAR FRACTION ONE FIFTH */ + { 0x0ab3, 0x2156 }, /* twofifths ⅖ VULGAR FRACTION TWO FIFTHS */ + { 0x0ab4, 0x2157 }, /* threefifths ⅗ VULGAR FRACTION THREE FIFTHS */ + { 0x0ab5, 0x2158 }, /* fourfifths ⅘ VULGAR FRACTION FOUR FIFTHS */ + { 0x0ab6, 0x2159 }, /* onesixth ⅙ VULGAR FRACTION ONE SIXTH */ + { 0x0ab7, 0x215a }, /* fivesixths ⅚ VULGAR FRACTION FIVE SIXTHS */ + { 0x0ab8, 0x2105 }, /* careof ℅ CARE OF */ + { 0x0abb, 0x2012 }, /* figdash ‒ FIGURE DASH */ + { 0x0abc, 0x2329 }, /* leftanglebracket 〈 LEFT-POINTING ANGLE BRACKET */ + { 0x0abd, 0x002e }, /* decimalpoint . FULL STOP */ + { 0x0abe, 0x232a }, /* rightanglebracket 〉 RIGHT-POINTING ANGLE BRACKET */ + /* 0x0abf marker ? ??? */ + { 0x0ac3, 0x215b }, /* oneeighth ⅛ VULGAR FRACTION ONE EIGHTH */ + { 0x0ac4, 0x215c }, /* threeeighths ⅜ VULGAR FRACTION THREE EIGHTHS */ + { 0x0ac5, 0x215d }, /* fiveeighths ⅝ VULGAR FRACTION FIVE EIGHTHS */ + { 0x0ac6, 0x215e }, /* seveneighths ⅞ VULGAR FRACTION SEVEN EIGHTHS */ + { 0x0ac9, 0x2122 }, /* trademark ™ TRADE MARK SIGN */ + { 0x0aca, 0x2613 }, /* signaturemark ☓ SALTIRE */ + /* 0x0acb trademarkincircle ? ??? */ + { 0x0acc, 0x25c1 }, /* leftopentriangle ◁ WHITE LEFT-POINTING TRIANGLE */ + { 0x0acd, 0x25b7 }, /* rightopentriangle ▷ WHITE RIGHT-POINTING TRIANGLE */ + { 0x0ace, 0x25cb }, /* emopencircle ○ WHITE CIRCLE */ + { 0x0acf, 0x25af }, /* emopenrectangle ▯ WHITE VERTICAL RECTANGLE */ + { 0x0ad0, 0x2018 }, /* leftsinglequotemark ‘ LEFT SINGLE QUOTATION MARK */ + { 0x0ad1, 0x2019 }, /* rightsinglequotemark ’ RIGHT SINGLE QUOTATION MARK */ + { 0x0ad2, 0x201c }, /* leftdoublequotemark “ LEFT DOUBLE QUOTATION MARK */ + { 0x0ad3, 0x201d }, /* rightdoublequotemark ” RIGHT DOUBLE QUOTATION MARK */ + { 0x0ad4, 0x211e }, /* prescription ℞ PRESCRIPTION TAKE */ + { 0x0ad6, 0x2032 }, /* minutes ′ PRIME */ + { 0x0ad7, 0x2033 }, /* seconds ″ DOUBLE PRIME */ + { 0x0ad9, 0x271d }, /* latincross ✝ LATIN CROSS */ + /* 0x0ada hexagram ? ??? */ + { 0x0adb, 0x25ac }, /* filledrectbullet ▬ BLACK RECTANGLE */ + { 0x0adc, 0x25c0 }, /* filledlefttribullet ◀ BLACK LEFT-POINTING TRIANGLE */ + { 0x0add, 0x25b6 }, /* filledrighttribullet ▶ BLACK RIGHT-POINTING TRIANGLE */ + { 0x0ade, 0x25cf }, /* emfilledcircle ● BLACK CIRCLE */ + { 0x0adf, 0x25ae }, /* emfilledrect ▮ BLACK VERTICAL RECTANGLE */ + { 0x0ae0, 0x25e6 }, /* enopencircbullet ◦ WHITE BULLET */ + { 0x0ae1, 0x25ab }, /* enopensquarebullet ▫ WHITE SMALL SQUARE */ + { 0x0ae2, 0x25ad }, /* openrectbullet ▭ WHITE RECTANGLE */ + { 0x0ae3, 0x25b3 }, /* opentribulletup △ WHITE UP-POINTING TRIANGLE */ + { 0x0ae4, 0x25bd }, /* opentribulletdown ▽ WHITE DOWN-POINTING TRIANGLE */ + { 0x0ae5, 0x2606 }, /* openstar ☆ WHITE STAR */ + { 0x0ae6, 0x2022 }, /* enfilledcircbullet • BULLET */ + { 0x0ae7, 0x25aa }, /* enfilledsqbullet ▪ BLACK SMALL SQUARE */ + { 0x0ae8, 0x25b2 }, /* filledtribulletup ▲ BLACK UP-POINTING TRIANGLE */ + { 0x0ae9, 0x25bc }, /* filledtribulletdown ▼ BLACK DOWN-POINTING TRIANGLE */ + { 0x0aea, 0x261c }, /* leftpointer ☜ WHITE LEFT POINTING INDEX */ + { 0x0aeb, 0x261e }, /* rightpointer ☞ WHITE RIGHT POINTING INDEX */ + { 0x0aec, 0x2663 }, /* club ♣ BLACK CLUB SUIT */ + { 0x0aed, 0x2666 }, /* diamond ♦ BLACK DIAMOND SUIT */ + { 0x0aee, 0x2665 }, /* heart ♥ BLACK HEART SUIT */ + { 0x0af0, 0x2720 }, /* maltesecross ✠ MALTESE CROSS */ + { 0x0af1, 0x2020 }, /* dagger † DAGGER */ + { 0x0af2, 0x2021 }, /* doubledagger ‡ DOUBLE DAGGER */ + { 0x0af3, 0x2713 }, /* checkmark ✓ CHECK MARK */ + { 0x0af4, 0x2717 }, /* ballotcross ✗ BALLOT X */ + { 0x0af5, 0x266f }, /* musicalsharp ♯ MUSIC SHARP SIGN */ + { 0x0af6, 0x266d }, /* musicalflat ♭ MUSIC FLAT SIGN */ + { 0x0af7, 0x2642 }, /* malesymbol ♂ MALE SIGN */ + { 0x0af8, 0x2640 }, /* femalesymbol ♀ FEMALE SIGN */ + { 0x0af9, 0x260e }, /* telephone ☎ BLACK TELEPHONE */ + { 0x0afa, 0x2315 }, /* telephonerecorder ⌕ TELEPHONE RECORDER */ + { 0x0afb, 0x2117 }, /* phonographcopyright ℗ SOUND RECORDING COPYRIGHT */ + { 0x0afc, 0x2038 }, /* caret ‸ CARET */ + { 0x0afd, 0x201a }, /* singlelowquotemark ‚ SINGLE LOW-9 QUOTATION MARK */ + { 0x0afe, 0x201e }, /* doublelowquotemark „ DOUBLE LOW-9 QUOTATION MARK */ + /* 0x0aff cursor ? ??? */ + { 0x0ba3, 0x003c }, /* leftcaret < LESS-THAN SIGN */ + { 0x0ba6, 0x003e }, /* rightcaret > GREATER-THAN SIGN */ + { 0x0ba8, 0x2228 }, /* downcaret ∨ LOGICAL OR */ + { 0x0ba9, 0x2227 }, /* upcaret ∧ LOGICAL AND */ + { 0x0bc0, 0x00af }, /* overbar ¯ MACRON */ + { 0x0bc2, 0x22a4 }, /* downtack ⊤ DOWN TACK */ + { 0x0bc3, 0x2229 }, /* upshoe ∩ INTERSECTION */ + { 0x0bc4, 0x230a }, /* downstile ⌊ LEFT FLOOR */ + { 0x0bc6, 0x005f }, /* underbar _ LOW LINE */ + { 0x0bca, 0x2218 }, /* jot ∘ RING OPERATOR */ + { 0x0bcc, 0x2395 }, /* quad ⎕ APL FUNCTIONAL SYMBOL QUAD (Unicode 3.0) */ + { 0x0bce, 0x22a5 }, /* uptack ⊥ UP TACK */ + { 0x0bcf, 0x25cb }, /* circle ○ WHITE CIRCLE */ + { 0x0bd3, 0x2308 }, /* upstile ⌈ LEFT CEILING */ + { 0x0bd6, 0x222a }, /* downshoe ∪ UNION */ + { 0x0bd8, 0x2283 }, /* rightshoe ⊃ SUPERSET OF */ + { 0x0bda, 0x2282 }, /* leftshoe ⊂ SUBSET OF */ + { 0x0bdc, 0x22a2 }, /* lefttack ⊢ RIGHT TACK */ + { 0x0bfc, 0x22a3 }, /* righttack ⊣ LEFT TACK */ + { 0x0cdf, 0x2017 }, /* hebrew_doublelowline ‗ DOUBLE LOW LINE */ + { 0x0ce0, 0x05d0 }, /* hebrew_aleph א HEBREW LETTER ALEF */ + { 0x0ce1, 0x05d1 }, /* hebrew_bet ב HEBREW LETTER BET */ + { 0x0ce2, 0x05d2 }, /* hebrew_gimel ג HEBREW LETTER GIMEL */ + { 0x0ce3, 0x05d3 }, /* hebrew_dalet ד HEBREW LETTER DALET */ + { 0x0ce4, 0x05d4 }, /* hebrew_he ה HEBREW LETTER HE */ + { 0x0ce5, 0x05d5 }, /* hebrew_waw ו HEBREW LETTER VAV */ + { 0x0ce6, 0x05d6 }, /* hebrew_zain ז HEBREW LETTER ZAYIN */ + { 0x0ce7, 0x05d7 }, /* hebrew_chet ח HEBREW LETTER HET */ + { 0x0ce8, 0x05d8 }, /* hebrew_tet ט HEBREW LETTER TET */ + { 0x0ce9, 0x05d9 }, /* hebrew_yod י HEBREW LETTER YOD */ + { 0x0cea, 0x05da }, /* hebrew_finalkaph ך HEBREW LETTER FINAL KAF */ + { 0x0ceb, 0x05db }, /* hebrew_kaph כ HEBREW LETTER KAF */ + { 0x0cec, 0x05dc }, /* hebrew_lamed ל HEBREW LETTER LAMED */ + { 0x0ced, 0x05dd }, /* hebrew_finalmem ם HEBREW LETTER FINAL MEM */ + { 0x0cee, 0x05de }, /* hebrew_mem מ HEBREW LETTER MEM */ + { 0x0cef, 0x05df }, /* hebrew_finalnun ן HEBREW LETTER FINAL NUN */ + { 0x0cf0, 0x05e0 }, /* hebrew_nun נ HEBREW LETTER NUN */ + { 0x0cf1, 0x05e1 }, /* hebrew_samech ס HEBREW LETTER SAMEKH */ + { 0x0cf2, 0x05e2 }, /* hebrew_ayin ע HEBREW LETTER AYIN */ + { 0x0cf3, 0x05e3 }, /* hebrew_finalpe ף HEBREW LETTER FINAL PE */ + { 0x0cf4, 0x05e4 }, /* hebrew_pe פ HEBREW LETTER PE */ + { 0x0cf5, 0x05e5 }, /* hebrew_finalzade ץ HEBREW LETTER FINAL TSADI */ + { 0x0cf6, 0x05e6 }, /* hebrew_zade צ HEBREW LETTER TSADI */ + { 0x0cf7, 0x05e7 }, /* hebrew_qoph ק HEBREW LETTER QOF */ + { 0x0cf8, 0x05e8 }, /* hebrew_resh ר HEBREW LETTER RESH */ + { 0x0cf9, 0x05e9 }, /* hebrew_shin ש HEBREW LETTER SHIN */ + { 0x0cfa, 0x05ea }, /* hebrew_taw ת HEBREW LETTER TAV */ + { 0x0da1, 0x0e01 }, /* Thai_kokai ก THAI CHARACTER KO KAI */ + { 0x0da2, 0x0e02 }, /* Thai_khokhai ข THAI CHARACTER KHO KHAI */ + { 0x0da3, 0x0e03 }, /* Thai_khokhuat ฃ THAI CHARACTER KHO KHUAT */ + { 0x0da4, 0x0e04 }, /* Thai_khokhwai ค THAI CHARACTER KHO KHWAI */ + { 0x0da5, 0x0e05 }, /* Thai_khokhon ฅ THAI CHARACTER KHO KHON */ + { 0x0da6, 0x0e06 }, /* Thai_khorakhang ฆ THAI CHARACTER KHO RAKHANG */ + { 0x0da7, 0x0e07 }, /* Thai_ngongu ง THAI CHARACTER NGO NGU */ + { 0x0da8, 0x0e08 }, /* Thai_chochan จ THAI CHARACTER CHO CHAN */ + { 0x0da9, 0x0e09 }, /* Thai_choching ฉ THAI CHARACTER CHO CHING */ + { 0x0daa, 0x0e0a }, /* Thai_chochang ช THAI CHARACTER CHO CHANG */ + { 0x0dab, 0x0e0b }, /* Thai_soso ซ THAI CHARACTER SO SO */ + { 0x0dac, 0x0e0c }, /* Thai_chochoe ฌ THAI CHARACTER CHO CHOE */ + { 0x0dad, 0x0e0d }, /* Thai_yoying ญ THAI CHARACTER YO YING */ + { 0x0dae, 0x0e0e }, /* Thai_dochada ฎ THAI CHARACTER DO CHADA */ + { 0x0daf, 0x0e0f }, /* Thai_topatak ฏ THAI CHARACTER TO PATAK */ + { 0x0db0, 0x0e10 }, /* Thai_thothan ฐ THAI CHARACTER THO THAN */ + { 0x0db1, 0x0e11 }, /* Thai_thonangmontho ฑ THAI CHARACTER THO NANGMONTHO */ + { 0x0db2, 0x0e12 }, /* Thai_thophuthao ฒ THAI CHARACTER THO PHUTHAO */ + { 0x0db3, 0x0e13 }, /* Thai_nonen ณ THAI CHARACTER NO NEN */ + { 0x0db4, 0x0e14 }, /* Thai_dodek ด THAI CHARACTER DO DEK */ + { 0x0db5, 0x0e15 }, /* Thai_totao ต THAI CHARACTER TO TAO */ + { 0x0db6, 0x0e16 }, /* Thai_thothung ถ THAI CHARACTER THO THUNG */ + { 0x0db7, 0x0e17 }, /* Thai_thothahan ท THAI CHARACTER THO THAHAN */ + { 0x0db8, 0x0e18 }, /* Thai_thothong ธ THAI CHARACTER THO THONG */ + { 0x0db9, 0x0e19 }, /* Thai_nonu น THAI CHARACTER NO NU */ + { 0x0dba, 0x0e1a }, /* Thai_bobaimai บ THAI CHARACTER BO BAIMAI */ + { 0x0dbb, 0x0e1b }, /* Thai_popla ป THAI CHARACTER PO PLA */ + { 0x0dbc, 0x0e1c }, /* Thai_phophung ผ THAI CHARACTER PHO PHUNG */ + { 0x0dbd, 0x0e1d }, /* Thai_fofa ฝ THAI CHARACTER FO FA */ + { 0x0dbe, 0x0e1e }, /* Thai_phophan พ THAI CHARACTER PHO PHAN */ + { 0x0dbf, 0x0e1f }, /* Thai_fofan ฟ THAI CHARACTER FO FAN */ + { 0x0dc0, 0x0e20 }, /* Thai_phosamphao ภ THAI CHARACTER PHO SAMPHAO */ + { 0x0dc1, 0x0e21 }, /* Thai_moma ม THAI CHARACTER MO MA */ + { 0x0dc2, 0x0e22 }, /* Thai_yoyak ย THAI CHARACTER YO YAK */ + { 0x0dc3, 0x0e23 }, /* Thai_rorua ร THAI CHARACTER RO RUA */ + { 0x0dc4, 0x0e24 }, /* Thai_ru ฤ THAI CHARACTER RU */ + { 0x0dc5, 0x0e25 }, /* Thai_loling ล THAI CHARACTER LO LING */ + { 0x0dc6, 0x0e26 }, /* Thai_lu ฦ THAI CHARACTER LU */ + { 0x0dc7, 0x0e27 }, /* Thai_wowaen ว THAI CHARACTER WO WAEN */ + { 0x0dc8, 0x0e28 }, /* Thai_sosala ศ THAI CHARACTER SO SALA */ + { 0x0dc9, 0x0e29 }, /* Thai_sorusi ษ THAI CHARACTER SO RUSI */ + { 0x0dca, 0x0e2a }, /* Thai_sosua ส THAI CHARACTER SO SUA */ + { 0x0dcb, 0x0e2b }, /* Thai_hohip ห THAI CHARACTER HO HIP */ + { 0x0dcc, 0x0e2c }, /* Thai_lochula ฬ THAI CHARACTER LO CHULA */ + { 0x0dcd, 0x0e2d }, /* Thai_oang อ THAI CHARACTER O ANG */ + { 0x0dce, 0x0e2e }, /* Thai_honokhuk ฮ THAI CHARACTER HO NOKHUK */ + { 0x0dcf, 0x0e2f }, /* Thai_paiyannoi ฯ THAI CHARACTER PAIYANNOI */ + { 0x0dd0, 0x0e30 }, /* Thai_saraa ะ THAI CHARACTER SARA A */ + { 0x0dd1, 0x0e31 }, /* Thai_maihanakat ั THAI CHARACTER MAI HAN-AKAT */ + { 0x0dd2, 0x0e32 }, /* Thai_saraaa า THAI CHARACTER SARA AA */ + { 0x0dd3, 0x0e33 }, /* Thai_saraam ำ THAI CHARACTER SARA AM */ + { 0x0dd4, 0x0e34 }, /* Thai_sarai ิ THAI CHARACTER SARA I */ + { 0x0dd5, 0x0e35 }, /* Thai_saraii ี THAI CHARACTER SARA II */ + { 0x0dd6, 0x0e36 }, /* Thai_saraue ึ THAI CHARACTER SARA UE */ + { 0x0dd7, 0x0e37 }, /* Thai_sarauee ื THAI CHARACTER SARA UEE */ + { 0x0dd8, 0x0e38 }, /* Thai_sarau ุ THAI CHARACTER SARA U */ + { 0x0dd9, 0x0e39 }, /* Thai_sarauu ู THAI CHARACTER SARA UU */ + { 0x0dda, 0x0e3a }, /* Thai_phinthu ฺ THAI CHARACTER PHINTHU */ + { 0x0dde, 0x0e3e }, /* Thai_maihanakat_maitho ??? */ + { 0x0ddf, 0x0e3f }, /* Thai_baht ฿ THAI CURRENCY SYMBOL BAHT */ + { 0x0de0, 0x0e40 }, /* Thai_sarae เ THAI CHARACTER SARA E */ + { 0x0de1, 0x0e41 }, /* Thai_saraae แ THAI CHARACTER SARA AE */ + { 0x0de2, 0x0e42 }, /* Thai_sarao โ THAI CHARACTER SARA O */ + { 0x0de3, 0x0e43 }, /* Thai_saraaimaimuan ใ THAI CHARACTER SARA AI MAIMUAN */ + { 0x0de4, 0x0e44 }, /* Thai_saraaimaimalai ไ THAI CHARACTER SARA AI MAIMALAI */ + { 0x0de5, 0x0e45 }, /* Thai_lakkhangyao ๅ THAI CHARACTER LAKKHANGYAO */ + { 0x0de6, 0x0e46 }, /* Thai_maiyamok ๆ THAI CHARACTER MAIYAMOK */ + { 0x0de7, 0x0e47 }, /* Thai_maitaikhu ็ THAI CHARACTER MAITAIKHU */ + { 0x0de8, 0x0e48 }, /* Thai_maiek ่ THAI CHARACTER MAI EK */ + { 0x0de9, 0x0e49 }, /* Thai_maitho ้ THAI CHARACTER MAI THO */ + { 0x0dea, 0x0e4a }, /* Thai_maitri ๊ THAI CHARACTER MAI TRI */ + { 0x0deb, 0x0e4b }, /* Thai_maichattawa ๋ THAI CHARACTER MAI CHATTAWA */ + { 0x0dec, 0x0e4c }, /* Thai_thanthakhat ์ THAI CHARACTER THANTHAKHAT */ + { 0x0ded, 0x0e4d }, /* Thai_nikhahit ํ THAI CHARACTER NIKHAHIT */ + { 0x0df0, 0x0e50 }, /* Thai_leksun ๐ THAI DIGIT ZERO */ + { 0x0df1, 0x0e51 }, /* Thai_leknung ๑ THAI DIGIT ONE */ + { 0x0df2, 0x0e52 }, /* Thai_leksong ๒ THAI DIGIT TWO */ + { 0x0df3, 0x0e53 }, /* Thai_leksam ๓ THAI DIGIT THREE */ + { 0x0df4, 0x0e54 }, /* Thai_leksi ๔ THAI DIGIT FOUR */ + { 0x0df5, 0x0e55 }, /* Thai_lekha ๕ THAI DIGIT FIVE */ + { 0x0df6, 0x0e56 }, /* Thai_lekhok ๖ THAI DIGIT SIX */ + { 0x0df7, 0x0e57 }, /* Thai_lekchet ๗ THAI DIGIT SEVEN */ + { 0x0df8, 0x0e58 }, /* Thai_lekpaet ๘ THAI DIGIT EIGHT */ + { 0x0df9, 0x0e59 }, /* Thai_lekkao ๙ THAI DIGIT NINE */ + { 0x0ea1, 0x3131 }, /* Hangul_Kiyeog ㄱ HANGUL LETTER KIYEOK */ + { 0x0ea2, 0x3132 }, /* Hangul_SsangKiyeog ㄲ HANGUL LETTER SSANGKIYEOK */ + { 0x0ea3, 0x3133 }, /* Hangul_KiyeogSios ㄳ HANGUL LETTER KIYEOK-SIOS */ + { 0x0ea4, 0x3134 }, /* Hangul_Nieun ㄴ HANGUL LETTER NIEUN */ + { 0x0ea5, 0x3135 }, /* Hangul_NieunJieuj ㄵ HANGUL LETTER NIEUN-CIEUC */ + { 0x0ea6, 0x3136 }, /* Hangul_NieunHieuh ㄶ HANGUL LETTER NIEUN-HIEUH */ + { 0x0ea7, 0x3137 }, /* Hangul_Dikeud ㄷ HANGUL LETTER TIKEUT */ + { 0x0ea8, 0x3138 }, /* Hangul_SsangDikeud ㄸ HANGUL LETTER SSANGTIKEUT */ + { 0x0ea9, 0x3139 }, /* Hangul_Rieul ㄹ HANGUL LETTER RIEUL */ + { 0x0eaa, 0x313a }, /* Hangul_RieulKiyeog ㄺ HANGUL LETTER RIEUL-KIYEOK */ + { 0x0eab, 0x313b }, /* Hangul_RieulMieum ㄻ HANGUL LETTER RIEUL-MIEUM */ + { 0x0eac, 0x313c }, /* Hangul_RieulPieub ㄼ HANGUL LETTER RIEUL-PIEUP */ + { 0x0ead, 0x313d }, /* Hangul_RieulSios ㄽ HANGUL LETTER RIEUL-SIOS */ + { 0x0eae, 0x313e }, /* Hangul_RieulTieut ㄾ HANGUL LETTER RIEUL-THIEUTH */ + { 0x0eaf, 0x313f }, /* Hangul_RieulPhieuf ㄿ HANGUL LETTER RIEUL-PHIEUPH */ + { 0x0eb0, 0x3140 }, /* Hangul_RieulHieuh ㅀ HANGUL LETTER RIEUL-HIEUH */ + { 0x0eb1, 0x3141 }, /* Hangul_Mieum ㅁ HANGUL LETTER MIEUM */ + { 0x0eb2, 0x3142 }, /* Hangul_Pieub ㅂ HANGUL LETTER PIEUP */ + { 0x0eb3, 0x3143 }, /* Hangul_SsangPieub ㅃ HANGUL LETTER SSANGPIEUP */ + { 0x0eb4, 0x3144 }, /* Hangul_PieubSios ㅄ HANGUL LETTER PIEUP-SIOS */ + { 0x0eb5, 0x3145 }, /* Hangul_Sios ㅅ HANGUL LETTER SIOS */ + { 0x0eb6, 0x3146 }, /* Hangul_SsangSios ㅆ HANGUL LETTER SSANGSIOS */ + { 0x0eb7, 0x3147 }, /* Hangul_Ieung ㅇ HANGUL LETTER IEUNG */ + { 0x0eb8, 0x3148 }, /* Hangul_Jieuj ㅈ HANGUL LETTER CIEUC */ + { 0x0eb9, 0x3149 }, /* Hangul_SsangJieuj ㅉ HANGUL LETTER SSANGCIEUC */ + { 0x0eba, 0x314a }, /* Hangul_Cieuc ㅊ HANGUL LETTER CHIEUCH */ + { 0x0ebb, 0x314b }, /* Hangul_Khieuq ㅋ HANGUL LETTER KHIEUKH */ + { 0x0ebc, 0x314c }, /* Hangul_Tieut ㅌ HANGUL LETTER THIEUTH */ + { 0x0ebd, 0x314d }, /* Hangul_Phieuf ㅍ HANGUL LETTER PHIEUPH */ + { 0x0ebe, 0x314e }, /* Hangul_Hieuh ㅎ HANGUL LETTER HIEUH */ + { 0x0ebf, 0x314f }, /* Hangul_A ㅏ HANGUL LETTER A */ + { 0x0ec0, 0x3150 }, /* Hangul_AE ㅐ HANGUL LETTER AE */ + { 0x0ec1, 0x3151 }, /* Hangul_YA ㅑ HANGUL LETTER YA */ + { 0x0ec2, 0x3152 }, /* Hangul_YAE ㅒ HANGUL LETTER YAE */ + { 0x0ec3, 0x3153 }, /* Hangul_EO ㅓ HANGUL LETTER EO */ + { 0x0ec4, 0x3154 }, /* Hangul_E ㅔ HANGUL LETTER E */ + { 0x0ec5, 0x3155 }, /* Hangul_YEO ㅕ HANGUL LETTER YEO */ + { 0x0ec6, 0x3156 }, /* Hangul_YE ㅖ HANGUL LETTER YE */ + { 0x0ec7, 0x3157 }, /* Hangul_O ㅗ HANGUL LETTER O */ + { 0x0ec8, 0x3158 }, /* Hangul_WA ㅘ HANGUL LETTER WA */ + { 0x0ec9, 0x3159 }, /* Hangul_WAE ㅙ HANGUL LETTER WAE */ + { 0x0eca, 0x315a }, /* Hangul_OE ㅚ HANGUL LETTER OE */ + { 0x0ecb, 0x315b }, /* Hangul_YO ㅛ HANGUL LETTER YO */ + { 0x0ecc, 0x315c }, /* Hangul_U ㅜ HANGUL LETTER U */ + { 0x0ecd, 0x315d }, /* Hangul_WEO ㅝ HANGUL LETTER WEO */ + { 0x0ece, 0x315e }, /* Hangul_WE ㅞ HANGUL LETTER WE */ + { 0x0ecf, 0x315f }, /* Hangul_WI ㅟ HANGUL LETTER WI */ + { 0x0ed0, 0x3160 }, /* Hangul_YU ㅠ HANGUL LETTER YU */ + { 0x0ed1, 0x3161 }, /* Hangul_EU ㅡ HANGUL LETTER EU */ + { 0x0ed2, 0x3162 }, /* Hangul_YI ㅢ HANGUL LETTER YI */ + { 0x0ed3, 0x3163 }, /* Hangul_I ㅣ HANGUL LETTER I */ + { 0x0ed4, 0x11a8 }, /* Hangul_J_Kiyeog ᆨ HANGUL JONGSEONG KIYEOK */ + { 0x0ed5, 0x11a9 }, /* Hangul_J_SsangKiyeog ᆩ HANGUL JONGSEONG SSANGKIYEOK */ + { 0x0ed6, 0x11aa }, /* Hangul_J_KiyeogSios ᆪ HANGUL JONGSEONG KIYEOK-SIOS */ + { 0x0ed7, 0x11ab }, /* Hangul_J_Nieun ᆫ HANGUL JONGSEONG NIEUN */ + { 0x0ed8, 0x11ac }, /* Hangul_J_NieunJieuj ᆬ HANGUL JONGSEONG NIEUN-CIEUC */ + { 0x0ed9, 0x11ad }, /* Hangul_J_NieunHieuh ᆭ HANGUL JONGSEONG NIEUN-HIEUH */ + { 0x0eda, 0x11ae }, /* Hangul_J_Dikeud ᆮ HANGUL JONGSEONG TIKEUT */ + { 0x0edb, 0x11af }, /* Hangul_J_Rieul ᆯ HANGUL JONGSEONG RIEUL */ + { 0x0edc, 0x11b0 }, /* Hangul_J_RieulKiyeog ᆰ HANGUL JONGSEONG RIEUL-KIYEOK */ + { 0x0edd, 0x11b1 }, /* Hangul_J_RieulMieum ᆱ HANGUL JONGSEONG RIEUL-MIEUM */ + { 0x0ede, 0x11b2 }, /* Hangul_J_RieulPieub ᆲ HANGUL JONGSEONG RIEUL-PIEUP */ + { 0x0edf, 0x11b3 }, /* Hangul_J_RieulSios ᆳ HANGUL JONGSEONG RIEUL-SIOS */ + { 0x0ee0, 0x11b4 }, /* Hangul_J_RieulTieut ᆴ HANGUL JONGSEONG RIEUL-THIEUTH */ + { 0x0ee1, 0x11b5 }, /* Hangul_J_RieulPhieuf ᆵ HANGUL JONGSEONG RIEUL-PHIEUPH */ + { 0x0ee2, 0x11b6 }, /* Hangul_J_RieulHieuh ᆶ HANGUL JONGSEONG RIEUL-HIEUH */ + { 0x0ee3, 0x11b7 }, /* Hangul_J_Mieum ᆷ HANGUL JONGSEONG MIEUM */ + { 0x0ee4, 0x11b8 }, /* Hangul_J_Pieub ᆸ HANGUL JONGSEONG PIEUP */ + { 0x0ee5, 0x11b9 }, /* Hangul_J_PieubSios ᆹ HANGUL JONGSEONG PIEUP-SIOS */ + { 0x0ee6, 0x11ba }, /* Hangul_J_Sios ᆺ HANGUL JONGSEONG SIOS */ + { 0x0ee7, 0x11bb }, /* Hangul_J_SsangSios ᆻ HANGUL JONGSEONG SSANGSIOS */ + { 0x0ee8, 0x11bc }, /* Hangul_J_Ieung ᆼ HANGUL JONGSEONG IEUNG */ + { 0x0ee9, 0x11bd }, /* Hangul_J_Jieuj ᆽ HANGUL JONGSEONG CIEUC */ + { 0x0eea, 0x11be }, /* Hangul_J_Cieuc ᆾ HANGUL JONGSEONG CHIEUCH */ + { 0x0eeb, 0x11bf }, /* Hangul_J_Khieuq ᆿ HANGUL JONGSEONG KHIEUKH */ + { 0x0eec, 0x11c0 }, /* Hangul_J_Tieut ᇀ HANGUL JONGSEONG THIEUTH */ + { 0x0eed, 0x11c1 }, /* Hangul_J_Phieuf ᇁ HANGUL JONGSEONG PHIEUPH */ + { 0x0eee, 0x11c2 }, /* Hangul_J_Hieuh ᇂ HANGUL JONGSEONG HIEUH */ + { 0x0eef, 0x316d }, /* Hangul_RieulYeorinHieuh ㅭ HANGUL LETTER RIEUL-YEORINHIEUH */ + { 0x0ef0, 0x3171 }, /* Hangul_SunkyeongeumMieum ㅱ HANGUL LETTER KAPYEOUNMIEUM */ + { 0x0ef1, 0x3178 }, /* Hangul_SunkyeongeumPieub ㅸ HANGUL LETTER KAPYEOUNPIEUP */ + { 0x0ef2, 0x317f }, /* Hangul_PanSios ㅿ HANGUL LETTER PANSIOS */ +/* 0x0ef3 Hangul_KkogjiDalrinIeung ? ??? */ + { 0x0ef4, 0x3184 }, /* Hangul_SunkyeongeumPhieuf ㆄ HANGUL LETTER KAPYEOUNPHIEUPH */ + { 0x0ef5, 0x3186 }, /* Hangul_YeorinHieuh ㆆ HANGUL LETTER YEORINHIEUH */ + { 0x0ef6, 0x318d }, /* Hangul_AraeA ㆍ HANGUL LETTER ARAEA */ + { 0x0ef7, 0x318e }, /* Hangul_AraeAE ㆎ HANGUL LETTER ARAEAE */ + { 0x0ef8, 0x11eb }, /* Hangul_J_PanSios ᇫ HANGUL JONGSEONG PANSIOS */ + { 0x0ef9, 0x11f0 }, /* Hangul_J_KkogjiDalrinIeung ᇰ HANGUL JONGSEONG YESIEUNG */ + { 0x0efa, 0x11f9 }, /* Hangul_J_YeorinHieuh ᇹ HANGUL JONGSEONG YEORINHIEUH */ + { 0x0eff, 0x20a9 }, /* Korean_Won ₩ WON SIGN */ + { 0x13a4, 0x20ac }, /* Euro € EURO SIGN */ + { 0x13bc, 0x0152 }, /* OE Œ LATIN CAPITAL LIGATURE OE */ + { 0x13bd, 0x0153 }, /* oe œ LATIN SMALL LIGATURE OE */ + { 0x13be, 0x0178 }, /* Ydiaeresis Ÿ LATIN CAPITAL LETTER Y WITH DIAERESIS */ + { 0x20a0, 0x20a0 }, /* EcuSign ₠ EURO-CURRENCY SIGN */ + { 0x20a1, 0x20a1 }, /* ColonSign ₡ COLON SIGN */ + { 0x20a2, 0x20a2 }, /* CruzeiroSign ₢ CRUZEIRO SIGN */ + { 0x20a3, 0x20a3 }, /* FFrancSign ₣ FRENCH FRANC SIGN */ + { 0x20a4, 0x20a4 }, /* LiraSign ₤ LIRA SIGN */ + { 0x20a5, 0x20a5 }, /* MillSign ₥ MILL SIGN */ + { 0x20a6, 0x20a6 }, /* NairaSign ₦ NAIRA SIGN */ + { 0x20a7, 0x20a7 }, /* PesetaSign ₧ PESETA SIGN */ + { 0x20a8, 0x20a8 }, /* RupeeSign ₨ RUPEE SIGN */ + { 0x20a9, 0x20a9 }, /* WonSign ₩ WON SIGN */ + { 0x20aa, 0x20aa }, /* NewSheqelSign ₪ NEW SHEQEL SIGN */ + { 0x20ab, 0x20ab }, /* DongSign ₫ DONG SIGN */ + { 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */ +}; + +/* binary search with range check */ +static uint32_t +bin_search(const struct codepair *table, size_t length, xkb_keysym_t keysym) +{ + int min = 0; + int max = length; + int mid; + + if (keysym < table[0].keysym || keysym > table[length].keysym) + return 0; + + /* binary search in table */ + while (max >= min) { + mid = (min + max) / 2; + if (table[mid].keysym < keysym) + min = mid + 1; + else if (table[mid].keysym > keysym) + max = mid - 1; + else /* found it */ + return table[mid].ucs; + } + + /* no matching Unicode value found in table */ + return 0; +} + +XKB_EXPORT uint32_t +xkb_keysym_to_utf32(xkb_keysym_t keysym) +{ + /* first check for Latin-1 characters (1:1 mapping) */ + if ((keysym >= 0x0020 && keysym <= 0x007e) || + (keysym >= 0x00a0 && keysym <= 0x00ff)) + return keysym; + + /* patch encoding botch */ + if (keysym == XKB_KEY_KP_Space) + return XKB_KEY_space & 0x7f; + + /* special keysyms */ + if ((keysym >= XKB_KEY_BackSpace && keysym <= XKB_KEY_Clear) || + (keysym >= XKB_KEY_KP_Multiply && keysym <= XKB_KEY_KP_9) || + keysym == XKB_KEY_Return || keysym == XKB_KEY_Escape || + keysym == XKB_KEY_Delete || keysym == XKB_KEY_KP_Tab || + keysym == XKB_KEY_KP_Enter || keysym == XKB_KEY_KP_Equal) + return keysym & 0x7f; + + /* also check for directly encoded 24-bit UCS characters */ + if ((keysym & 0xff000000) == 0x01000000) + return keysym & 0x00ffffff; + + /* search main table */ + return bin_search(keysymtab, ARRAY_SIZE(keysymtab) - 1, keysym); +} + +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Rob Bradford <rob@linux.intel.com> + */ + +static int +utf32_to_utf8(uint32_t unichar, char *buffer) +{ + int count, shift, length; + uint8_t head; + + if (unichar <= 0x007f) { + buffer[0] = unichar; + buffer[1] = '\0'; + return 2; + } + else if (unichar <= 0x07FF) { + length = 2; + head = 0xc0; + } + else if (unichar <= 0xffff) { + length = 3; + head = 0xe0; + } + else if (unichar <= 0x1fffff) { + length = 4; + head = 0xf0; + } + else if (unichar <= 0x3ffffff) { + length = 5; + head = 0xf8; + } + else { + length = 6; + head = 0xfc; + } + + for (count = length - 1, shift = 0; count > 0; count--, shift += 6) + buffer[count] = 0x80 | ((unichar >> shift) & 0x3f); + + buffer[0] = head | ((unichar >> shift) & 0x3f); + buffer[length] = '\0'; + + return length + 1; +} + +XKB_EXPORT int +xkb_keysym_to_utf8(xkb_keysym_t keysym, char *buffer, size_t size) +{ + uint32_t codepoint; + + if (size < 7) + return -1; + + codepoint = xkb_keysym_to_utf32(keysym); + + if (codepoint == 0) + return 0; + + return utf32_to_utf8(codepoint, buffer); +} diff --git a/src/3rdparty/xkbcommon/src/keysym.c b/src/3rdparty/xkbcommon/src/keysym.c new file mode 100644 index 0000000000..1e92a4ac9f --- /dev/null +++ b/src/3rdparty/xkbcommon/src/keysym.c @@ -0,0 +1,720 @@ +/* + * Copyright 1985, 1987, 1990, 1998 The Open Group + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the names of the authors or their + * institutions shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the authors. + */ + +/* + * Copyright © 2009 Dan Nicholson + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <stdlib.h> +#include "xkbcommon/xkbcommon.h" +#include "utils.h" +#include "keysym.h" +#include "ks_tables.h" + +static int +compare_by_keysym(const void *a, const void *b) +{ + const struct name_keysym *key = a, *entry = b; + return key->keysym - (int32_t)entry->keysym; +} + +static int +compare_by_name(const void *a, const void *b) +{ + const struct name_keysym *key = a, *entry = b; + return strcasecmp(key->name, entry->name); +} + +XKB_EXPORT int +xkb_keysym_get_name(xkb_keysym_t ks, char *buffer, size_t size) +{ + const struct name_keysym search = { .name = NULL, .keysym = ks }; + const struct name_keysym *entry; + + if ((ks & ((unsigned long) ~0x1fffffff)) != 0) { + snprintf(buffer, size, "Invalid"); + return -1; + } + + entry = bsearch(&search, keysym_to_name, + ARRAY_SIZE(keysym_to_name), + sizeof(*keysym_to_name), + compare_by_keysym); + if (entry) + return snprintf(buffer, size, "%s", entry->name); + + /* Unnamed Unicode codepoint. */ + if (ks >= 0x01000100 && ks <= 0x0110ffff) { + const int width = (ks & 0xff0000UL) ? 8 : 4; + return snprintf(buffer, size, "U%0*lX", width, ks & 0xffffffUL); + } + + /* Unnamed, non-Unicode, symbol (shouldn't generally happen). */ + return snprintf(buffer, size, "0x%08x", ks); +} + +/* + * Find the correct keysym if one case-insensitive match is given. + * + * The name_to_keysym table is sorted by strcasecmp(). So bsearch() may return + * _any_ of all possible case-insensitive duplicates. This function searches the + * returned entry @entry, all previous and all next entries that match by + * case-insensitive comparison and returns the exact match to @name. If @icase + * is true, then this returns the best case-insensitive match instead of a + * correct match. + * The "best" case-insensitive match is the lower-case keysym which we find with + * the help of xkb_keysym_is_lower(). + * The only keysyms that only differ by letter-case are keysyms that are + * available as lower-case and upper-case variant (like KEY_a and KEY_A). So + * returning the first lower-case match is enough in this case. + */ +static const struct name_keysym * +find_sym(const struct name_keysym *entry, const char *name, bool icase) +{ + const struct name_keysym *iter, *last; + size_t len = ARRAY_SIZE(name_to_keysym); + + if (!entry) + return NULL; + + if (!icase && strcmp(entry->name, name) == 0) + return entry; + if (icase && xkb_keysym_is_lower(entry->keysym)) + return entry; + + for (iter = entry - 1; iter >= name_to_keysym; --iter) { + if (!icase && strcmp(iter->name, name) == 0) + return iter; + if (strcasecmp(iter->name, entry->name) != 0) + break; + if (icase && xkb_keysym_is_lower(iter->keysym)) + return iter; + } + + last = name_to_keysym + len; + for (iter = entry + 1; iter < last; --iter) { + if (!icase && strcmp(iter->name, name) == 0) + return iter; + if (strcasecmp(iter->name, entry->name) != 0) + break; + if (icase && xkb_keysym_is_lower(iter->keysym)) + return iter; + } + + if (icase) + return entry; + return NULL; +} + +XKB_EXPORT xkb_keysym_t +xkb_keysym_from_name(const char *s, enum xkb_keysym_flags flags) +{ + const struct name_keysym search = { .name = s, .keysym = 0 }; + const struct name_keysym *entry; + char *tmp; + xkb_keysym_t val; + bool icase = !!(flags & XKB_KEYSYM_CASE_INSENSITIVE); + + if (flags & ~XKB_KEYSYM_CASE_INSENSITIVE) + return XKB_KEY_NoSymbol; + + entry = bsearch(&search, name_to_keysym, + ARRAY_SIZE(name_to_keysym), + sizeof(*name_to_keysym), + compare_by_name); + entry = find_sym(entry, s, icase); + if (entry) + return entry->keysym; + + if (*s == 'U' || (icase && *s == 'u')) { + val = strtoul(&s[1], &tmp, 16); + if (tmp && *tmp != '\0') + return XKB_KEY_NoSymbol; + + if (val < 0x20 || (val > 0x7e && val < 0xa0)) + return XKB_KEY_NoSymbol; + if (val < 0x100) + return val; + if (val > 0x10ffff) + return XKB_KEY_NoSymbol; + return val | 0x01000000; + } + else if (s[0] == '0' && (s[1] == 'x' || (icase && s[1] == 'X'))) { + val = strtoul(&s[2], &tmp, 16); + if (tmp && *tmp != '\0') + return XKB_KEY_NoSymbol; + + return val; + } + + /* Stupid inconsistency between the headers and XKeysymDB: the former has + * no separating underscore, while some XF86* syms in the latter did. + * As a last ditch effort, try without. */ + if (strncmp(s, "XF86_", 5) == 0 || + (icase && strncasecmp(s, "XF86_", 5) == 0)) { + xkb_keysym_t ret; + tmp = strdup(s); + if (!tmp) + return XKB_KEY_NoSymbol; + memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1); + ret = xkb_keysym_from_name(tmp, flags); + free(tmp); + return ret; + } + + return XKB_KEY_NoSymbol; +} + +bool +xkb_keysym_is_keypad(xkb_keysym_t keysym) +{ + return keysym >= XKB_KEY_KP_Space && keysym <= XKB_KEY_KP_Equal; +} + +static void +XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper); + +bool +xkb_keysym_is_lower(xkb_keysym_t ks) +{ + xkb_keysym_t lower, upper; + + XConvertCase(ks, &lower, &upper); + + if (lower == upper) + return false; + + return (ks == lower ? true : false); +} + +bool +xkb_keysym_is_upper(xkb_keysym_t ks) +{ + xkb_keysym_t lower, upper; + + XConvertCase(ks, &lower, &upper); + + if (lower == upper) + return false; + + return (ks == upper ? true : false); +} + +/* + * The following is copied verbatim from libX11:src/KeyBind.c, commit + * d45b3fc19fbe95c41afc4e51d768df6d42332010, with the following changes: + * - unsigned -> uint32_t + * - unsigend short -> uint16_t + * - s/XK_/XKB_KEY_ + * + * XXX: If newlocale() and iswlower_l()/iswupper_l() interface ever + * become portable, we should use that in conjunction with + * xkb_keysym_to_utf32(), instead of all this stuff. We should + * be sure to give the same results as libX11, though, and be + * locale independent; this information is used by xkbcomp to + * find the automatic type to assign to key groups. + */ + +static void +UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) +{ + /* Case conversion for UCS, as in Unicode Data version 4.0.0 */ + /* NB: Only converts simple one-to-one mappings. */ + + /* Tables are used where they take less space than */ + /* the code to work out the mappings. Zero values mean */ + /* undefined code points. */ + + static uint16_t const IPAExt_upper_mapping[] = { /* part only */ + 0x0181, 0x0186, 0x0255, 0x0189, 0x018A, + 0x0258, 0x018F, 0x025A, 0x0190, 0x025C, 0x025D, 0x025E, 0x025F, + 0x0193, 0x0261, 0x0262, 0x0194, 0x0264, 0x0265, 0x0266, 0x0267, + 0x0197, 0x0196, 0x026A, 0x026B, 0x026C, 0x026D, 0x026E, 0x019C, + 0x0270, 0x0271, 0x019D, 0x0273, 0x0274, 0x019F, 0x0276, 0x0277, + 0x0278, 0x0279, 0x027A, 0x027B, 0x027C, 0x027D, 0x027E, 0x027F, + 0x01A6, 0x0281, 0x0282, 0x01A9, 0x0284, 0x0285, 0x0286, 0x0287, + 0x01AE, 0x0289, 0x01B1, 0x01B2, 0x028C, 0x028D, 0x028E, 0x028F, + 0x0290, 0x0291, 0x01B7 + }; + + static uint16_t const LatinExtB_upper_mapping[] = { /* first part only */ + 0x0180, 0x0181, 0x0182, 0x0182, 0x0184, 0x0184, 0x0186, 0x0187, + 0x0187, 0x0189, 0x018A, 0x018B, 0x018B, 0x018D, 0x018E, 0x018F, + 0x0190, 0x0191, 0x0191, 0x0193, 0x0194, 0x01F6, 0x0196, 0x0197, + 0x0198, 0x0198, 0x019A, 0x019B, 0x019C, 0x019D, 0x0220, 0x019F, + 0x01A0, 0x01A0, 0x01A2, 0x01A2, 0x01A4, 0x01A4, 0x01A6, 0x01A7, + 0x01A7, 0x01A9, 0x01AA, 0x01AB, 0x01AC, 0x01AC, 0x01AE, 0x01AF, + 0x01AF, 0x01B1, 0x01B2, 0x01B3, 0x01B3, 0x01B5, 0x01B5, 0x01B7, + 0x01B8, 0x01B8, 0x01BA, 0x01BB, 0x01BC, 0x01BC, 0x01BE, 0x01F7, + 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C4, 0x01C4, 0x01C4, 0x01C7, + 0x01C7, 0x01C7, 0x01CA, 0x01CA, 0x01CA + }; + + static uint16_t const LatinExtB_lower_mapping[] = { /* first part only */ + 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188, + 0x0188, 0x0256, 0x0257, 0x018C, 0x018C, 0x018D, 0x01DD, 0x0259, + 0x025B, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268, + 0x0199, 0x0199, 0x019A, 0x019B, 0x026F, 0x0272, 0x019E, 0x0275, + 0x01A1, 0x01A1, 0x01A3, 0x01A3, 0x01A5, 0x01A5, 0x0280, 0x01A8, + 0x01A8, 0x0283, 0x01AA, 0x01AB, 0x01AD, 0x01AD, 0x0288, 0x01B0, + 0x01B0, 0x028A, 0x028B, 0x01B4, 0x01B4, 0x01B6, 0x01B6, 0x0292, + 0x01B9, 0x01B9, 0x01BA, 0x01BB, 0x01BD, 0x01BD, 0x01BE, 0x01BF, + 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C6, 0x01C6, 0x01C6, 0x01C9, + 0x01C9, 0x01C9, 0x01CC, 0x01CC, 0x01CC + }; + + static uint16_t const Greek_upper_mapping[] = { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000, + 0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x0386, 0x0387, + 0x0388, 0x0389, 0x038A, 0x0000, 0x038C, 0x0000, 0x038E, 0x038F, + 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, + 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, + 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, + 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x0386, 0x0388, 0x0389, 0x038A, + 0x03B0, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, + 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, + 0x03A0, 0x03A1, 0x03A3, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, + 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x038C, 0x038E, 0x038F, 0x0000, + 0x0392, 0x0398, 0x03D2, 0x03D3, 0x03D4, 0x03A6, 0x03A0, 0x03D7, + 0x03D8, 0x03D8, 0x03DA, 0x03DA, 0x03DC, 0x03DC, 0x03DE, 0x03DE, + 0x03E0, 0x03E0, 0x03E2, 0x03E2, 0x03E4, 0x03E4, 0x03E6, 0x03E6, + 0x03E8, 0x03E8, 0x03EA, 0x03EA, 0x03EC, 0x03EC, 0x03EE, 0x03EE, + 0x039A, 0x03A1, 0x03F9, 0x03F3, 0x03F4, 0x0395, 0x03F6, 0x03F7, + 0x03F7, 0x03F9, 0x03FA, 0x03FA, 0x0000, 0x0000, 0x0000, 0x0000 + }; + + static uint16_t const Greek_lower_mapping[] = { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000, + 0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x03AC, 0x0387, + 0x03AD, 0x03AE, 0x03AF, 0x0000, 0x03CC, 0x0000, 0x03CD, 0x03CE, + 0x0390, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, + 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + 0x03C0, 0x03C1, 0x0000, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, + 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, + 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, + 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, + 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000, + 0x03D0, 0x03D1, 0x03D2, 0x03D3, 0x03D4, 0x03D5, 0x03D6, 0x03D7, + 0x03D9, 0x03D9, 0x03DB, 0x03DB, 0x03DD, 0x03DD, 0x03DF, 0x03DF, + 0x03E1, 0x03E1, 0x03E3, 0x03E3, 0x03E5, 0x03E5, 0x03E7, 0x03E7, + 0x03E9, 0x03E9, 0x03EB, 0x03EB, 0x03ED, 0x03ED, 0x03EF, 0x03EF, + 0x03F0, 0x03F1, 0x03F2, 0x03F3, 0x03B8, 0x03F5, 0x03F6, 0x03F8, + 0x03F8, 0x03F2, 0x03FB, 0x03FB, 0x0000, 0x0000, 0x0000, 0x0000 + }; + + static uint16_t const GreekExt_lower_mapping[] = { + 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07, + 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07, + 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x0000, 0x0000, + 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x0000, 0x0000, + 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27, + 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27, + 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37, + 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37, + 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x0000, 0x0000, + 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x0000, 0x0000, + 0x1F50, 0x1F51, 0x1F52, 0x1F53, 0x1F54, 0x1F55, 0x1F56, 0x1F57, + 0x0000, 0x1F51, 0x0000, 0x1F53, 0x0000, 0x1F55, 0x0000, 0x1F57, + 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67, + 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67, + 0x1F70, 0x1F71, 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1F76, 0x1F77, + 0x1F78, 0x1F79, 0x1F7A, 0x1F7B, 0x1F7C, 0x1F7D, 0x0000, 0x0000, + 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87, + 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87, + 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97, + 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97, + 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7, + 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7, + 0x1FB0, 0x1FB1, 0x1FB2, 0x1FB3, 0x1FB4, 0x0000, 0x1FB6, 0x1FB7, + 0x1FB0, 0x1FB1, 0x1F70, 0x1F71, 0x1FB3, 0x1FBD, 0x1FBE, 0x1FBF, + 0x1FC0, 0x1FC1, 0x1FC2, 0x1FC3, 0x1FC4, 0x0000, 0x1FC6, 0x1FC7, + 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1FC3, 0x1FCD, 0x1FCE, 0x1FCF, + 0x1FD0, 0x1FD1, 0x1FD2, 0x1FD3, 0x0000, 0x0000, 0x1FD6, 0x1FD7, + 0x1FD0, 0x1FD1, 0x1F76, 0x1F77, 0x0000, 0x1FDD, 0x1FDE, 0x1FDF, + 0x1FE0, 0x1FE1, 0x1FE2, 0x1FE3, 0x1FE4, 0x1FE5, 0x1FE6, 0x1FE7, + 0x1FE0, 0x1FE1, 0x1F7A, 0x1F7B, 0x1FE5, 0x1FED, 0x1FEE, 0x1FEF, + 0x0000, 0x0000, 0x1FF2, 0x1FF3, 0x1FF4, 0x0000, 0x1FF6, 0x1FF7, + 0x1F78, 0x1F79, 0x1F7C, 0x1F7D, 0x1FF3, 0x1FFD, 0x1FFE, 0x0000 + }; + + static uint16_t const GreekExt_upper_mapping[] = { + 0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F, + 0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F, + 0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x0000, 0x0000, + 0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x0000, 0x0000, + 0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F, + 0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F, + 0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F, + 0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F, + 0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x0000, 0x0000, + 0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x0000, 0x0000, + 0x1F50, 0x1F59, 0x1F52, 0x1F5B, 0x1F54, 0x1F5D, 0x1F56, 0x1F5F, + 0x0000, 0x1F59, 0x0000, 0x1F5B, 0x0000, 0x1F5D, 0x0000, 0x1F5F, + 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F, + 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F, + 0x1FBA, 0x1FBB, 0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FDA, 0x1FDB, + 0x1FF8, 0x1FF9, 0x1FEA, 0x1FEB, 0x1FFA, 0x1FFB, 0x0000, 0x0000, + 0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F, + 0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F, + 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F, + 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F, + 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF, + 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF, + 0x1FB8, 0x1FB9, 0x1FB2, 0x1FBC, 0x1FB4, 0x0000, 0x1FB6, 0x1FB7, + 0x1FB8, 0x1FB9, 0x1FBA, 0x1FBB, 0x1FBC, 0x1FBD, 0x0399, 0x1FBF, + 0x1FC0, 0x1FC1, 0x1FC2, 0x1FCC, 0x1FC4, 0x0000, 0x1FC6, 0x1FC7, + 0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FCC, 0x1FCD, 0x1FCE, 0x1FCF, + 0x1FD8, 0x1FD9, 0x1FD2, 0x1FD3, 0x0000, 0x0000, 0x1FD6, 0x1FD7, + 0x1FD8, 0x1FD9, 0x1FDA, 0x1FDB, 0x0000, 0x1FDD, 0x1FDE, 0x1FDF, + 0x1FE8, 0x1FE9, 0x1FE2, 0x1FE3, 0x1FE4, 0x1FEC, 0x1FE6, 0x1FE7, + 0x1FE8, 0x1FE9, 0x1FEA, 0x1FEB, 0x1FEC, 0x1FED, 0x1FEE, 0x1FEF, + 0x0000, 0x0000, 0x1FF2, 0x1FFC, 0x1FF4, 0x0000, 0x1FF6, 0x1FF7, + 0x1FF8, 0x1FF9, 0x1FFA, 0x1FFB, 0x1FFC, 0x1FFD, 0x1FFE, 0x0000 + }; + + *lower = code; + *upper = code; + + /* Basic Latin and Latin-1 Supplement, U+0000 to U+00FF */ + if (code <= 0x00ff) { + if (code >= 0x0041 && code <= 0x005a) /* A-Z */ + *lower += 0x20; + else if (code >= 0x0061 && code <= 0x007a) /* a-z */ + *upper -= 0x20; + else if ( (code >= 0x00c0 && code <= 0x00d6) || + (code >= 0x00d8 && code <= 0x00de) ) + *lower += 0x20; + else if ( (code >= 0x00e0 && code <= 0x00f6) || + (code >= 0x00f8 && code <= 0x00fe) ) + *upper -= 0x20; + else if (code == 0x00ff) /* y with diaeresis */ + *upper = 0x0178; + else if (code == 0x00b5) /* micro sign */ + *upper = 0x039c; + return; + } + + /* Latin Extended-A, U+0100 to U+017F */ + if (code >= 0x0100 && code <= 0x017f) { + if ( (code >= 0x0100 && code <= 0x012f) || + (code >= 0x0132 && code <= 0x0137) || + (code >= 0x014a && code <= 0x0177) ) { + *upper = code & ~1; + *lower = code | 1; + } + else if ( (code >= 0x0139 && code <= 0x0148) || + (code >= 0x0179 && code <= 0x017e) ) { + if (code & 1) + *lower += 1; + else + *upper -= 1; + } + else if (code == 0x0130) + *lower = 0x0069; + else if (code == 0x0131) + *upper = 0x0049; + else if (code == 0x0178) + *lower = 0x00ff; + else if (code == 0x017f) + *upper = 0x0053; + return; + } + + /* Latin Extended-B, U+0180 to U+024F */ + if (code >= 0x0180 && code <= 0x024f) { + if (code >= 0x01cd && code <= 0x01dc) { + if (code & 1) + *lower += 1; + else + *upper -= 1; + } + else if ( (code >= 0x01de && code <= 0x01ef) || + (code >= 0x01f4 && code <= 0x01f5) || + (code >= 0x01f8 && code <= 0x021f) || + (code >= 0x0222 && code <= 0x0233) ) { + *lower |= 1; + *upper &= ~1; + } + else if (code >= 0x0180 && code <= 0x01cc) { + *lower = LatinExtB_lower_mapping[code - 0x0180]; + *upper = LatinExtB_upper_mapping[code - 0x0180]; + } + else if (code == 0x01dd) + *upper = 0x018e; + else if (code == 0x01f1 || code == 0x01f2) { + *lower = 0x01f3; + *upper = 0x01f1; + } + else if (code == 0x01f3) + *upper = 0x01f1; + else if (code == 0x01f6) + *lower = 0x0195; + else if (code == 0x01f7) + *lower = 0x01bf; + else if (code == 0x0220) + *lower = 0x019e; + return; + } + + /* IPA Extensions, U+0250 to U+02AF */ + if (code >= 0x0253 && code <= 0x0292) { + *upper = IPAExt_upper_mapping[code - 0x0253]; + } + + /* Combining Diacritical Marks, U+0300 to U+036F */ + if (code == 0x0345) { + *upper = 0x0399; + } + + /* Greek and Coptic, U+0370 to U+03FF */ + if (code >= 0x0370 && code <= 0x03ff) { + *lower = Greek_lower_mapping[code - 0x0370]; + *upper = Greek_upper_mapping[code - 0x0370]; + if (*upper == 0) + *upper = code; + if (*lower == 0) + *lower = code; + } + + /* Cyrillic and Cyrillic Supplementary, U+0400 to U+052F */ + if ( (code >= 0x0400 && code <= 0x04ff) || + (code >= 0x0500 && code <= 0x052f) ) { + if (code >= 0x0400 && code <= 0x040f) + *lower += 0x50; + else if (code >= 0x0410 && code <= 0x042f) + *lower += 0x20; + else if (code >= 0x0430 && code <= 0x044f) + *upper -= 0x20; + else if (code >= 0x0450 && code <= 0x045f) + *upper -= 0x50; + else if ( (code >= 0x0460 && code <= 0x0481) || + (code >= 0x048a && code <= 0x04bf) || + (code >= 0x04d0 && code <= 0x04f5) || + (code >= 0x04f8 && code <= 0x04f9) || + (code >= 0x0500 && code <= 0x050f) ) { + *upper &= ~1; + *lower |= 1; + } + else if (code >= 0x04c1 && code <= 0x04ce) { + if (code & 1) + *lower += 1; + else + *upper -= 1; + } + } + + /* Armenian, U+0530 to U+058F */ + if (code >= 0x0530 && code <= 0x058f) { + if (code >= 0x0531 && code <= 0x0556) + *lower += 0x30; + else if (code >=0x0561 && code <= 0x0586) + *upper -= 0x30; + } + + /* Latin Extended Additional, U+1E00 to U+1EFF */ + if (code >= 0x1e00 && code <= 0x1eff) { + if ( (code >= 0x1e00 && code <= 0x1e95) || + (code >= 0x1ea0 && code <= 0x1ef9) ) { + *upper &= ~1; + *lower |= 1; + } + else if (code == 0x1e9b) + *upper = 0x1e60; + } + + /* Greek Extended, U+1F00 to U+1FFF */ + if (code >= 0x1f00 && code <= 0x1fff) { + *lower = GreekExt_lower_mapping[code - 0x1f00]; + *upper = GreekExt_upper_mapping[code - 0x1f00]; + if (*upper == 0) + *upper = code; + if (*lower == 0) + *lower = code; + } + + /* Letterlike Symbols, U+2100 to U+214F */ + if (code >= 0x2100 && code <= 0x214f) { + switch (code) { + case 0x2126: *lower = 0x03c9; break; + case 0x212a: *lower = 0x006b; break; + case 0x212b: *lower = 0x00e5; break; + } + } + /* Number Forms, U+2150 to U+218F */ + else if (code >= 0x2160 && code <= 0x216f) + *lower += 0x10; + else if (code >= 0x2170 && code <= 0x217f) + *upper -= 0x10; + /* Enclosed Alphanumerics, U+2460 to U+24FF */ + else if (code >= 0x24b6 && code <= 0x24cf) + *lower += 0x1a; + else if (code >= 0x24d0 && code <= 0x24e9) + *upper -= 0x1a; + /* Halfwidth and Fullwidth Forms, U+FF00 to U+FFEF */ + else if (code >= 0xff21 && code <= 0xff3a) + *lower += 0x20; + else if (code >= 0xff41 && code <= 0xff5a) + *upper -= 0x20; + /* Deseret, U+10400 to U+104FF */ + else if (code >= 0x10400 && code <= 0x10427) + *lower += 0x28; + else if (code >= 0x10428 && code <= 0x1044f) + *upper -= 0x28; +} + +static void +XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) +{ + /* Latin 1 keysym */ + if (sym < 0x100) { + UCSConvertCase(sym, lower, upper); + return; + } + + /* Unicode keysym */ + if ((sym & 0xff000000) == 0x01000000) { + UCSConvertCase((sym & 0x00ffffff), lower, upper); + *upper |= 0x01000000; + *lower |= 0x01000000; + return; + } + + /* Legacy keysym */ + + *lower = sym; + *upper = sym; + + switch(sym >> 8) { + case 1: /* Latin 2 */ + /* Assume the KeySym is a legal value (ignore discontinuities) */ + if (sym == XKB_KEY_Aogonek) + *lower = XKB_KEY_aogonek; + else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) + *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); + else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) + *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); + else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) + *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); + else if (sym == XKB_KEY_aogonek) + *upper = XKB_KEY_Aogonek; + else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) + *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); + else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) + *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); + else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) + *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); + else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) + *lower += (XKB_KEY_racute - XKB_KEY_Racute); + else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) + *upper -= (XKB_KEY_racute - XKB_KEY_Racute); + break; + case 2: /* Latin 3 */ + /* Assume the KeySym is a legal value (ignore discontinuities) */ + if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) + *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); + else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) + *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); + else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) + *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); + else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) + *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); + else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) + *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); + else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) + *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); + break; + case 3: /* Latin 4 */ + /* Assume the KeySym is a legal value (ignore discontinuities) */ + if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) + *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); + else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) + *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); + else if (sym == XKB_KEY_ENG) + *lower = XKB_KEY_eng; + else if (sym == XKB_KEY_eng) + *upper = XKB_KEY_ENG; + else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) + *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); + else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) + *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); + break; + case 6: /* Cyrillic */ + /* Assume the KeySym is a legal value (ignore discontinuities) */ + if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) + *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); + else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) + *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); + else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) + *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); + else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) + *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); + break; + case 7: /* Greek */ + /* Assume the KeySym is a legal value (ignore discontinuities) */ + if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) + *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); + else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && + sym != XKB_KEY_Greek_iotaaccentdieresis && + sym != XKB_KEY_Greek_upsilonaccentdieresis) + *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); + else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) + *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); + else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && + sym != XKB_KEY_Greek_finalsmallsigma) + *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); + break; + case 0x13: /* Latin 9 */ + if (sym == XKB_KEY_OE) + *lower = XKB_KEY_oe; + else if (sym == XKB_KEY_oe) + *upper = XKB_KEY_OE; + else if (sym == XKB_KEY_Ydiaeresis) + *lower = XKB_KEY_ydiaeresis; + break; + } +} diff --git a/src/3rdparty/xkbcommon/src/keysym.h b/src/3rdparty/xkbcommon/src/keysym.h new file mode 100644 index 0000000000..6f2280bfd4 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/keysym.h @@ -0,0 +1,62 @@ +/* + * Copyright 1985, 1987, 1990, 1998 The Open Group + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the names of the authors or their + * institutions shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the authors. + */ + +/* + * Copyright © 2009 Dan Nicholson + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef KEYSYM_H +#define KEYSYM_H + +bool +xkb_keysym_is_lower(xkb_keysym_t keysym); + +bool +xkb_keysym_is_upper(xkb_keysym_t keysym); + +bool +xkb_keysym_is_keypad(xkb_keysym_t keysym); + +#endif diff --git a/src/3rdparty/xkbcommon/src/ks_tables.h b/src/3rdparty/xkbcommon/src/ks_tables.h new file mode 100644 index 0000000000..a7e2b4705f --- /dev/null +++ b/src/3rdparty/xkbcommon/src/ks_tables.h @@ -0,0 +1,4681 @@ +/* This file is autogenerated from Makefile.am; please do not commit directly. */ + +struct name_keysym { + const char *name; + xkb_keysym_t keysym; +}; + +static const struct name_keysym name_to_keysym[] = { + { "0", XKB_KEY_0 }, + { "1", XKB_KEY_1 }, + { "2", XKB_KEY_2 }, + { "3", XKB_KEY_3 }, + { "3270_AltCursor", XKB_KEY_3270_AltCursor }, + { "3270_Attn", XKB_KEY_3270_Attn }, + { "3270_BackTab", XKB_KEY_3270_BackTab }, + { "3270_ChangeScreen", XKB_KEY_3270_ChangeScreen }, + { "3270_Copy", XKB_KEY_3270_Copy }, + { "3270_CursorBlink", XKB_KEY_3270_CursorBlink }, + { "3270_CursorSelect", XKB_KEY_3270_CursorSelect }, + { "3270_DeleteWord", XKB_KEY_3270_DeleteWord }, + { "3270_Duplicate", XKB_KEY_3270_Duplicate }, + { "3270_Enter", XKB_KEY_3270_Enter }, + { "3270_EraseEOF", XKB_KEY_3270_EraseEOF }, + { "3270_EraseInput", XKB_KEY_3270_EraseInput }, + { "3270_ExSelect", XKB_KEY_3270_ExSelect }, + { "3270_FieldMark", XKB_KEY_3270_FieldMark }, + { "3270_Ident", XKB_KEY_3270_Ident }, + { "3270_Jump", XKB_KEY_3270_Jump }, + { "3270_KeyClick", XKB_KEY_3270_KeyClick }, + { "3270_Left2", XKB_KEY_3270_Left2 }, + { "3270_PA1", XKB_KEY_3270_PA1 }, + { "3270_PA2", XKB_KEY_3270_PA2 }, + { "3270_PA3", XKB_KEY_3270_PA3 }, + { "3270_Play", XKB_KEY_3270_Play }, + { "3270_PrintScreen", XKB_KEY_3270_PrintScreen }, + { "3270_Quit", XKB_KEY_3270_Quit }, + { "3270_Record", XKB_KEY_3270_Record }, + { "3270_Reset", XKB_KEY_3270_Reset }, + { "3270_Right2", XKB_KEY_3270_Right2 }, + { "3270_Rule", XKB_KEY_3270_Rule }, + { "3270_Setup", XKB_KEY_3270_Setup }, + { "3270_Test", XKB_KEY_3270_Test }, + { "4", XKB_KEY_4 }, + { "5", XKB_KEY_5 }, + { "6", XKB_KEY_6 }, + { "7", XKB_KEY_7 }, + { "8", XKB_KEY_8 }, + { "9", XKB_KEY_9 }, + { "A", XKB_KEY_A }, + { "a", XKB_KEY_a }, + { "Aacute", XKB_KEY_Aacute }, + { "aacute", XKB_KEY_aacute }, + { "Abelowdot", XKB_KEY_Abelowdot }, + { "abelowdot", XKB_KEY_abelowdot }, + { "abovedot", XKB_KEY_abovedot }, + { "Abreve", XKB_KEY_Abreve }, + { "abreve", XKB_KEY_abreve }, + { "Abreveacute", XKB_KEY_Abreveacute }, + { "abreveacute", XKB_KEY_abreveacute }, + { "Abrevebelowdot", XKB_KEY_Abrevebelowdot }, + { "abrevebelowdot", XKB_KEY_abrevebelowdot }, + { "Abrevegrave", XKB_KEY_Abrevegrave }, + { "abrevegrave", XKB_KEY_abrevegrave }, + { "Abrevehook", XKB_KEY_Abrevehook }, + { "abrevehook", XKB_KEY_abrevehook }, + { "Abrevetilde", XKB_KEY_Abrevetilde }, + { "abrevetilde", XKB_KEY_abrevetilde }, + { "AccessX_Enable", XKB_KEY_AccessX_Enable }, + { "AccessX_Feedback_Enable", XKB_KEY_AccessX_Feedback_Enable }, + { "Acircumflex", XKB_KEY_Acircumflex }, + { "acircumflex", XKB_KEY_acircumflex }, + { "Acircumflexacute", XKB_KEY_Acircumflexacute }, + { "acircumflexacute", XKB_KEY_acircumflexacute }, + { "Acircumflexbelowdot", XKB_KEY_Acircumflexbelowdot }, + { "acircumflexbelowdot", XKB_KEY_acircumflexbelowdot }, + { "Acircumflexgrave", XKB_KEY_Acircumflexgrave }, + { "acircumflexgrave", XKB_KEY_acircumflexgrave }, + { "Acircumflexhook", XKB_KEY_Acircumflexhook }, + { "acircumflexhook", XKB_KEY_acircumflexhook }, + { "Acircumflextilde", XKB_KEY_Acircumflextilde }, + { "acircumflextilde", XKB_KEY_acircumflextilde }, + { "acute", XKB_KEY_acute }, + { "Adiaeresis", XKB_KEY_Adiaeresis }, + { "adiaeresis", XKB_KEY_adiaeresis }, + { "AE", XKB_KEY_AE }, + { "ae", XKB_KEY_ae }, + { "Agrave", XKB_KEY_Agrave }, + { "agrave", XKB_KEY_agrave }, + { "Ahook", XKB_KEY_Ahook }, + { "ahook", XKB_KEY_ahook }, + { "Alt_L", XKB_KEY_Alt_L }, + { "Alt_R", XKB_KEY_Alt_R }, + { "Amacron", XKB_KEY_Amacron }, + { "amacron", XKB_KEY_amacron }, + { "ampersand", XKB_KEY_ampersand }, + { "Aogonek", XKB_KEY_Aogonek }, + { "aogonek", XKB_KEY_aogonek }, + { "apostrophe", XKB_KEY_apostrophe }, + { "approxeq", XKB_KEY_approxeq }, + { "approximate", XKB_KEY_approximate }, + { "Arabic_0", XKB_KEY_Arabic_0 }, + { "Arabic_1", XKB_KEY_Arabic_1 }, + { "Arabic_2", XKB_KEY_Arabic_2 }, + { "Arabic_3", XKB_KEY_Arabic_3 }, + { "Arabic_4", XKB_KEY_Arabic_4 }, + { "Arabic_5", XKB_KEY_Arabic_5 }, + { "Arabic_6", XKB_KEY_Arabic_6 }, + { "Arabic_7", XKB_KEY_Arabic_7 }, + { "Arabic_8", XKB_KEY_Arabic_8 }, + { "Arabic_9", XKB_KEY_Arabic_9 }, + { "Arabic_ain", XKB_KEY_Arabic_ain }, + { "Arabic_alef", XKB_KEY_Arabic_alef }, + { "Arabic_alefmaksura", XKB_KEY_Arabic_alefmaksura }, + { "Arabic_beh", XKB_KEY_Arabic_beh }, + { "Arabic_comma", XKB_KEY_Arabic_comma }, + { "Arabic_dad", XKB_KEY_Arabic_dad }, + { "Arabic_dal", XKB_KEY_Arabic_dal }, + { "Arabic_damma", XKB_KEY_Arabic_damma }, + { "Arabic_dammatan", XKB_KEY_Arabic_dammatan }, + { "Arabic_ddal", XKB_KEY_Arabic_ddal }, + { "Arabic_farsi_yeh", XKB_KEY_Arabic_farsi_yeh }, + { "Arabic_fatha", XKB_KEY_Arabic_fatha }, + { "Arabic_fathatan", XKB_KEY_Arabic_fathatan }, + { "Arabic_feh", XKB_KEY_Arabic_feh }, + { "Arabic_fullstop", XKB_KEY_Arabic_fullstop }, + { "Arabic_gaf", XKB_KEY_Arabic_gaf }, + { "Arabic_ghain", XKB_KEY_Arabic_ghain }, + { "Arabic_ha", XKB_KEY_Arabic_ha }, + { "Arabic_hah", XKB_KEY_Arabic_hah }, + { "Arabic_hamza", XKB_KEY_Arabic_hamza }, + { "Arabic_hamza_above", XKB_KEY_Arabic_hamza_above }, + { "Arabic_hamza_below", XKB_KEY_Arabic_hamza_below }, + { "Arabic_hamzaonalef", XKB_KEY_Arabic_hamzaonalef }, + { "Arabic_hamzaonwaw", XKB_KEY_Arabic_hamzaonwaw }, + { "Arabic_hamzaonyeh", XKB_KEY_Arabic_hamzaonyeh }, + { "Arabic_hamzaunderalef", XKB_KEY_Arabic_hamzaunderalef }, + { "Arabic_heh", XKB_KEY_Arabic_heh }, + { "Arabic_heh_doachashmee", XKB_KEY_Arabic_heh_doachashmee }, + { "Arabic_heh_goal", XKB_KEY_Arabic_heh_goal }, + { "Arabic_jeem", XKB_KEY_Arabic_jeem }, + { "Arabic_jeh", XKB_KEY_Arabic_jeh }, + { "Arabic_kaf", XKB_KEY_Arabic_kaf }, + { "Arabic_kasra", XKB_KEY_Arabic_kasra }, + { "Arabic_kasratan", XKB_KEY_Arabic_kasratan }, + { "Arabic_keheh", XKB_KEY_Arabic_keheh }, + { "Arabic_khah", XKB_KEY_Arabic_khah }, + { "Arabic_lam", XKB_KEY_Arabic_lam }, + { "Arabic_madda_above", XKB_KEY_Arabic_madda_above }, + { "Arabic_maddaonalef", XKB_KEY_Arabic_maddaonalef }, + { "Arabic_meem", XKB_KEY_Arabic_meem }, + { "Arabic_noon", XKB_KEY_Arabic_noon }, + { "Arabic_noon_ghunna", XKB_KEY_Arabic_noon_ghunna }, + { "Arabic_peh", XKB_KEY_Arabic_peh }, + { "Arabic_percent", XKB_KEY_Arabic_percent }, + { "Arabic_qaf", XKB_KEY_Arabic_qaf }, + { "Arabic_question_mark", XKB_KEY_Arabic_question_mark }, + { "Arabic_ra", XKB_KEY_Arabic_ra }, + { "Arabic_rreh", XKB_KEY_Arabic_rreh }, + { "Arabic_sad", XKB_KEY_Arabic_sad }, + { "Arabic_seen", XKB_KEY_Arabic_seen }, + { "Arabic_semicolon", XKB_KEY_Arabic_semicolon }, + { "Arabic_shadda", XKB_KEY_Arabic_shadda }, + { "Arabic_sheen", XKB_KEY_Arabic_sheen }, + { "Arabic_sukun", XKB_KEY_Arabic_sukun }, + { "Arabic_superscript_alef", XKB_KEY_Arabic_superscript_alef }, + { "Arabic_switch", XKB_KEY_Arabic_switch }, + { "Arabic_tah", XKB_KEY_Arabic_tah }, + { "Arabic_tatweel", XKB_KEY_Arabic_tatweel }, + { "Arabic_tcheh", XKB_KEY_Arabic_tcheh }, + { "Arabic_teh", XKB_KEY_Arabic_teh }, + { "Arabic_tehmarbuta", XKB_KEY_Arabic_tehmarbuta }, + { "Arabic_thal", XKB_KEY_Arabic_thal }, + { "Arabic_theh", XKB_KEY_Arabic_theh }, + { "Arabic_tteh", XKB_KEY_Arabic_tteh }, + { "Arabic_veh", XKB_KEY_Arabic_veh }, + { "Arabic_waw", XKB_KEY_Arabic_waw }, + { "Arabic_yeh", XKB_KEY_Arabic_yeh }, + { "Arabic_yeh_baree", XKB_KEY_Arabic_yeh_baree }, + { "Arabic_zah", XKB_KEY_Arabic_zah }, + { "Arabic_zain", XKB_KEY_Arabic_zain }, + { "Aring", XKB_KEY_Aring }, + { "aring", XKB_KEY_aring }, + { "Armenian_accent", XKB_KEY_Armenian_accent }, + { "Armenian_amanak", XKB_KEY_Armenian_amanak }, + { "Armenian_apostrophe", XKB_KEY_Armenian_apostrophe }, + { "Armenian_AT", XKB_KEY_Armenian_AT }, + { "Armenian_at", XKB_KEY_Armenian_at }, + { "Armenian_AYB", XKB_KEY_Armenian_AYB }, + { "Armenian_ayb", XKB_KEY_Armenian_ayb }, + { "Armenian_BEN", XKB_KEY_Armenian_BEN }, + { "Armenian_ben", XKB_KEY_Armenian_ben }, + { "Armenian_but", XKB_KEY_Armenian_but }, + { "Armenian_CHA", XKB_KEY_Armenian_CHA }, + { "Armenian_cha", XKB_KEY_Armenian_cha }, + { "Armenian_DA", XKB_KEY_Armenian_DA }, + { "Armenian_da", XKB_KEY_Armenian_da }, + { "Armenian_DZA", XKB_KEY_Armenian_DZA }, + { "Armenian_dza", XKB_KEY_Armenian_dza }, + { "Armenian_E", XKB_KEY_Armenian_E }, + { "Armenian_e", XKB_KEY_Armenian_e }, + { "Armenian_exclam", XKB_KEY_Armenian_exclam }, + { "Armenian_FE", XKB_KEY_Armenian_FE }, + { "Armenian_fe", XKB_KEY_Armenian_fe }, + { "Armenian_full_stop", XKB_KEY_Armenian_full_stop }, + { "Armenian_GHAT", XKB_KEY_Armenian_GHAT }, + { "Armenian_ghat", XKB_KEY_Armenian_ghat }, + { "Armenian_GIM", XKB_KEY_Armenian_GIM }, + { "Armenian_gim", XKB_KEY_Armenian_gim }, + { "Armenian_HI", XKB_KEY_Armenian_HI }, + { "Armenian_hi", XKB_KEY_Armenian_hi }, + { "Armenian_HO", XKB_KEY_Armenian_HO }, + { "Armenian_ho", XKB_KEY_Armenian_ho }, + { "Armenian_hyphen", XKB_KEY_Armenian_hyphen }, + { "Armenian_INI", XKB_KEY_Armenian_INI }, + { "Armenian_ini", XKB_KEY_Armenian_ini }, + { "Armenian_JE", XKB_KEY_Armenian_JE }, + { "Armenian_je", XKB_KEY_Armenian_je }, + { "Armenian_KE", XKB_KEY_Armenian_KE }, + { "Armenian_ke", XKB_KEY_Armenian_ke }, + { "Armenian_KEN", XKB_KEY_Armenian_KEN }, + { "Armenian_ken", XKB_KEY_Armenian_ken }, + { "Armenian_KHE", XKB_KEY_Armenian_KHE }, + { "Armenian_khe", XKB_KEY_Armenian_khe }, + { "Armenian_ligature_ew", XKB_KEY_Armenian_ligature_ew }, + { "Armenian_LYUN", XKB_KEY_Armenian_LYUN }, + { "Armenian_lyun", XKB_KEY_Armenian_lyun }, + { "Armenian_MEN", XKB_KEY_Armenian_MEN }, + { "Armenian_men", XKB_KEY_Armenian_men }, + { "Armenian_NU", XKB_KEY_Armenian_NU }, + { "Armenian_nu", XKB_KEY_Armenian_nu }, + { "Armenian_O", XKB_KEY_Armenian_O }, + { "Armenian_o", XKB_KEY_Armenian_o }, + { "Armenian_paruyk", XKB_KEY_Armenian_paruyk }, + { "Armenian_PE", XKB_KEY_Armenian_PE }, + { "Armenian_pe", XKB_KEY_Armenian_pe }, + { "Armenian_PYUR", XKB_KEY_Armenian_PYUR }, + { "Armenian_pyur", XKB_KEY_Armenian_pyur }, + { "Armenian_question", XKB_KEY_Armenian_question }, + { "Armenian_RA", XKB_KEY_Armenian_RA }, + { "Armenian_ra", XKB_KEY_Armenian_ra }, + { "Armenian_RE", XKB_KEY_Armenian_RE }, + { "Armenian_re", XKB_KEY_Armenian_re }, + { "Armenian_SE", XKB_KEY_Armenian_SE }, + { "Armenian_se", XKB_KEY_Armenian_se }, + { "Armenian_separation_mark", XKB_KEY_Armenian_separation_mark }, + { "Armenian_SHA", XKB_KEY_Armenian_SHA }, + { "Armenian_sha", XKB_KEY_Armenian_sha }, + { "Armenian_shesht", XKB_KEY_Armenian_shesht }, + { "Armenian_TCHE", XKB_KEY_Armenian_TCHE }, + { "Armenian_tche", XKB_KEY_Armenian_tche }, + { "Armenian_TO", XKB_KEY_Armenian_TO }, + { "Armenian_to", XKB_KEY_Armenian_to }, + { "Armenian_TSA", XKB_KEY_Armenian_TSA }, + { "Armenian_tsa", XKB_KEY_Armenian_tsa }, + { "Armenian_TSO", XKB_KEY_Armenian_TSO }, + { "Armenian_tso", XKB_KEY_Armenian_tso }, + { "Armenian_TYUN", XKB_KEY_Armenian_TYUN }, + { "Armenian_tyun", XKB_KEY_Armenian_tyun }, + { "Armenian_verjaket", XKB_KEY_Armenian_verjaket }, + { "Armenian_VEV", XKB_KEY_Armenian_VEV }, + { "Armenian_vev", XKB_KEY_Armenian_vev }, + { "Armenian_VO", XKB_KEY_Armenian_VO }, + { "Armenian_vo", XKB_KEY_Armenian_vo }, + { "Armenian_VYUN", XKB_KEY_Armenian_VYUN }, + { "Armenian_vyun", XKB_KEY_Armenian_vyun }, + { "Armenian_YECH", XKB_KEY_Armenian_YECH }, + { "Armenian_yech", XKB_KEY_Armenian_yech }, + { "Armenian_yentamna", XKB_KEY_Armenian_yentamna }, + { "Armenian_ZA", XKB_KEY_Armenian_ZA }, + { "Armenian_za", XKB_KEY_Armenian_za }, + { "Armenian_ZHE", XKB_KEY_Armenian_ZHE }, + { "Armenian_zhe", XKB_KEY_Armenian_zhe }, + { "asciicircum", XKB_KEY_asciicircum }, + { "asciitilde", XKB_KEY_asciitilde }, + { "asterisk", XKB_KEY_asterisk }, + { "at", XKB_KEY_at }, + { "Atilde", XKB_KEY_Atilde }, + { "atilde", XKB_KEY_atilde }, + { "AudibleBell_Enable", XKB_KEY_AudibleBell_Enable }, + { "B", XKB_KEY_B }, + { "b", XKB_KEY_b }, + { "Babovedot", XKB_KEY_Babovedot }, + { "babovedot", XKB_KEY_babovedot }, + { "backslash", XKB_KEY_backslash }, + { "BackSpace", XKB_KEY_BackSpace }, + { "BackTab", XKB_KEY_BackTab }, + { "ballotcross", XKB_KEY_ballotcross }, + { "bar", XKB_KEY_bar }, + { "because", XKB_KEY_because }, + { "Begin", XKB_KEY_Begin }, + { "blank", XKB_KEY_blank }, + { "block", XKB_KEY_block }, + { "botintegral", XKB_KEY_botintegral }, + { "botleftparens", XKB_KEY_botleftparens }, + { "botleftsqbracket", XKB_KEY_botleftsqbracket }, + { "botleftsummation", XKB_KEY_botleftsummation }, + { "botrightparens", XKB_KEY_botrightparens }, + { "botrightsqbracket", XKB_KEY_botrightsqbracket }, + { "botrightsummation", XKB_KEY_botrightsummation }, + { "bott", XKB_KEY_bott }, + { "botvertsummationconnector", XKB_KEY_botvertsummationconnector }, + { "BounceKeys_Enable", XKB_KEY_BounceKeys_Enable }, + { "braceleft", XKB_KEY_braceleft }, + { "braceright", XKB_KEY_braceright }, + { "bracketleft", XKB_KEY_bracketleft }, + { "bracketright", XKB_KEY_bracketright }, + { "braille_blank", XKB_KEY_braille_blank }, + { "braille_dot_1", XKB_KEY_braille_dot_1 }, + { "braille_dot_10", XKB_KEY_braille_dot_10 }, + { "braille_dot_2", XKB_KEY_braille_dot_2 }, + { "braille_dot_3", XKB_KEY_braille_dot_3 }, + { "braille_dot_4", XKB_KEY_braille_dot_4 }, + { "braille_dot_5", XKB_KEY_braille_dot_5 }, + { "braille_dot_6", XKB_KEY_braille_dot_6 }, + { "braille_dot_7", XKB_KEY_braille_dot_7 }, + { "braille_dot_8", XKB_KEY_braille_dot_8 }, + { "braille_dot_9", XKB_KEY_braille_dot_9 }, + { "braille_dots_1", XKB_KEY_braille_dots_1 }, + { "braille_dots_12", XKB_KEY_braille_dots_12 }, + { "braille_dots_123", XKB_KEY_braille_dots_123 }, + { "braille_dots_1234", XKB_KEY_braille_dots_1234 }, + { "braille_dots_12345", XKB_KEY_braille_dots_12345 }, + { "braille_dots_123456", XKB_KEY_braille_dots_123456 }, + { "braille_dots_1234567", XKB_KEY_braille_dots_1234567 }, + { "braille_dots_12345678", XKB_KEY_braille_dots_12345678 }, + { "braille_dots_1234568", XKB_KEY_braille_dots_1234568 }, + { "braille_dots_123457", XKB_KEY_braille_dots_123457 }, + { "braille_dots_1234578", XKB_KEY_braille_dots_1234578 }, + { "braille_dots_123458", XKB_KEY_braille_dots_123458 }, + { "braille_dots_12346", XKB_KEY_braille_dots_12346 }, + { "braille_dots_123467", XKB_KEY_braille_dots_123467 }, + { "braille_dots_1234678", XKB_KEY_braille_dots_1234678 }, + { "braille_dots_123468", XKB_KEY_braille_dots_123468 }, + { "braille_dots_12347", XKB_KEY_braille_dots_12347 }, + { "braille_dots_123478", XKB_KEY_braille_dots_123478 }, + { "braille_dots_12348", XKB_KEY_braille_dots_12348 }, + { "braille_dots_1235", XKB_KEY_braille_dots_1235 }, + { "braille_dots_12356", XKB_KEY_braille_dots_12356 }, + { "braille_dots_123567", XKB_KEY_braille_dots_123567 }, + { "braille_dots_1235678", XKB_KEY_braille_dots_1235678 }, + { "braille_dots_123568", XKB_KEY_braille_dots_123568 }, + { "braille_dots_12357", XKB_KEY_braille_dots_12357 }, + { "braille_dots_123578", XKB_KEY_braille_dots_123578 }, + { "braille_dots_12358", XKB_KEY_braille_dots_12358 }, + { "braille_dots_1236", XKB_KEY_braille_dots_1236 }, + { "braille_dots_12367", XKB_KEY_braille_dots_12367 }, + { "braille_dots_123678", XKB_KEY_braille_dots_123678 }, + { "braille_dots_12368", XKB_KEY_braille_dots_12368 }, + { "braille_dots_1237", XKB_KEY_braille_dots_1237 }, + { "braille_dots_12378", XKB_KEY_braille_dots_12378 }, + { "braille_dots_1238", XKB_KEY_braille_dots_1238 }, + { "braille_dots_124", XKB_KEY_braille_dots_124 }, + { "braille_dots_1245", XKB_KEY_braille_dots_1245 }, + { "braille_dots_12456", XKB_KEY_braille_dots_12456 }, + { "braille_dots_124567", XKB_KEY_braille_dots_124567 }, + { "braille_dots_1245678", XKB_KEY_braille_dots_1245678 }, + { "braille_dots_124568", XKB_KEY_braille_dots_124568 }, + { "braille_dots_12457", XKB_KEY_braille_dots_12457 }, + { "braille_dots_124578", XKB_KEY_braille_dots_124578 }, + { "braille_dots_12458", XKB_KEY_braille_dots_12458 }, + { "braille_dots_1246", XKB_KEY_braille_dots_1246 }, + { "braille_dots_12467", XKB_KEY_braille_dots_12467 }, + { "braille_dots_124678", XKB_KEY_braille_dots_124678 }, + { "braille_dots_12468", XKB_KEY_braille_dots_12468 }, + { "braille_dots_1247", XKB_KEY_braille_dots_1247 }, + { "braille_dots_12478", XKB_KEY_braille_dots_12478 }, + { "braille_dots_1248", XKB_KEY_braille_dots_1248 }, + { "braille_dots_125", XKB_KEY_braille_dots_125 }, + { "braille_dots_1256", XKB_KEY_braille_dots_1256 }, + { "braille_dots_12567", XKB_KEY_braille_dots_12567 }, + { "braille_dots_125678", XKB_KEY_braille_dots_125678 }, + { "braille_dots_12568", XKB_KEY_braille_dots_12568 }, + { "braille_dots_1257", XKB_KEY_braille_dots_1257 }, + { "braille_dots_12578", XKB_KEY_braille_dots_12578 }, + { "braille_dots_1258", XKB_KEY_braille_dots_1258 }, + { "braille_dots_126", XKB_KEY_braille_dots_126 }, + { "braille_dots_1267", XKB_KEY_braille_dots_1267 }, + { "braille_dots_12678", XKB_KEY_braille_dots_12678 }, + { "braille_dots_1268", XKB_KEY_braille_dots_1268 }, + { "braille_dots_127", XKB_KEY_braille_dots_127 }, + { "braille_dots_1278", XKB_KEY_braille_dots_1278 }, + { "braille_dots_128", XKB_KEY_braille_dots_128 }, + { "braille_dots_13", XKB_KEY_braille_dots_13 }, + { "braille_dots_134", XKB_KEY_braille_dots_134 }, + { "braille_dots_1345", XKB_KEY_braille_dots_1345 }, + { "braille_dots_13456", XKB_KEY_braille_dots_13456 }, + { "braille_dots_134567", XKB_KEY_braille_dots_134567 }, + { "braille_dots_1345678", XKB_KEY_braille_dots_1345678 }, + { "braille_dots_134568", XKB_KEY_braille_dots_134568 }, + { "braille_dots_13457", XKB_KEY_braille_dots_13457 }, + { "braille_dots_134578", XKB_KEY_braille_dots_134578 }, + { "braille_dots_13458", XKB_KEY_braille_dots_13458 }, + { "braille_dots_1346", XKB_KEY_braille_dots_1346 }, + { "braille_dots_13467", XKB_KEY_braille_dots_13467 }, + { "braille_dots_134678", XKB_KEY_braille_dots_134678 }, + { "braille_dots_13468", XKB_KEY_braille_dots_13468 }, + { "braille_dots_1347", XKB_KEY_braille_dots_1347 }, + { "braille_dots_13478", XKB_KEY_braille_dots_13478 }, + { "braille_dots_1348", XKB_KEY_braille_dots_1348 }, + { "braille_dots_135", XKB_KEY_braille_dots_135 }, + { "braille_dots_1356", XKB_KEY_braille_dots_1356 }, + { "braille_dots_13567", XKB_KEY_braille_dots_13567 }, + { "braille_dots_135678", XKB_KEY_braille_dots_135678 }, + { "braille_dots_13568", XKB_KEY_braille_dots_13568 }, + { "braille_dots_1357", XKB_KEY_braille_dots_1357 }, + { "braille_dots_13578", XKB_KEY_braille_dots_13578 }, + { "braille_dots_1358", XKB_KEY_braille_dots_1358 }, + { "braille_dots_136", XKB_KEY_braille_dots_136 }, + { "braille_dots_1367", XKB_KEY_braille_dots_1367 }, + { "braille_dots_13678", XKB_KEY_braille_dots_13678 }, + { "braille_dots_1368", XKB_KEY_braille_dots_1368 }, + { "braille_dots_137", XKB_KEY_braille_dots_137 }, + { "braille_dots_1378", XKB_KEY_braille_dots_1378 }, + { "braille_dots_138", XKB_KEY_braille_dots_138 }, + { "braille_dots_14", XKB_KEY_braille_dots_14 }, + { "braille_dots_145", XKB_KEY_braille_dots_145 }, + { "braille_dots_1456", XKB_KEY_braille_dots_1456 }, + { "braille_dots_14567", XKB_KEY_braille_dots_14567 }, + { "braille_dots_145678", XKB_KEY_braille_dots_145678 }, + { "braille_dots_14568", XKB_KEY_braille_dots_14568 }, + { "braille_dots_1457", XKB_KEY_braille_dots_1457 }, + { "braille_dots_14578", XKB_KEY_braille_dots_14578 }, + { "braille_dots_1458", XKB_KEY_braille_dots_1458 }, + { "braille_dots_146", XKB_KEY_braille_dots_146 }, + { "braille_dots_1467", XKB_KEY_braille_dots_1467 }, + { "braille_dots_14678", XKB_KEY_braille_dots_14678 }, + { "braille_dots_1468", XKB_KEY_braille_dots_1468 }, + { "braille_dots_147", XKB_KEY_braille_dots_147 }, + { "braille_dots_1478", XKB_KEY_braille_dots_1478 }, + { "braille_dots_148", XKB_KEY_braille_dots_148 }, + { "braille_dots_15", XKB_KEY_braille_dots_15 }, + { "braille_dots_156", XKB_KEY_braille_dots_156 }, + { "braille_dots_1567", XKB_KEY_braille_dots_1567 }, + { "braille_dots_15678", XKB_KEY_braille_dots_15678 }, + { "braille_dots_1568", XKB_KEY_braille_dots_1568 }, + { "braille_dots_157", XKB_KEY_braille_dots_157 }, + { "braille_dots_1578", XKB_KEY_braille_dots_1578 }, + { "braille_dots_158", XKB_KEY_braille_dots_158 }, + { "braille_dots_16", XKB_KEY_braille_dots_16 }, + { "braille_dots_167", XKB_KEY_braille_dots_167 }, + { "braille_dots_1678", XKB_KEY_braille_dots_1678 }, + { "braille_dots_168", XKB_KEY_braille_dots_168 }, + { "braille_dots_17", XKB_KEY_braille_dots_17 }, + { "braille_dots_178", XKB_KEY_braille_dots_178 }, + { "braille_dots_18", XKB_KEY_braille_dots_18 }, + { "braille_dots_2", XKB_KEY_braille_dots_2 }, + { "braille_dots_23", XKB_KEY_braille_dots_23 }, + { "braille_dots_234", XKB_KEY_braille_dots_234 }, + { "braille_dots_2345", XKB_KEY_braille_dots_2345 }, + { "braille_dots_23456", XKB_KEY_braille_dots_23456 }, + { "braille_dots_234567", XKB_KEY_braille_dots_234567 }, + { "braille_dots_2345678", XKB_KEY_braille_dots_2345678 }, + { "braille_dots_234568", XKB_KEY_braille_dots_234568 }, + { "braille_dots_23457", XKB_KEY_braille_dots_23457 }, + { "braille_dots_234578", XKB_KEY_braille_dots_234578 }, + { "braille_dots_23458", XKB_KEY_braille_dots_23458 }, + { "braille_dots_2346", XKB_KEY_braille_dots_2346 }, + { "braille_dots_23467", XKB_KEY_braille_dots_23467 }, + { "braille_dots_234678", XKB_KEY_braille_dots_234678 }, + { "braille_dots_23468", XKB_KEY_braille_dots_23468 }, + { "braille_dots_2347", XKB_KEY_braille_dots_2347 }, + { "braille_dots_23478", XKB_KEY_braille_dots_23478 }, + { "braille_dots_2348", XKB_KEY_braille_dots_2348 }, + { "braille_dots_235", XKB_KEY_braille_dots_235 }, + { "braille_dots_2356", XKB_KEY_braille_dots_2356 }, + { "braille_dots_23567", XKB_KEY_braille_dots_23567 }, + { "braille_dots_235678", XKB_KEY_braille_dots_235678 }, + { "braille_dots_23568", XKB_KEY_braille_dots_23568 }, + { "braille_dots_2357", XKB_KEY_braille_dots_2357 }, + { "braille_dots_23578", XKB_KEY_braille_dots_23578 }, + { "braille_dots_2358", XKB_KEY_braille_dots_2358 }, + { "braille_dots_236", XKB_KEY_braille_dots_236 }, + { "braille_dots_2367", XKB_KEY_braille_dots_2367 }, + { "braille_dots_23678", XKB_KEY_braille_dots_23678 }, + { "braille_dots_2368", XKB_KEY_braille_dots_2368 }, + { "braille_dots_237", XKB_KEY_braille_dots_237 }, + { "braille_dots_2378", XKB_KEY_braille_dots_2378 }, + { "braille_dots_238", XKB_KEY_braille_dots_238 }, + { "braille_dots_24", XKB_KEY_braille_dots_24 }, + { "braille_dots_245", XKB_KEY_braille_dots_245 }, + { "braille_dots_2456", XKB_KEY_braille_dots_2456 }, + { "braille_dots_24567", XKB_KEY_braille_dots_24567 }, + { "braille_dots_245678", XKB_KEY_braille_dots_245678 }, + { "braille_dots_24568", XKB_KEY_braille_dots_24568 }, + { "braille_dots_2457", XKB_KEY_braille_dots_2457 }, + { "braille_dots_24578", XKB_KEY_braille_dots_24578 }, + { "braille_dots_2458", XKB_KEY_braille_dots_2458 }, + { "braille_dots_246", XKB_KEY_braille_dots_246 }, + { "braille_dots_2467", XKB_KEY_braille_dots_2467 }, + { "braille_dots_24678", XKB_KEY_braille_dots_24678 }, + { "braille_dots_2468", XKB_KEY_braille_dots_2468 }, + { "braille_dots_247", XKB_KEY_braille_dots_247 }, + { "braille_dots_2478", XKB_KEY_braille_dots_2478 }, + { "braille_dots_248", XKB_KEY_braille_dots_248 }, + { "braille_dots_25", XKB_KEY_braille_dots_25 }, + { "braille_dots_256", XKB_KEY_braille_dots_256 }, + { "braille_dots_2567", XKB_KEY_braille_dots_2567 }, + { "braille_dots_25678", XKB_KEY_braille_dots_25678 }, + { "braille_dots_2568", XKB_KEY_braille_dots_2568 }, + { "braille_dots_257", XKB_KEY_braille_dots_257 }, + { "braille_dots_2578", XKB_KEY_braille_dots_2578 }, + { "braille_dots_258", XKB_KEY_braille_dots_258 }, + { "braille_dots_26", XKB_KEY_braille_dots_26 }, + { "braille_dots_267", XKB_KEY_braille_dots_267 }, + { "braille_dots_2678", XKB_KEY_braille_dots_2678 }, + { "braille_dots_268", XKB_KEY_braille_dots_268 }, + { "braille_dots_27", XKB_KEY_braille_dots_27 }, + { "braille_dots_278", XKB_KEY_braille_dots_278 }, + { "braille_dots_28", XKB_KEY_braille_dots_28 }, + { "braille_dots_3", XKB_KEY_braille_dots_3 }, + { "braille_dots_34", XKB_KEY_braille_dots_34 }, + { "braille_dots_345", XKB_KEY_braille_dots_345 }, + { "braille_dots_3456", XKB_KEY_braille_dots_3456 }, + { "braille_dots_34567", XKB_KEY_braille_dots_34567 }, + { "braille_dots_345678", XKB_KEY_braille_dots_345678 }, + { "braille_dots_34568", XKB_KEY_braille_dots_34568 }, + { "braille_dots_3457", XKB_KEY_braille_dots_3457 }, + { "braille_dots_34578", XKB_KEY_braille_dots_34578 }, + { "braille_dots_3458", XKB_KEY_braille_dots_3458 }, + { "braille_dots_346", XKB_KEY_braille_dots_346 }, + { "braille_dots_3467", XKB_KEY_braille_dots_3467 }, + { "braille_dots_34678", XKB_KEY_braille_dots_34678 }, + { "braille_dots_3468", XKB_KEY_braille_dots_3468 }, + { "braille_dots_347", XKB_KEY_braille_dots_347 }, + { "braille_dots_3478", XKB_KEY_braille_dots_3478 }, + { "braille_dots_348", XKB_KEY_braille_dots_348 }, + { "braille_dots_35", XKB_KEY_braille_dots_35 }, + { "braille_dots_356", XKB_KEY_braille_dots_356 }, + { "braille_dots_3567", XKB_KEY_braille_dots_3567 }, + { "braille_dots_35678", XKB_KEY_braille_dots_35678 }, + { "braille_dots_3568", XKB_KEY_braille_dots_3568 }, + { "braille_dots_357", XKB_KEY_braille_dots_357 }, + { "braille_dots_3578", XKB_KEY_braille_dots_3578 }, + { "braille_dots_358", XKB_KEY_braille_dots_358 }, + { "braille_dots_36", XKB_KEY_braille_dots_36 }, + { "braille_dots_367", XKB_KEY_braille_dots_367 }, + { "braille_dots_3678", XKB_KEY_braille_dots_3678 }, + { "braille_dots_368", XKB_KEY_braille_dots_368 }, + { "braille_dots_37", XKB_KEY_braille_dots_37 }, + { "braille_dots_378", XKB_KEY_braille_dots_378 }, + { "braille_dots_38", XKB_KEY_braille_dots_38 }, + { "braille_dots_4", XKB_KEY_braille_dots_4 }, + { "braille_dots_45", XKB_KEY_braille_dots_45 }, + { "braille_dots_456", XKB_KEY_braille_dots_456 }, + { "braille_dots_4567", XKB_KEY_braille_dots_4567 }, + { "braille_dots_45678", XKB_KEY_braille_dots_45678 }, + { "braille_dots_4568", XKB_KEY_braille_dots_4568 }, + { "braille_dots_457", XKB_KEY_braille_dots_457 }, + { "braille_dots_4578", XKB_KEY_braille_dots_4578 }, + { "braille_dots_458", XKB_KEY_braille_dots_458 }, + { "braille_dots_46", XKB_KEY_braille_dots_46 }, + { "braille_dots_467", XKB_KEY_braille_dots_467 }, + { "braille_dots_4678", XKB_KEY_braille_dots_4678 }, + { "braille_dots_468", XKB_KEY_braille_dots_468 }, + { "braille_dots_47", XKB_KEY_braille_dots_47 }, + { "braille_dots_478", XKB_KEY_braille_dots_478 }, + { "braille_dots_48", XKB_KEY_braille_dots_48 }, + { "braille_dots_5", XKB_KEY_braille_dots_5 }, + { "braille_dots_56", XKB_KEY_braille_dots_56 }, + { "braille_dots_567", XKB_KEY_braille_dots_567 }, + { "braille_dots_5678", XKB_KEY_braille_dots_5678 }, + { "braille_dots_568", XKB_KEY_braille_dots_568 }, + { "braille_dots_57", XKB_KEY_braille_dots_57 }, + { "braille_dots_578", XKB_KEY_braille_dots_578 }, + { "braille_dots_58", XKB_KEY_braille_dots_58 }, + { "braille_dots_6", XKB_KEY_braille_dots_6 }, + { "braille_dots_67", XKB_KEY_braille_dots_67 }, + { "braille_dots_678", XKB_KEY_braille_dots_678 }, + { "braille_dots_68", XKB_KEY_braille_dots_68 }, + { "braille_dots_7", XKB_KEY_braille_dots_7 }, + { "braille_dots_78", XKB_KEY_braille_dots_78 }, + { "braille_dots_8", XKB_KEY_braille_dots_8 }, + { "Break", XKB_KEY_Break }, + { "breve", XKB_KEY_breve }, + { "brokenbar", XKB_KEY_brokenbar }, + { "Byelorussian_shortu", XKB_KEY_Byelorussian_shortu }, + { "Byelorussian_SHORTU", XKB_KEY_Byelorussian_SHORTU }, + { "C", XKB_KEY_C }, + { "c", XKB_KEY_c }, + { "c_h", XKB_KEY_c_h }, + { "C_h", XKB_KEY_C_h }, + { "C_H", XKB_KEY_C_H }, + { "Cabovedot", XKB_KEY_Cabovedot }, + { "cabovedot", XKB_KEY_cabovedot }, + { "Cacute", XKB_KEY_Cacute }, + { "cacute", XKB_KEY_cacute }, + { "Cancel", XKB_KEY_Cancel }, + { "Caps_Lock", XKB_KEY_Caps_Lock }, + { "careof", XKB_KEY_careof }, + { "caret", XKB_KEY_caret }, + { "caron", XKB_KEY_caron }, + { "Ccaron", XKB_KEY_Ccaron }, + { "ccaron", XKB_KEY_ccaron }, + { "Ccedilla", XKB_KEY_Ccedilla }, + { "ccedilla", XKB_KEY_ccedilla }, + { "Ccircumflex", XKB_KEY_Ccircumflex }, + { "ccircumflex", XKB_KEY_ccircumflex }, + { "cedilla", XKB_KEY_cedilla }, + { "cent", XKB_KEY_cent }, + { "ch", XKB_KEY_ch }, + { "Ch", XKB_KEY_Ch }, + { "CH", XKB_KEY_CH }, + { "checkerboard", XKB_KEY_checkerboard }, + { "checkmark", XKB_KEY_checkmark }, + { "circle", XKB_KEY_circle }, + { "Clear", XKB_KEY_Clear }, + { "ClearLine", XKB_KEY_ClearLine }, + { "club", XKB_KEY_club }, + { "Codeinput", XKB_KEY_Codeinput }, + { "colon", XKB_KEY_colon }, + { "ColonSign", XKB_KEY_ColonSign }, + { "comma", XKB_KEY_comma }, + { "containsas", XKB_KEY_containsas }, + { "Control_L", XKB_KEY_Control_L }, + { "Control_R", XKB_KEY_Control_R }, + { "copyright", XKB_KEY_copyright }, + { "cr", XKB_KEY_cr }, + { "crossinglines", XKB_KEY_crossinglines }, + { "CruzeiroSign", XKB_KEY_CruzeiroSign }, + { "cuberoot", XKB_KEY_cuberoot }, + { "currency", XKB_KEY_currency }, + { "cursor", XKB_KEY_cursor }, + { "Cyrillic_a", XKB_KEY_Cyrillic_a }, + { "Cyrillic_A", XKB_KEY_Cyrillic_A }, + { "Cyrillic_be", XKB_KEY_Cyrillic_be }, + { "Cyrillic_BE", XKB_KEY_Cyrillic_BE }, + { "Cyrillic_che", XKB_KEY_Cyrillic_che }, + { "Cyrillic_CHE", XKB_KEY_Cyrillic_CHE }, + { "Cyrillic_CHE_descender", XKB_KEY_Cyrillic_CHE_descender }, + { "Cyrillic_che_descender", XKB_KEY_Cyrillic_che_descender }, + { "Cyrillic_CHE_vertstroke", XKB_KEY_Cyrillic_CHE_vertstroke }, + { "Cyrillic_che_vertstroke", XKB_KEY_Cyrillic_che_vertstroke }, + { "Cyrillic_de", XKB_KEY_Cyrillic_de }, + { "Cyrillic_DE", XKB_KEY_Cyrillic_DE }, + { "Cyrillic_dzhe", XKB_KEY_Cyrillic_dzhe }, + { "Cyrillic_DZHE", XKB_KEY_Cyrillic_DZHE }, + { "Cyrillic_e", XKB_KEY_Cyrillic_e }, + { "Cyrillic_E", XKB_KEY_Cyrillic_E }, + { "Cyrillic_ef", XKB_KEY_Cyrillic_ef }, + { "Cyrillic_EF", XKB_KEY_Cyrillic_EF }, + { "Cyrillic_el", XKB_KEY_Cyrillic_el }, + { "Cyrillic_EL", XKB_KEY_Cyrillic_EL }, + { "Cyrillic_em", XKB_KEY_Cyrillic_em }, + { "Cyrillic_EM", XKB_KEY_Cyrillic_EM }, + { "Cyrillic_en", XKB_KEY_Cyrillic_en }, + { "Cyrillic_EN", XKB_KEY_Cyrillic_EN }, + { "Cyrillic_EN_descender", XKB_KEY_Cyrillic_EN_descender }, + { "Cyrillic_en_descender", XKB_KEY_Cyrillic_en_descender }, + { "Cyrillic_er", XKB_KEY_Cyrillic_er }, + { "Cyrillic_ER", XKB_KEY_Cyrillic_ER }, + { "Cyrillic_es", XKB_KEY_Cyrillic_es }, + { "Cyrillic_ES", XKB_KEY_Cyrillic_ES }, + { "Cyrillic_ghe", XKB_KEY_Cyrillic_ghe }, + { "Cyrillic_GHE", XKB_KEY_Cyrillic_GHE }, + { "Cyrillic_GHE_bar", XKB_KEY_Cyrillic_GHE_bar }, + { "Cyrillic_ghe_bar", XKB_KEY_Cyrillic_ghe_bar }, + { "Cyrillic_ha", XKB_KEY_Cyrillic_ha }, + { "Cyrillic_HA", XKB_KEY_Cyrillic_HA }, + { "Cyrillic_HA_descender", XKB_KEY_Cyrillic_HA_descender }, + { "Cyrillic_ha_descender", XKB_KEY_Cyrillic_ha_descender }, + { "Cyrillic_hardsign", XKB_KEY_Cyrillic_hardsign }, + { "Cyrillic_HARDSIGN", XKB_KEY_Cyrillic_HARDSIGN }, + { "Cyrillic_i", XKB_KEY_Cyrillic_i }, + { "Cyrillic_I", XKB_KEY_Cyrillic_I }, + { "Cyrillic_I_macron", XKB_KEY_Cyrillic_I_macron }, + { "Cyrillic_i_macron", XKB_KEY_Cyrillic_i_macron }, + { "Cyrillic_ie", XKB_KEY_Cyrillic_ie }, + { "Cyrillic_IE", XKB_KEY_Cyrillic_IE }, + { "Cyrillic_io", XKB_KEY_Cyrillic_io }, + { "Cyrillic_IO", XKB_KEY_Cyrillic_IO }, + { "Cyrillic_je", XKB_KEY_Cyrillic_je }, + { "Cyrillic_JE", XKB_KEY_Cyrillic_JE }, + { "Cyrillic_ka", XKB_KEY_Cyrillic_ka }, + { "Cyrillic_KA", XKB_KEY_Cyrillic_KA }, + { "Cyrillic_KA_descender", XKB_KEY_Cyrillic_KA_descender }, + { "Cyrillic_ka_descender", XKB_KEY_Cyrillic_ka_descender }, + { "Cyrillic_KA_vertstroke", XKB_KEY_Cyrillic_KA_vertstroke }, + { "Cyrillic_ka_vertstroke", XKB_KEY_Cyrillic_ka_vertstroke }, + { "Cyrillic_lje", XKB_KEY_Cyrillic_lje }, + { "Cyrillic_LJE", XKB_KEY_Cyrillic_LJE }, + { "Cyrillic_nje", XKB_KEY_Cyrillic_nje }, + { "Cyrillic_NJE", XKB_KEY_Cyrillic_NJE }, + { "Cyrillic_o", XKB_KEY_Cyrillic_o }, + { "Cyrillic_O", XKB_KEY_Cyrillic_O }, + { "Cyrillic_O_bar", XKB_KEY_Cyrillic_O_bar }, + { "Cyrillic_o_bar", XKB_KEY_Cyrillic_o_bar }, + { "Cyrillic_pe", XKB_KEY_Cyrillic_pe }, + { "Cyrillic_PE", XKB_KEY_Cyrillic_PE }, + { "Cyrillic_SCHWA", XKB_KEY_Cyrillic_SCHWA }, + { "Cyrillic_schwa", XKB_KEY_Cyrillic_schwa }, + { "Cyrillic_sha", XKB_KEY_Cyrillic_sha }, + { "Cyrillic_SHA", XKB_KEY_Cyrillic_SHA }, + { "Cyrillic_shcha", XKB_KEY_Cyrillic_shcha }, + { "Cyrillic_SHCHA", XKB_KEY_Cyrillic_SHCHA }, + { "Cyrillic_SHHA", XKB_KEY_Cyrillic_SHHA }, + { "Cyrillic_shha", XKB_KEY_Cyrillic_shha }, + { "Cyrillic_shorti", XKB_KEY_Cyrillic_shorti }, + { "Cyrillic_SHORTI", XKB_KEY_Cyrillic_SHORTI }, + { "Cyrillic_softsign", XKB_KEY_Cyrillic_softsign }, + { "Cyrillic_SOFTSIGN", XKB_KEY_Cyrillic_SOFTSIGN }, + { "Cyrillic_te", XKB_KEY_Cyrillic_te }, + { "Cyrillic_TE", XKB_KEY_Cyrillic_TE }, + { "Cyrillic_tse", XKB_KEY_Cyrillic_tse }, + { "Cyrillic_TSE", XKB_KEY_Cyrillic_TSE }, + { "Cyrillic_u", XKB_KEY_Cyrillic_u }, + { "Cyrillic_U", XKB_KEY_Cyrillic_U }, + { "Cyrillic_U_macron", XKB_KEY_Cyrillic_U_macron }, + { "Cyrillic_u_macron", XKB_KEY_Cyrillic_u_macron }, + { "Cyrillic_U_straight", XKB_KEY_Cyrillic_U_straight }, + { "Cyrillic_u_straight", XKB_KEY_Cyrillic_u_straight }, + { "Cyrillic_U_straight_bar", XKB_KEY_Cyrillic_U_straight_bar }, + { "Cyrillic_u_straight_bar", XKB_KEY_Cyrillic_u_straight_bar }, + { "Cyrillic_ve", XKB_KEY_Cyrillic_ve }, + { "Cyrillic_VE", XKB_KEY_Cyrillic_VE }, + { "Cyrillic_ya", XKB_KEY_Cyrillic_ya }, + { "Cyrillic_YA", XKB_KEY_Cyrillic_YA }, + { "Cyrillic_yeru", XKB_KEY_Cyrillic_yeru }, + { "Cyrillic_YERU", XKB_KEY_Cyrillic_YERU }, + { "Cyrillic_yu", XKB_KEY_Cyrillic_yu }, + { "Cyrillic_YU", XKB_KEY_Cyrillic_YU }, + { "Cyrillic_ze", XKB_KEY_Cyrillic_ze }, + { "Cyrillic_ZE", XKB_KEY_Cyrillic_ZE }, + { "Cyrillic_zhe", XKB_KEY_Cyrillic_zhe }, + { "Cyrillic_ZHE", XKB_KEY_Cyrillic_ZHE }, + { "Cyrillic_ZHE_descender", XKB_KEY_Cyrillic_ZHE_descender }, + { "Cyrillic_zhe_descender", XKB_KEY_Cyrillic_zhe_descender }, + { "D", XKB_KEY_D }, + { "d", XKB_KEY_d }, + { "Dabovedot", XKB_KEY_Dabovedot }, + { "dabovedot", XKB_KEY_dabovedot }, + { "Dacute_accent", XKB_KEY_Dacute_accent }, + { "dagger", XKB_KEY_dagger }, + { "Dcaron", XKB_KEY_Dcaron }, + { "dcaron", XKB_KEY_dcaron }, + { "Dcedilla_accent", XKB_KEY_Dcedilla_accent }, + { "Dcircumflex_accent", XKB_KEY_Dcircumflex_accent }, + { "Ddiaeresis", XKB_KEY_Ddiaeresis }, + { "dead_a", XKB_KEY_dead_a }, + { "dead_A", XKB_KEY_dead_A }, + { "dead_abovecomma", XKB_KEY_dead_abovecomma }, + { "dead_abovedot", XKB_KEY_dead_abovedot }, + { "dead_abovereversedcomma", XKB_KEY_dead_abovereversedcomma }, + { "dead_abovering", XKB_KEY_dead_abovering }, + { "dead_acute", XKB_KEY_dead_acute }, + { "dead_belowbreve", XKB_KEY_dead_belowbreve }, + { "dead_belowcircumflex", XKB_KEY_dead_belowcircumflex }, + { "dead_belowcomma", XKB_KEY_dead_belowcomma }, + { "dead_belowdiaeresis", XKB_KEY_dead_belowdiaeresis }, + { "dead_belowdot", XKB_KEY_dead_belowdot }, + { "dead_belowmacron", XKB_KEY_dead_belowmacron }, + { "dead_belowring", XKB_KEY_dead_belowring }, + { "dead_belowtilde", XKB_KEY_dead_belowtilde }, + { "dead_breve", XKB_KEY_dead_breve }, + { "dead_capital_schwa", XKB_KEY_dead_capital_schwa }, + { "dead_caron", XKB_KEY_dead_caron }, + { "dead_cedilla", XKB_KEY_dead_cedilla }, + { "dead_circumflex", XKB_KEY_dead_circumflex }, + { "dead_currency", XKB_KEY_dead_currency }, + { "dead_dasia", XKB_KEY_dead_dasia }, + { "dead_diaeresis", XKB_KEY_dead_diaeresis }, + { "dead_doubleacute", XKB_KEY_dead_doubleacute }, + { "dead_doublegrave", XKB_KEY_dead_doublegrave }, + { "dead_e", XKB_KEY_dead_e }, + { "dead_E", XKB_KEY_dead_E }, + { "dead_grave", XKB_KEY_dead_grave }, + { "dead_greek", XKB_KEY_dead_greek }, + { "dead_hook", XKB_KEY_dead_hook }, + { "dead_horn", XKB_KEY_dead_horn }, + { "dead_i", XKB_KEY_dead_i }, + { "dead_I", XKB_KEY_dead_I }, + { "dead_invertedbreve", XKB_KEY_dead_invertedbreve }, + { "dead_iota", XKB_KEY_dead_iota }, + { "dead_macron", XKB_KEY_dead_macron }, + { "dead_o", XKB_KEY_dead_o }, + { "dead_O", XKB_KEY_dead_O }, + { "dead_ogonek", XKB_KEY_dead_ogonek }, + { "dead_perispomeni", XKB_KEY_dead_perispomeni }, + { "dead_psili", XKB_KEY_dead_psili }, + { "dead_semivoiced_sound", XKB_KEY_dead_semivoiced_sound }, + { "dead_small_schwa", XKB_KEY_dead_small_schwa }, + { "dead_stroke", XKB_KEY_dead_stroke }, + { "dead_tilde", XKB_KEY_dead_tilde }, + { "dead_u", XKB_KEY_dead_u }, + { "dead_U", XKB_KEY_dead_U }, + { "dead_voiced_sound", XKB_KEY_dead_voiced_sound }, + { "decimalpoint", XKB_KEY_decimalpoint }, + { "degree", XKB_KEY_degree }, + { "Delete", XKB_KEY_Delete }, + { "DeleteChar", XKB_KEY_DeleteChar }, + { "DeleteLine", XKB_KEY_DeleteLine }, + { "Dgrave_accent", XKB_KEY_Dgrave_accent }, + { "diaeresis", XKB_KEY_diaeresis }, + { "diamond", XKB_KEY_diamond }, + { "digitspace", XKB_KEY_digitspace }, + { "dintegral", XKB_KEY_dintegral }, + { "division", XKB_KEY_division }, + { "dollar", XKB_KEY_dollar }, + { "DongSign", XKB_KEY_DongSign }, + { "doubbaselinedot", XKB_KEY_doubbaselinedot }, + { "doubleacute", XKB_KEY_doubleacute }, + { "doubledagger", XKB_KEY_doubledagger }, + { "doublelowquotemark", XKB_KEY_doublelowquotemark }, + { "Down", XKB_KEY_Down }, + { "downarrow", XKB_KEY_downarrow }, + { "downcaret", XKB_KEY_downcaret }, + { "downshoe", XKB_KEY_downshoe }, + { "downstile", XKB_KEY_downstile }, + { "downtack", XKB_KEY_downtack }, + { "DRemove", XKB_KEY_DRemove }, + { "Dring_accent", XKB_KEY_Dring_accent }, + { "Dstroke", XKB_KEY_Dstroke }, + { "dstroke", XKB_KEY_dstroke }, + { "Dtilde", XKB_KEY_Dtilde }, + { "E", XKB_KEY_E }, + { "e", XKB_KEY_e }, + { "Eabovedot", XKB_KEY_Eabovedot }, + { "eabovedot", XKB_KEY_eabovedot }, + { "Eacute", XKB_KEY_Eacute }, + { "eacute", XKB_KEY_eacute }, + { "Ebelowdot", XKB_KEY_Ebelowdot }, + { "ebelowdot", XKB_KEY_ebelowdot }, + { "Ecaron", XKB_KEY_Ecaron }, + { "ecaron", XKB_KEY_ecaron }, + { "Ecircumflex", XKB_KEY_Ecircumflex }, + { "ecircumflex", XKB_KEY_ecircumflex }, + { "Ecircumflexacute", XKB_KEY_Ecircumflexacute }, + { "ecircumflexacute", XKB_KEY_ecircumflexacute }, + { "Ecircumflexbelowdot", XKB_KEY_Ecircumflexbelowdot }, + { "ecircumflexbelowdot", XKB_KEY_ecircumflexbelowdot }, + { "Ecircumflexgrave", XKB_KEY_Ecircumflexgrave }, + { "ecircumflexgrave", XKB_KEY_ecircumflexgrave }, + { "Ecircumflexhook", XKB_KEY_Ecircumflexhook }, + { "ecircumflexhook", XKB_KEY_ecircumflexhook }, + { "Ecircumflextilde", XKB_KEY_Ecircumflextilde }, + { "ecircumflextilde", XKB_KEY_ecircumflextilde }, + { "EcuSign", XKB_KEY_EcuSign }, + { "Ediaeresis", XKB_KEY_Ediaeresis }, + { "ediaeresis", XKB_KEY_ediaeresis }, + { "Egrave", XKB_KEY_Egrave }, + { "egrave", XKB_KEY_egrave }, + { "Ehook", XKB_KEY_Ehook }, + { "ehook", XKB_KEY_ehook }, + { "eightsubscript", XKB_KEY_eightsubscript }, + { "eightsuperior", XKB_KEY_eightsuperior }, + { "Eisu_Shift", XKB_KEY_Eisu_Shift }, + { "Eisu_toggle", XKB_KEY_Eisu_toggle }, + { "elementof", XKB_KEY_elementof }, + { "ellipsis", XKB_KEY_ellipsis }, + { "em3space", XKB_KEY_em3space }, + { "em4space", XKB_KEY_em4space }, + { "Emacron", XKB_KEY_Emacron }, + { "emacron", XKB_KEY_emacron }, + { "emdash", XKB_KEY_emdash }, + { "emfilledcircle", XKB_KEY_emfilledcircle }, + { "emfilledrect", XKB_KEY_emfilledrect }, + { "emopencircle", XKB_KEY_emopencircle }, + { "emopenrectangle", XKB_KEY_emopenrectangle }, + { "emptyset", XKB_KEY_emptyset }, + { "emspace", XKB_KEY_emspace }, + { "End", XKB_KEY_End }, + { "endash", XKB_KEY_endash }, + { "enfilledcircbullet", XKB_KEY_enfilledcircbullet }, + { "enfilledsqbullet", XKB_KEY_enfilledsqbullet }, + { "ENG", XKB_KEY_ENG }, + { "eng", XKB_KEY_eng }, + { "enopencircbullet", XKB_KEY_enopencircbullet }, + { "enopensquarebullet", XKB_KEY_enopensquarebullet }, + { "enspace", XKB_KEY_enspace }, + { "Eogonek", XKB_KEY_Eogonek }, + { "eogonek", XKB_KEY_eogonek }, + { "equal", XKB_KEY_equal }, + { "Escape", XKB_KEY_Escape }, + { "ETH", XKB_KEY_ETH }, + { "Eth", XKB_KEY_Eth }, + { "eth", XKB_KEY_eth }, + { "Etilde", XKB_KEY_Etilde }, + { "etilde", XKB_KEY_etilde }, + { "EuroSign", XKB_KEY_EuroSign }, + { "exclam", XKB_KEY_exclam }, + { "exclamdown", XKB_KEY_exclamdown }, + { "Execute", XKB_KEY_Execute }, + { "Ext16bit_L", XKB_KEY_Ext16bit_L }, + { "Ext16bit_R", XKB_KEY_Ext16bit_R }, + { "EZH", XKB_KEY_EZH }, + { "ezh", XKB_KEY_ezh }, + { "F", XKB_KEY_F }, + { "f", XKB_KEY_f }, + { "F1", XKB_KEY_F1 }, + { "F10", XKB_KEY_F10 }, + { "F11", XKB_KEY_F11 }, + { "F12", XKB_KEY_F12 }, + { "F13", XKB_KEY_F13 }, + { "F14", XKB_KEY_F14 }, + { "F15", XKB_KEY_F15 }, + { "F16", XKB_KEY_F16 }, + { "F17", XKB_KEY_F17 }, + { "F18", XKB_KEY_F18 }, + { "F19", XKB_KEY_F19 }, + { "F2", XKB_KEY_F2 }, + { "F20", XKB_KEY_F20 }, + { "F21", XKB_KEY_F21 }, + { "F22", XKB_KEY_F22 }, + { "F23", XKB_KEY_F23 }, + { "F24", XKB_KEY_F24 }, + { "F25", XKB_KEY_F25 }, + { "F26", XKB_KEY_F26 }, + { "F27", XKB_KEY_F27 }, + { "F28", XKB_KEY_F28 }, + { "F29", XKB_KEY_F29 }, + { "F3", XKB_KEY_F3 }, + { "F30", XKB_KEY_F30 }, + { "F31", XKB_KEY_F31 }, + { "F32", XKB_KEY_F32 }, + { "F33", XKB_KEY_F33 }, + { "F34", XKB_KEY_F34 }, + { "F35", XKB_KEY_F35 }, + { "F4", XKB_KEY_F4 }, + { "F5", XKB_KEY_F5 }, + { "F6", XKB_KEY_F6 }, + { "F7", XKB_KEY_F7 }, + { "F8", XKB_KEY_F8 }, + { "F9", XKB_KEY_F9 }, + { "Fabovedot", XKB_KEY_Fabovedot }, + { "fabovedot", XKB_KEY_fabovedot }, + { "Farsi_0", XKB_KEY_Farsi_0 }, + { "Farsi_1", XKB_KEY_Farsi_1 }, + { "Farsi_2", XKB_KEY_Farsi_2 }, + { "Farsi_3", XKB_KEY_Farsi_3 }, + { "Farsi_4", XKB_KEY_Farsi_4 }, + { "Farsi_5", XKB_KEY_Farsi_5 }, + { "Farsi_6", XKB_KEY_Farsi_6 }, + { "Farsi_7", XKB_KEY_Farsi_7 }, + { "Farsi_8", XKB_KEY_Farsi_8 }, + { "Farsi_9", XKB_KEY_Farsi_9 }, + { "Farsi_yeh", XKB_KEY_Farsi_yeh }, + { "femalesymbol", XKB_KEY_femalesymbol }, + { "ff", XKB_KEY_ff }, + { "FFrancSign", XKB_KEY_FFrancSign }, + { "figdash", XKB_KEY_figdash }, + { "filledlefttribullet", XKB_KEY_filledlefttribullet }, + { "filledrectbullet", XKB_KEY_filledrectbullet }, + { "filledrighttribullet", XKB_KEY_filledrighttribullet }, + { "filledtribulletdown", XKB_KEY_filledtribulletdown }, + { "filledtribulletup", XKB_KEY_filledtribulletup }, + { "Find", XKB_KEY_Find }, + { "First_Virtual_Screen", XKB_KEY_First_Virtual_Screen }, + { "fiveeighths", XKB_KEY_fiveeighths }, + { "fivesixths", XKB_KEY_fivesixths }, + { "fivesubscript", XKB_KEY_fivesubscript }, + { "fivesuperior", XKB_KEY_fivesuperior }, + { "fourfifths", XKB_KEY_fourfifths }, + { "foursubscript", XKB_KEY_foursubscript }, + { "foursuperior", XKB_KEY_foursuperior }, + { "fourthroot", XKB_KEY_fourthroot }, + { "function", XKB_KEY_function }, + { "G", XKB_KEY_G }, + { "g", XKB_KEY_g }, + { "Gabovedot", XKB_KEY_Gabovedot }, + { "gabovedot", XKB_KEY_gabovedot }, + { "Gbreve", XKB_KEY_Gbreve }, + { "gbreve", XKB_KEY_gbreve }, + { "Gcaron", XKB_KEY_Gcaron }, + { "gcaron", XKB_KEY_gcaron }, + { "Gcedilla", XKB_KEY_Gcedilla }, + { "gcedilla", XKB_KEY_gcedilla }, + { "Gcircumflex", XKB_KEY_Gcircumflex }, + { "gcircumflex", XKB_KEY_gcircumflex }, + { "Georgian_an", XKB_KEY_Georgian_an }, + { "Georgian_ban", XKB_KEY_Georgian_ban }, + { "Georgian_can", XKB_KEY_Georgian_can }, + { "Georgian_char", XKB_KEY_Georgian_char }, + { "Georgian_chin", XKB_KEY_Georgian_chin }, + { "Georgian_cil", XKB_KEY_Georgian_cil }, + { "Georgian_don", XKB_KEY_Georgian_don }, + { "Georgian_en", XKB_KEY_Georgian_en }, + { "Georgian_fi", XKB_KEY_Georgian_fi }, + { "Georgian_gan", XKB_KEY_Georgian_gan }, + { "Georgian_ghan", XKB_KEY_Georgian_ghan }, + { "Georgian_hae", XKB_KEY_Georgian_hae }, + { "Georgian_har", XKB_KEY_Georgian_har }, + { "Georgian_he", XKB_KEY_Georgian_he }, + { "Georgian_hie", XKB_KEY_Georgian_hie }, + { "Georgian_hoe", XKB_KEY_Georgian_hoe }, + { "Georgian_in", XKB_KEY_Georgian_in }, + { "Georgian_jhan", XKB_KEY_Georgian_jhan }, + { "Georgian_jil", XKB_KEY_Georgian_jil }, + { "Georgian_kan", XKB_KEY_Georgian_kan }, + { "Georgian_khar", XKB_KEY_Georgian_khar }, + { "Georgian_las", XKB_KEY_Georgian_las }, + { "Georgian_man", XKB_KEY_Georgian_man }, + { "Georgian_nar", XKB_KEY_Georgian_nar }, + { "Georgian_on", XKB_KEY_Georgian_on }, + { "Georgian_par", XKB_KEY_Georgian_par }, + { "Georgian_phar", XKB_KEY_Georgian_phar }, + { "Georgian_qar", XKB_KEY_Georgian_qar }, + { "Georgian_rae", XKB_KEY_Georgian_rae }, + { "Georgian_san", XKB_KEY_Georgian_san }, + { "Georgian_shin", XKB_KEY_Georgian_shin }, + { "Georgian_tan", XKB_KEY_Georgian_tan }, + { "Georgian_tar", XKB_KEY_Georgian_tar }, + { "Georgian_un", XKB_KEY_Georgian_un }, + { "Georgian_vin", XKB_KEY_Georgian_vin }, + { "Georgian_we", XKB_KEY_Georgian_we }, + { "Georgian_xan", XKB_KEY_Georgian_xan }, + { "Georgian_zen", XKB_KEY_Georgian_zen }, + { "Georgian_zhar", XKB_KEY_Georgian_zhar }, + { "grave", XKB_KEY_grave }, + { "greater", XKB_KEY_greater }, + { "greaterthanequal", XKB_KEY_greaterthanequal }, + { "Greek_accentdieresis", XKB_KEY_Greek_accentdieresis }, + { "Greek_ALPHA", XKB_KEY_Greek_ALPHA }, + { "Greek_alpha", XKB_KEY_Greek_alpha }, + { "Greek_ALPHAaccent", XKB_KEY_Greek_ALPHAaccent }, + { "Greek_alphaaccent", XKB_KEY_Greek_alphaaccent }, + { "Greek_BETA", XKB_KEY_Greek_BETA }, + { "Greek_beta", XKB_KEY_Greek_beta }, + { "Greek_CHI", XKB_KEY_Greek_CHI }, + { "Greek_chi", XKB_KEY_Greek_chi }, + { "Greek_DELTA", XKB_KEY_Greek_DELTA }, + { "Greek_delta", XKB_KEY_Greek_delta }, + { "Greek_EPSILON", XKB_KEY_Greek_EPSILON }, + { "Greek_epsilon", XKB_KEY_Greek_epsilon }, + { "Greek_EPSILONaccent", XKB_KEY_Greek_EPSILONaccent }, + { "Greek_epsilonaccent", XKB_KEY_Greek_epsilonaccent }, + { "Greek_ETA", XKB_KEY_Greek_ETA }, + { "Greek_eta", XKB_KEY_Greek_eta }, + { "Greek_ETAaccent", XKB_KEY_Greek_ETAaccent }, + { "Greek_etaaccent", XKB_KEY_Greek_etaaccent }, + { "Greek_finalsmallsigma", XKB_KEY_Greek_finalsmallsigma }, + { "Greek_GAMMA", XKB_KEY_Greek_GAMMA }, + { "Greek_gamma", XKB_KEY_Greek_gamma }, + { "Greek_horizbar", XKB_KEY_Greek_horizbar }, + { "Greek_IOTA", XKB_KEY_Greek_IOTA }, + { "Greek_iota", XKB_KEY_Greek_iota }, + { "Greek_IOTAaccent", XKB_KEY_Greek_IOTAaccent }, + { "Greek_iotaaccent", XKB_KEY_Greek_iotaaccent }, + { "Greek_iotaaccentdieresis", XKB_KEY_Greek_iotaaccentdieresis }, + { "Greek_IOTAdiaeresis", XKB_KEY_Greek_IOTAdiaeresis }, + { "Greek_IOTAdieresis", XKB_KEY_Greek_IOTAdieresis }, + { "Greek_iotadieresis", XKB_KEY_Greek_iotadieresis }, + { "Greek_KAPPA", XKB_KEY_Greek_KAPPA }, + { "Greek_kappa", XKB_KEY_Greek_kappa }, + { "Greek_LAMBDA", XKB_KEY_Greek_LAMBDA }, + { "Greek_lambda", XKB_KEY_Greek_lambda }, + { "Greek_LAMDA", XKB_KEY_Greek_LAMDA }, + { "Greek_lamda", XKB_KEY_Greek_lamda }, + { "Greek_MU", XKB_KEY_Greek_MU }, + { "Greek_mu", XKB_KEY_Greek_mu }, + { "Greek_NU", XKB_KEY_Greek_NU }, + { "Greek_nu", XKB_KEY_Greek_nu }, + { "Greek_OMEGA", XKB_KEY_Greek_OMEGA }, + { "Greek_omega", XKB_KEY_Greek_omega }, + { "Greek_OMEGAaccent", XKB_KEY_Greek_OMEGAaccent }, + { "Greek_omegaaccent", XKB_KEY_Greek_omegaaccent }, + { "Greek_OMICRON", XKB_KEY_Greek_OMICRON }, + { "Greek_omicron", XKB_KEY_Greek_omicron }, + { "Greek_OMICRONaccent", XKB_KEY_Greek_OMICRONaccent }, + { "Greek_omicronaccent", XKB_KEY_Greek_omicronaccent }, + { "Greek_PHI", XKB_KEY_Greek_PHI }, + { "Greek_phi", XKB_KEY_Greek_phi }, + { "Greek_PI", XKB_KEY_Greek_PI }, + { "Greek_pi", XKB_KEY_Greek_pi }, + { "Greek_PSI", XKB_KEY_Greek_PSI }, + { "Greek_psi", XKB_KEY_Greek_psi }, + { "Greek_RHO", XKB_KEY_Greek_RHO }, + { "Greek_rho", XKB_KEY_Greek_rho }, + { "Greek_SIGMA", XKB_KEY_Greek_SIGMA }, + { "Greek_sigma", XKB_KEY_Greek_sigma }, + { "Greek_switch", XKB_KEY_Greek_switch }, + { "Greek_TAU", XKB_KEY_Greek_TAU }, + { "Greek_tau", XKB_KEY_Greek_tau }, + { "Greek_THETA", XKB_KEY_Greek_THETA }, + { "Greek_theta", XKB_KEY_Greek_theta }, + { "Greek_UPSILON", XKB_KEY_Greek_UPSILON }, + { "Greek_upsilon", XKB_KEY_Greek_upsilon }, + { "Greek_UPSILONaccent", XKB_KEY_Greek_UPSILONaccent }, + { "Greek_upsilonaccent", XKB_KEY_Greek_upsilonaccent }, + { "Greek_upsilonaccentdieresis", XKB_KEY_Greek_upsilonaccentdieresis }, + { "Greek_UPSILONdieresis", XKB_KEY_Greek_UPSILONdieresis }, + { "Greek_upsilondieresis", XKB_KEY_Greek_upsilondieresis }, + { "Greek_XI", XKB_KEY_Greek_XI }, + { "Greek_xi", XKB_KEY_Greek_xi }, + { "Greek_ZETA", XKB_KEY_Greek_ZETA }, + { "Greek_zeta", XKB_KEY_Greek_zeta }, + { "guilder", XKB_KEY_guilder }, + { "guillemotleft", XKB_KEY_guillemotleft }, + { "guillemotright", XKB_KEY_guillemotright }, + { "H", XKB_KEY_H }, + { "h", XKB_KEY_h }, + { "hairspace", XKB_KEY_hairspace }, + { "Hangul", XKB_KEY_Hangul }, + { "Hangul_A", XKB_KEY_Hangul_A }, + { "Hangul_AE", XKB_KEY_Hangul_AE }, + { "Hangul_AraeA", XKB_KEY_Hangul_AraeA }, + { "Hangul_AraeAE", XKB_KEY_Hangul_AraeAE }, + { "Hangul_Banja", XKB_KEY_Hangul_Banja }, + { "Hangul_Cieuc", XKB_KEY_Hangul_Cieuc }, + { "Hangul_Codeinput", XKB_KEY_Hangul_Codeinput }, + { "Hangul_Dikeud", XKB_KEY_Hangul_Dikeud }, + { "Hangul_E", XKB_KEY_Hangul_E }, + { "Hangul_End", XKB_KEY_Hangul_End }, + { "Hangul_EO", XKB_KEY_Hangul_EO }, + { "Hangul_EU", XKB_KEY_Hangul_EU }, + { "Hangul_Hanja", XKB_KEY_Hangul_Hanja }, + { "Hangul_Hieuh", XKB_KEY_Hangul_Hieuh }, + { "Hangul_I", XKB_KEY_Hangul_I }, + { "Hangul_Ieung", XKB_KEY_Hangul_Ieung }, + { "Hangul_J_Cieuc", XKB_KEY_Hangul_J_Cieuc }, + { "Hangul_J_Dikeud", XKB_KEY_Hangul_J_Dikeud }, + { "Hangul_J_Hieuh", XKB_KEY_Hangul_J_Hieuh }, + { "Hangul_J_Ieung", XKB_KEY_Hangul_J_Ieung }, + { "Hangul_J_Jieuj", XKB_KEY_Hangul_J_Jieuj }, + { "Hangul_J_Khieuq", XKB_KEY_Hangul_J_Khieuq }, + { "Hangul_J_Kiyeog", XKB_KEY_Hangul_J_Kiyeog }, + { "Hangul_J_KiyeogSios", XKB_KEY_Hangul_J_KiyeogSios }, + { "Hangul_J_KkogjiDalrinIeung", XKB_KEY_Hangul_J_KkogjiDalrinIeung }, + { "Hangul_J_Mieum", XKB_KEY_Hangul_J_Mieum }, + { "Hangul_J_Nieun", XKB_KEY_Hangul_J_Nieun }, + { "Hangul_J_NieunHieuh", XKB_KEY_Hangul_J_NieunHieuh }, + { "Hangul_J_NieunJieuj", XKB_KEY_Hangul_J_NieunJieuj }, + { "Hangul_J_PanSios", XKB_KEY_Hangul_J_PanSios }, + { "Hangul_J_Phieuf", XKB_KEY_Hangul_J_Phieuf }, + { "Hangul_J_Pieub", XKB_KEY_Hangul_J_Pieub }, + { "Hangul_J_PieubSios", XKB_KEY_Hangul_J_PieubSios }, + { "Hangul_J_Rieul", XKB_KEY_Hangul_J_Rieul }, + { "Hangul_J_RieulHieuh", XKB_KEY_Hangul_J_RieulHieuh }, + { "Hangul_J_RieulKiyeog", XKB_KEY_Hangul_J_RieulKiyeog }, + { "Hangul_J_RieulMieum", XKB_KEY_Hangul_J_RieulMieum }, + { "Hangul_J_RieulPhieuf", XKB_KEY_Hangul_J_RieulPhieuf }, + { "Hangul_J_RieulPieub", XKB_KEY_Hangul_J_RieulPieub }, + { "Hangul_J_RieulSios", XKB_KEY_Hangul_J_RieulSios }, + { "Hangul_J_RieulTieut", XKB_KEY_Hangul_J_RieulTieut }, + { "Hangul_J_Sios", XKB_KEY_Hangul_J_Sios }, + { "Hangul_J_SsangKiyeog", XKB_KEY_Hangul_J_SsangKiyeog }, + { "Hangul_J_SsangSios", XKB_KEY_Hangul_J_SsangSios }, + { "Hangul_J_Tieut", XKB_KEY_Hangul_J_Tieut }, + { "Hangul_J_YeorinHieuh", XKB_KEY_Hangul_J_YeorinHieuh }, + { "Hangul_Jamo", XKB_KEY_Hangul_Jamo }, + { "Hangul_Jeonja", XKB_KEY_Hangul_Jeonja }, + { "Hangul_Jieuj", XKB_KEY_Hangul_Jieuj }, + { "Hangul_Khieuq", XKB_KEY_Hangul_Khieuq }, + { "Hangul_Kiyeog", XKB_KEY_Hangul_Kiyeog }, + { "Hangul_KiyeogSios", XKB_KEY_Hangul_KiyeogSios }, + { "Hangul_KkogjiDalrinIeung", XKB_KEY_Hangul_KkogjiDalrinIeung }, + { "Hangul_Mieum", XKB_KEY_Hangul_Mieum }, + { "Hangul_MultipleCandidate", XKB_KEY_Hangul_MultipleCandidate }, + { "Hangul_Nieun", XKB_KEY_Hangul_Nieun }, + { "Hangul_NieunHieuh", XKB_KEY_Hangul_NieunHieuh }, + { "Hangul_NieunJieuj", XKB_KEY_Hangul_NieunJieuj }, + { "Hangul_O", XKB_KEY_Hangul_O }, + { "Hangul_OE", XKB_KEY_Hangul_OE }, + { "Hangul_PanSios", XKB_KEY_Hangul_PanSios }, + { "Hangul_Phieuf", XKB_KEY_Hangul_Phieuf }, + { "Hangul_Pieub", XKB_KEY_Hangul_Pieub }, + { "Hangul_PieubSios", XKB_KEY_Hangul_PieubSios }, + { "Hangul_PostHanja", XKB_KEY_Hangul_PostHanja }, + { "Hangul_PreHanja", XKB_KEY_Hangul_PreHanja }, + { "Hangul_PreviousCandidate", XKB_KEY_Hangul_PreviousCandidate }, + { "Hangul_Rieul", XKB_KEY_Hangul_Rieul }, + { "Hangul_RieulHieuh", XKB_KEY_Hangul_RieulHieuh }, + { "Hangul_RieulKiyeog", XKB_KEY_Hangul_RieulKiyeog }, + { "Hangul_RieulMieum", XKB_KEY_Hangul_RieulMieum }, + { "Hangul_RieulPhieuf", XKB_KEY_Hangul_RieulPhieuf }, + { "Hangul_RieulPieub", XKB_KEY_Hangul_RieulPieub }, + { "Hangul_RieulSios", XKB_KEY_Hangul_RieulSios }, + { "Hangul_RieulTieut", XKB_KEY_Hangul_RieulTieut }, + { "Hangul_RieulYeorinHieuh", XKB_KEY_Hangul_RieulYeorinHieuh }, + { "Hangul_Romaja", XKB_KEY_Hangul_Romaja }, + { "Hangul_SingleCandidate", XKB_KEY_Hangul_SingleCandidate }, + { "Hangul_Sios", XKB_KEY_Hangul_Sios }, + { "Hangul_Special", XKB_KEY_Hangul_Special }, + { "Hangul_SsangDikeud", XKB_KEY_Hangul_SsangDikeud }, + { "Hangul_SsangJieuj", XKB_KEY_Hangul_SsangJieuj }, + { "Hangul_SsangKiyeog", XKB_KEY_Hangul_SsangKiyeog }, + { "Hangul_SsangPieub", XKB_KEY_Hangul_SsangPieub }, + { "Hangul_SsangSios", XKB_KEY_Hangul_SsangSios }, + { "Hangul_Start", XKB_KEY_Hangul_Start }, + { "Hangul_SunkyeongeumMieum", XKB_KEY_Hangul_SunkyeongeumMieum }, + { "Hangul_SunkyeongeumPhieuf", XKB_KEY_Hangul_SunkyeongeumPhieuf }, + { "Hangul_SunkyeongeumPieub", XKB_KEY_Hangul_SunkyeongeumPieub }, + { "Hangul_switch", XKB_KEY_Hangul_switch }, + { "Hangul_Tieut", XKB_KEY_Hangul_Tieut }, + { "Hangul_U", XKB_KEY_Hangul_U }, + { "Hangul_WA", XKB_KEY_Hangul_WA }, + { "Hangul_WAE", XKB_KEY_Hangul_WAE }, + { "Hangul_WE", XKB_KEY_Hangul_WE }, + { "Hangul_WEO", XKB_KEY_Hangul_WEO }, + { "Hangul_WI", XKB_KEY_Hangul_WI }, + { "Hangul_YA", XKB_KEY_Hangul_YA }, + { "Hangul_YAE", XKB_KEY_Hangul_YAE }, + { "Hangul_YE", XKB_KEY_Hangul_YE }, + { "Hangul_YEO", XKB_KEY_Hangul_YEO }, + { "Hangul_YeorinHieuh", XKB_KEY_Hangul_YeorinHieuh }, + { "Hangul_YI", XKB_KEY_Hangul_YI }, + { "Hangul_YO", XKB_KEY_Hangul_YO }, + { "Hangul_YU", XKB_KEY_Hangul_YU }, + { "Hankaku", XKB_KEY_Hankaku }, + { "Hcircumflex", XKB_KEY_Hcircumflex }, + { "hcircumflex", XKB_KEY_hcircumflex }, + { "heart", XKB_KEY_heart }, + { "hebrew_aleph", XKB_KEY_hebrew_aleph }, + { "hebrew_ayin", XKB_KEY_hebrew_ayin }, + { "hebrew_bet", XKB_KEY_hebrew_bet }, + { "hebrew_beth", XKB_KEY_hebrew_beth }, + { "hebrew_chet", XKB_KEY_hebrew_chet }, + { "hebrew_dalet", XKB_KEY_hebrew_dalet }, + { "hebrew_daleth", XKB_KEY_hebrew_daleth }, + { "hebrew_doublelowline", XKB_KEY_hebrew_doublelowline }, + { "hebrew_finalkaph", XKB_KEY_hebrew_finalkaph }, + { "hebrew_finalmem", XKB_KEY_hebrew_finalmem }, + { "hebrew_finalnun", XKB_KEY_hebrew_finalnun }, + { "hebrew_finalpe", XKB_KEY_hebrew_finalpe }, + { "hebrew_finalzade", XKB_KEY_hebrew_finalzade }, + { "hebrew_finalzadi", XKB_KEY_hebrew_finalzadi }, + { "hebrew_gimel", XKB_KEY_hebrew_gimel }, + { "hebrew_gimmel", XKB_KEY_hebrew_gimmel }, + { "hebrew_he", XKB_KEY_hebrew_he }, + { "hebrew_het", XKB_KEY_hebrew_het }, + { "hebrew_kaph", XKB_KEY_hebrew_kaph }, + { "hebrew_kuf", XKB_KEY_hebrew_kuf }, + { "hebrew_lamed", XKB_KEY_hebrew_lamed }, + { "hebrew_mem", XKB_KEY_hebrew_mem }, + { "hebrew_nun", XKB_KEY_hebrew_nun }, + { "hebrew_pe", XKB_KEY_hebrew_pe }, + { "hebrew_qoph", XKB_KEY_hebrew_qoph }, + { "hebrew_resh", XKB_KEY_hebrew_resh }, + { "hebrew_samech", XKB_KEY_hebrew_samech }, + { "hebrew_samekh", XKB_KEY_hebrew_samekh }, + { "hebrew_shin", XKB_KEY_hebrew_shin }, + { "Hebrew_switch", XKB_KEY_Hebrew_switch }, + { "hebrew_taf", XKB_KEY_hebrew_taf }, + { "hebrew_taw", XKB_KEY_hebrew_taw }, + { "hebrew_tet", XKB_KEY_hebrew_tet }, + { "hebrew_teth", XKB_KEY_hebrew_teth }, + { "hebrew_waw", XKB_KEY_hebrew_waw }, + { "hebrew_yod", XKB_KEY_hebrew_yod }, + { "hebrew_zade", XKB_KEY_hebrew_zade }, + { "hebrew_zadi", XKB_KEY_hebrew_zadi }, + { "hebrew_zain", XKB_KEY_hebrew_zain }, + { "hebrew_zayin", XKB_KEY_hebrew_zayin }, + { "Help", XKB_KEY_Help }, + { "Henkan", XKB_KEY_Henkan }, + { "Henkan_Mode", XKB_KEY_Henkan_Mode }, + { "hexagram", XKB_KEY_hexagram }, + { "Hiragana", XKB_KEY_Hiragana }, + { "Hiragana_Katakana", XKB_KEY_Hiragana_Katakana }, + { "Home", XKB_KEY_Home }, + { "horizconnector", XKB_KEY_horizconnector }, + { "horizlinescan1", XKB_KEY_horizlinescan1 }, + { "horizlinescan3", XKB_KEY_horizlinescan3 }, + { "horizlinescan5", XKB_KEY_horizlinescan5 }, + { "horizlinescan7", XKB_KEY_horizlinescan7 }, + { "horizlinescan9", XKB_KEY_horizlinescan9 }, + { "hpBackTab", XKB_KEY_hpBackTab }, + { "hpblock", XKB_KEY_hpblock }, + { "hpClearLine", XKB_KEY_hpClearLine }, + { "hpDeleteChar", XKB_KEY_hpDeleteChar }, + { "hpDeleteLine", XKB_KEY_hpDeleteLine }, + { "hpguilder", XKB_KEY_hpguilder }, + { "hpInsertChar", XKB_KEY_hpInsertChar }, + { "hpInsertLine", XKB_KEY_hpInsertLine }, + { "hpIO", XKB_KEY_hpIO }, + { "hpKP_BackTab", XKB_KEY_hpKP_BackTab }, + { "hplira", XKB_KEY_hplira }, + { "hplongminus", XKB_KEY_hplongminus }, + { "hpModelock1", XKB_KEY_hpModelock1 }, + { "hpModelock2", XKB_KEY_hpModelock2 }, + { "hpmute_acute", XKB_KEY_hpmute_acute }, + { "hpmute_asciicircum", XKB_KEY_hpmute_asciicircum }, + { "hpmute_asciitilde", XKB_KEY_hpmute_asciitilde }, + { "hpmute_diaeresis", XKB_KEY_hpmute_diaeresis }, + { "hpmute_grave", XKB_KEY_hpmute_grave }, + { "hpReset", XKB_KEY_hpReset }, + { "hpSystem", XKB_KEY_hpSystem }, + { "hpUser", XKB_KEY_hpUser }, + { "hpYdiaeresis", XKB_KEY_hpYdiaeresis }, + { "Hstroke", XKB_KEY_Hstroke }, + { "hstroke", XKB_KEY_hstroke }, + { "ht", XKB_KEY_ht }, + { "Hyper_L", XKB_KEY_Hyper_L }, + { "Hyper_R", XKB_KEY_Hyper_R }, + { "hyphen", XKB_KEY_hyphen }, + { "I", XKB_KEY_I }, + { "i", XKB_KEY_i }, + { "Iabovedot", XKB_KEY_Iabovedot }, + { "Iacute", XKB_KEY_Iacute }, + { "iacute", XKB_KEY_iacute }, + { "Ibelowdot", XKB_KEY_Ibelowdot }, + { "ibelowdot", XKB_KEY_ibelowdot }, + { "Ibreve", XKB_KEY_Ibreve }, + { "ibreve", XKB_KEY_ibreve }, + { "Icircumflex", XKB_KEY_Icircumflex }, + { "icircumflex", XKB_KEY_icircumflex }, + { "identical", XKB_KEY_identical }, + { "Idiaeresis", XKB_KEY_Idiaeresis }, + { "idiaeresis", XKB_KEY_idiaeresis }, + { "idotless", XKB_KEY_idotless }, + { "ifonlyif", XKB_KEY_ifonlyif }, + { "Igrave", XKB_KEY_Igrave }, + { "igrave", XKB_KEY_igrave }, + { "Ihook", XKB_KEY_Ihook }, + { "ihook", XKB_KEY_ihook }, + { "Imacron", XKB_KEY_Imacron }, + { "imacron", XKB_KEY_imacron }, + { "implies", XKB_KEY_implies }, + { "includedin", XKB_KEY_includedin }, + { "includes", XKB_KEY_includes }, + { "infinity", XKB_KEY_infinity }, + { "Insert", XKB_KEY_Insert }, + { "InsertChar", XKB_KEY_InsertChar }, + { "InsertLine", XKB_KEY_InsertLine }, + { "integral", XKB_KEY_integral }, + { "intersection", XKB_KEY_intersection }, + { "IO", XKB_KEY_IO }, + { "Iogonek", XKB_KEY_Iogonek }, + { "iogonek", XKB_KEY_iogonek }, + { "ISO_Center_Object", XKB_KEY_ISO_Center_Object }, + { "ISO_Continuous_Underline", XKB_KEY_ISO_Continuous_Underline }, + { "ISO_Discontinuous_Underline", XKB_KEY_ISO_Discontinuous_Underline }, + { "ISO_Emphasize", XKB_KEY_ISO_Emphasize }, + { "ISO_Enter", XKB_KEY_ISO_Enter }, + { "ISO_Fast_Cursor_Down", XKB_KEY_ISO_Fast_Cursor_Down }, + { "ISO_Fast_Cursor_Left", XKB_KEY_ISO_Fast_Cursor_Left }, + { "ISO_Fast_Cursor_Right", XKB_KEY_ISO_Fast_Cursor_Right }, + { "ISO_Fast_Cursor_Up", XKB_KEY_ISO_Fast_Cursor_Up }, + { "ISO_First_Group", XKB_KEY_ISO_First_Group }, + { "ISO_First_Group_Lock", XKB_KEY_ISO_First_Group_Lock }, + { "ISO_Group_Latch", XKB_KEY_ISO_Group_Latch }, + { "ISO_Group_Lock", XKB_KEY_ISO_Group_Lock }, + { "ISO_Group_Shift", XKB_KEY_ISO_Group_Shift }, + { "ISO_Last_Group", XKB_KEY_ISO_Last_Group }, + { "ISO_Last_Group_Lock", XKB_KEY_ISO_Last_Group_Lock }, + { "ISO_Left_Tab", XKB_KEY_ISO_Left_Tab }, + { "ISO_Level2_Latch", XKB_KEY_ISO_Level2_Latch }, + { "ISO_Level3_Latch", XKB_KEY_ISO_Level3_Latch }, + { "ISO_Level3_Lock", XKB_KEY_ISO_Level3_Lock }, + { "ISO_Level3_Shift", XKB_KEY_ISO_Level3_Shift }, + { "ISO_Level5_Latch", XKB_KEY_ISO_Level5_Latch }, + { "ISO_Level5_Lock", XKB_KEY_ISO_Level5_Lock }, + { "ISO_Level5_Shift", XKB_KEY_ISO_Level5_Shift }, + { "ISO_Lock", XKB_KEY_ISO_Lock }, + { "ISO_Move_Line_Down", XKB_KEY_ISO_Move_Line_Down }, + { "ISO_Move_Line_Up", XKB_KEY_ISO_Move_Line_Up }, + { "ISO_Next_Group", XKB_KEY_ISO_Next_Group }, + { "ISO_Next_Group_Lock", XKB_KEY_ISO_Next_Group_Lock }, + { "ISO_Partial_Line_Down", XKB_KEY_ISO_Partial_Line_Down }, + { "ISO_Partial_Line_Up", XKB_KEY_ISO_Partial_Line_Up }, + { "ISO_Partial_Space_Left", XKB_KEY_ISO_Partial_Space_Left }, + { "ISO_Partial_Space_Right", XKB_KEY_ISO_Partial_Space_Right }, + { "ISO_Prev_Group", XKB_KEY_ISO_Prev_Group }, + { "ISO_Prev_Group_Lock", XKB_KEY_ISO_Prev_Group_Lock }, + { "ISO_Release_Both_Margins", XKB_KEY_ISO_Release_Both_Margins }, + { "ISO_Release_Margin_Left", XKB_KEY_ISO_Release_Margin_Left }, + { "ISO_Release_Margin_Right", XKB_KEY_ISO_Release_Margin_Right }, + { "ISO_Set_Margin_Left", XKB_KEY_ISO_Set_Margin_Left }, + { "ISO_Set_Margin_Right", XKB_KEY_ISO_Set_Margin_Right }, + { "Itilde", XKB_KEY_Itilde }, + { "itilde", XKB_KEY_itilde }, + { "J", XKB_KEY_J }, + { "j", XKB_KEY_j }, + { "Jcircumflex", XKB_KEY_Jcircumflex }, + { "jcircumflex", XKB_KEY_jcircumflex }, + { "jot", XKB_KEY_jot }, + { "K", XKB_KEY_K }, + { "k", XKB_KEY_k }, + { "kana_a", XKB_KEY_kana_a }, + { "kana_A", XKB_KEY_kana_A }, + { "kana_CHI", XKB_KEY_kana_CHI }, + { "kana_closingbracket", XKB_KEY_kana_closingbracket }, + { "kana_comma", XKB_KEY_kana_comma }, + { "kana_conjunctive", XKB_KEY_kana_conjunctive }, + { "kana_e", XKB_KEY_kana_e }, + { "kana_E", XKB_KEY_kana_E }, + { "kana_FU", XKB_KEY_kana_FU }, + { "kana_fullstop", XKB_KEY_kana_fullstop }, + { "kana_HA", XKB_KEY_kana_HA }, + { "kana_HE", XKB_KEY_kana_HE }, + { "kana_HI", XKB_KEY_kana_HI }, + { "kana_HO", XKB_KEY_kana_HO }, + { "kana_HU", XKB_KEY_kana_HU }, + { "kana_i", XKB_KEY_kana_i }, + { "kana_I", XKB_KEY_kana_I }, + { "kana_KA", XKB_KEY_kana_KA }, + { "kana_KE", XKB_KEY_kana_KE }, + { "kana_KI", XKB_KEY_kana_KI }, + { "kana_KO", XKB_KEY_kana_KO }, + { "kana_KU", XKB_KEY_kana_KU }, + { "Kana_Lock", XKB_KEY_Kana_Lock }, + { "kana_MA", XKB_KEY_kana_MA }, + { "kana_ME", XKB_KEY_kana_ME }, + { "kana_MI", XKB_KEY_kana_MI }, + { "kana_middledot", XKB_KEY_kana_middledot }, + { "kana_MO", XKB_KEY_kana_MO }, + { "kana_MU", XKB_KEY_kana_MU }, + { "kana_N", XKB_KEY_kana_N }, + { "kana_NA", XKB_KEY_kana_NA }, + { "kana_NE", XKB_KEY_kana_NE }, + { "kana_NI", XKB_KEY_kana_NI }, + { "kana_NO", XKB_KEY_kana_NO }, + { "kana_NU", XKB_KEY_kana_NU }, + { "kana_o", XKB_KEY_kana_o }, + { "kana_O", XKB_KEY_kana_O }, + { "kana_openingbracket", XKB_KEY_kana_openingbracket }, + { "kana_RA", XKB_KEY_kana_RA }, + { "kana_RE", XKB_KEY_kana_RE }, + { "kana_RI", XKB_KEY_kana_RI }, + { "kana_RO", XKB_KEY_kana_RO }, + { "kana_RU", XKB_KEY_kana_RU }, + { "kana_SA", XKB_KEY_kana_SA }, + { "kana_SE", XKB_KEY_kana_SE }, + { "kana_SHI", XKB_KEY_kana_SHI }, + { "Kana_Shift", XKB_KEY_Kana_Shift }, + { "kana_SO", XKB_KEY_kana_SO }, + { "kana_SU", XKB_KEY_kana_SU }, + { "kana_switch", XKB_KEY_kana_switch }, + { "kana_TA", XKB_KEY_kana_TA }, + { "kana_TE", XKB_KEY_kana_TE }, + { "kana_TI", XKB_KEY_kana_TI }, + { "kana_TO", XKB_KEY_kana_TO }, + { "kana_tsu", XKB_KEY_kana_tsu }, + { "kana_TSU", XKB_KEY_kana_TSU }, + { "kana_tu", XKB_KEY_kana_tu }, + { "kana_TU", XKB_KEY_kana_TU }, + { "kana_u", XKB_KEY_kana_u }, + { "kana_U", XKB_KEY_kana_U }, + { "kana_WA", XKB_KEY_kana_WA }, + { "kana_WO", XKB_KEY_kana_WO }, + { "kana_ya", XKB_KEY_kana_ya }, + { "kana_YA", XKB_KEY_kana_YA }, + { "kana_yo", XKB_KEY_kana_yo }, + { "kana_YO", XKB_KEY_kana_YO }, + { "kana_yu", XKB_KEY_kana_yu }, + { "kana_YU", XKB_KEY_kana_YU }, + { "Kanji", XKB_KEY_Kanji }, + { "Kanji_Bangou", XKB_KEY_Kanji_Bangou }, + { "kappa", XKB_KEY_kappa }, + { "Katakana", XKB_KEY_Katakana }, + { "Kcedilla", XKB_KEY_Kcedilla }, + { "kcedilla", XKB_KEY_kcedilla }, + { "Korean_Won", XKB_KEY_Korean_Won }, + { "KP_0", XKB_KEY_KP_0 }, + { "KP_1", XKB_KEY_KP_1 }, + { "KP_2", XKB_KEY_KP_2 }, + { "KP_3", XKB_KEY_KP_3 }, + { "KP_4", XKB_KEY_KP_4 }, + { "KP_5", XKB_KEY_KP_5 }, + { "KP_6", XKB_KEY_KP_6 }, + { "KP_7", XKB_KEY_KP_7 }, + { "KP_8", XKB_KEY_KP_8 }, + { "KP_9", XKB_KEY_KP_9 }, + { "KP_Add", XKB_KEY_KP_Add }, + { "KP_BackTab", XKB_KEY_KP_BackTab }, + { "KP_Begin", XKB_KEY_KP_Begin }, + { "KP_Decimal", XKB_KEY_KP_Decimal }, + { "KP_Delete", XKB_KEY_KP_Delete }, + { "KP_Divide", XKB_KEY_KP_Divide }, + { "KP_Down", XKB_KEY_KP_Down }, + { "KP_End", XKB_KEY_KP_End }, + { "KP_Enter", XKB_KEY_KP_Enter }, + { "KP_Equal", XKB_KEY_KP_Equal }, + { "KP_F1", XKB_KEY_KP_F1 }, + { "KP_F2", XKB_KEY_KP_F2 }, + { "KP_F3", XKB_KEY_KP_F3 }, + { "KP_F4", XKB_KEY_KP_F4 }, + { "KP_Home", XKB_KEY_KP_Home }, + { "KP_Insert", XKB_KEY_KP_Insert }, + { "KP_Left", XKB_KEY_KP_Left }, + { "KP_Multiply", XKB_KEY_KP_Multiply }, + { "KP_Next", XKB_KEY_KP_Next }, + { "KP_Page_Down", XKB_KEY_KP_Page_Down }, + { "KP_Page_Up", XKB_KEY_KP_Page_Up }, + { "KP_Prior", XKB_KEY_KP_Prior }, + { "KP_Right", XKB_KEY_KP_Right }, + { "KP_Separator", XKB_KEY_KP_Separator }, + { "KP_Space", XKB_KEY_KP_Space }, + { "KP_Subtract", XKB_KEY_KP_Subtract }, + { "KP_Tab", XKB_KEY_KP_Tab }, + { "KP_Up", XKB_KEY_KP_Up }, + { "kra", XKB_KEY_kra }, + { "L", XKB_KEY_L }, + { "l", XKB_KEY_l }, + { "L1", XKB_KEY_L1 }, + { "L10", XKB_KEY_L10 }, + { "L2", XKB_KEY_L2 }, + { "L3", XKB_KEY_L3 }, + { "L4", XKB_KEY_L4 }, + { "L5", XKB_KEY_L5 }, + { "L6", XKB_KEY_L6 }, + { "L7", XKB_KEY_L7 }, + { "L8", XKB_KEY_L8 }, + { "L9", XKB_KEY_L9 }, + { "Lacute", XKB_KEY_Lacute }, + { "lacute", XKB_KEY_lacute }, + { "Last_Virtual_Screen", XKB_KEY_Last_Virtual_Screen }, + { "latincross", XKB_KEY_latincross }, + { "Lbelowdot", XKB_KEY_Lbelowdot }, + { "lbelowdot", XKB_KEY_lbelowdot }, + { "Lcaron", XKB_KEY_Lcaron }, + { "lcaron", XKB_KEY_lcaron }, + { "Lcedilla", XKB_KEY_Lcedilla }, + { "lcedilla", XKB_KEY_lcedilla }, + { "Left", XKB_KEY_Left }, + { "leftanglebracket", XKB_KEY_leftanglebracket }, + { "leftarrow", XKB_KEY_leftarrow }, + { "leftcaret", XKB_KEY_leftcaret }, + { "leftdoublequotemark", XKB_KEY_leftdoublequotemark }, + { "leftmiddlecurlybrace", XKB_KEY_leftmiddlecurlybrace }, + { "leftopentriangle", XKB_KEY_leftopentriangle }, + { "leftpointer", XKB_KEY_leftpointer }, + { "leftradical", XKB_KEY_leftradical }, + { "leftshoe", XKB_KEY_leftshoe }, + { "leftsinglequotemark", XKB_KEY_leftsinglequotemark }, + { "leftt", XKB_KEY_leftt }, + { "lefttack", XKB_KEY_lefttack }, + { "less", XKB_KEY_less }, + { "lessthanequal", XKB_KEY_lessthanequal }, + { "lf", XKB_KEY_lf }, + { "Linefeed", XKB_KEY_Linefeed }, + { "lira", XKB_KEY_lira }, + { "LiraSign", XKB_KEY_LiraSign }, + { "logicaland", XKB_KEY_logicaland }, + { "logicalor", XKB_KEY_logicalor }, + { "longminus", XKB_KEY_longminus }, + { "lowleftcorner", XKB_KEY_lowleftcorner }, + { "lowrightcorner", XKB_KEY_lowrightcorner }, + { "Lstroke", XKB_KEY_Lstroke }, + { "lstroke", XKB_KEY_lstroke }, + { "M", XKB_KEY_M }, + { "m", XKB_KEY_m }, + { "Mabovedot", XKB_KEY_Mabovedot }, + { "mabovedot", XKB_KEY_mabovedot }, + { "Macedonia_dse", XKB_KEY_Macedonia_dse }, + { "Macedonia_DSE", XKB_KEY_Macedonia_DSE }, + { "Macedonia_gje", XKB_KEY_Macedonia_gje }, + { "Macedonia_GJE", XKB_KEY_Macedonia_GJE }, + { "Macedonia_kje", XKB_KEY_Macedonia_kje }, + { "Macedonia_KJE", XKB_KEY_Macedonia_KJE }, + { "macron", XKB_KEY_macron }, + { "Mae_Koho", XKB_KEY_Mae_Koho }, + { "malesymbol", XKB_KEY_malesymbol }, + { "maltesecross", XKB_KEY_maltesecross }, + { "marker", XKB_KEY_marker }, + { "masculine", XKB_KEY_masculine }, + { "Massyo", XKB_KEY_Massyo }, + { "Menu", XKB_KEY_Menu }, + { "Meta_L", XKB_KEY_Meta_L }, + { "Meta_R", XKB_KEY_Meta_R }, + { "MillSign", XKB_KEY_MillSign }, + { "minus", XKB_KEY_minus }, + { "minutes", XKB_KEY_minutes }, + { "Mode_switch", XKB_KEY_Mode_switch }, + { "MouseKeys_Accel_Enable", XKB_KEY_MouseKeys_Accel_Enable }, + { "MouseKeys_Enable", XKB_KEY_MouseKeys_Enable }, + { "mu", XKB_KEY_mu }, + { "Muhenkan", XKB_KEY_Muhenkan }, + { "Multi_key", XKB_KEY_Multi_key }, + { "MultipleCandidate", XKB_KEY_MultipleCandidate }, + { "multiply", XKB_KEY_multiply }, + { "musicalflat", XKB_KEY_musicalflat }, + { "musicalsharp", XKB_KEY_musicalsharp }, + { "mute_acute", XKB_KEY_mute_acute }, + { "mute_asciicircum", XKB_KEY_mute_asciicircum }, + { "mute_asciitilde", XKB_KEY_mute_asciitilde }, + { "mute_diaeresis", XKB_KEY_mute_diaeresis }, + { "mute_grave", XKB_KEY_mute_grave }, + { "N", XKB_KEY_N }, + { "n", XKB_KEY_n }, + { "nabla", XKB_KEY_nabla }, + { "Nacute", XKB_KEY_Nacute }, + { "nacute", XKB_KEY_nacute }, + { "NairaSign", XKB_KEY_NairaSign }, + { "Ncaron", XKB_KEY_Ncaron }, + { "ncaron", XKB_KEY_ncaron }, + { "Ncedilla", XKB_KEY_Ncedilla }, + { "ncedilla", XKB_KEY_ncedilla }, + { "NewSheqelSign", XKB_KEY_NewSheqelSign }, + { "Next", XKB_KEY_Next }, + { "Next_Virtual_Screen", XKB_KEY_Next_Virtual_Screen }, + { "ninesubscript", XKB_KEY_ninesubscript }, + { "ninesuperior", XKB_KEY_ninesuperior }, + { "nl", XKB_KEY_nl }, + { "nobreakspace", XKB_KEY_nobreakspace }, + { "NoSymbol", XKB_KEY_NoSymbol }, + { "notapproxeq", XKB_KEY_notapproxeq }, + { "notelementof", XKB_KEY_notelementof }, + { "notequal", XKB_KEY_notequal }, + { "notidentical", XKB_KEY_notidentical }, + { "notsign", XKB_KEY_notsign }, + { "Ntilde", XKB_KEY_Ntilde }, + { "ntilde", XKB_KEY_ntilde }, + { "Num_Lock", XKB_KEY_Num_Lock }, + { "numbersign", XKB_KEY_numbersign }, + { "numerosign", XKB_KEY_numerosign }, + { "O", XKB_KEY_O }, + { "o", XKB_KEY_o }, + { "Oacute", XKB_KEY_Oacute }, + { "oacute", XKB_KEY_oacute }, + { "Obarred", XKB_KEY_Obarred }, + { "obarred", XKB_KEY_obarred }, + { "Obelowdot", XKB_KEY_Obelowdot }, + { "obelowdot", XKB_KEY_obelowdot }, + { "Ocaron", XKB_KEY_Ocaron }, + { "ocaron", XKB_KEY_ocaron }, + { "Ocircumflex", XKB_KEY_Ocircumflex }, + { "ocircumflex", XKB_KEY_ocircumflex }, + { "Ocircumflexacute", XKB_KEY_Ocircumflexacute }, + { "ocircumflexacute", XKB_KEY_ocircumflexacute }, + { "Ocircumflexbelowdot", XKB_KEY_Ocircumflexbelowdot }, + { "ocircumflexbelowdot", XKB_KEY_ocircumflexbelowdot }, + { "Ocircumflexgrave", XKB_KEY_Ocircumflexgrave }, + { "ocircumflexgrave", XKB_KEY_ocircumflexgrave }, + { "Ocircumflexhook", XKB_KEY_Ocircumflexhook }, + { "ocircumflexhook", XKB_KEY_ocircumflexhook }, + { "Ocircumflextilde", XKB_KEY_Ocircumflextilde }, + { "ocircumflextilde", XKB_KEY_ocircumflextilde }, + { "Odiaeresis", XKB_KEY_Odiaeresis }, + { "odiaeresis", XKB_KEY_odiaeresis }, + { "Odoubleacute", XKB_KEY_Odoubleacute }, + { "odoubleacute", XKB_KEY_odoubleacute }, + { "OE", XKB_KEY_OE }, + { "oe", XKB_KEY_oe }, + { "ogonek", XKB_KEY_ogonek }, + { "Ograve", XKB_KEY_Ograve }, + { "ograve", XKB_KEY_ograve }, + { "Ohook", XKB_KEY_Ohook }, + { "ohook", XKB_KEY_ohook }, + { "Ohorn", XKB_KEY_Ohorn }, + { "ohorn", XKB_KEY_ohorn }, + { "Ohornacute", XKB_KEY_Ohornacute }, + { "ohornacute", XKB_KEY_ohornacute }, + { "Ohornbelowdot", XKB_KEY_Ohornbelowdot }, + { "ohornbelowdot", XKB_KEY_ohornbelowdot }, + { "Ohorngrave", XKB_KEY_Ohorngrave }, + { "ohorngrave", XKB_KEY_ohorngrave }, + { "Ohornhook", XKB_KEY_Ohornhook }, + { "ohornhook", XKB_KEY_ohornhook }, + { "Ohorntilde", XKB_KEY_Ohorntilde }, + { "ohorntilde", XKB_KEY_ohorntilde }, + { "Omacron", XKB_KEY_Omacron }, + { "omacron", XKB_KEY_omacron }, + { "oneeighth", XKB_KEY_oneeighth }, + { "onefifth", XKB_KEY_onefifth }, + { "onehalf", XKB_KEY_onehalf }, + { "onequarter", XKB_KEY_onequarter }, + { "onesixth", XKB_KEY_onesixth }, + { "onesubscript", XKB_KEY_onesubscript }, + { "onesuperior", XKB_KEY_onesuperior }, + { "onethird", XKB_KEY_onethird }, + { "Ooblique", XKB_KEY_Ooblique }, + { "ooblique", XKB_KEY_ooblique }, + { "openrectbullet", XKB_KEY_openrectbullet }, + { "openstar", XKB_KEY_openstar }, + { "opentribulletdown", XKB_KEY_opentribulletdown }, + { "opentribulletup", XKB_KEY_opentribulletup }, + { "ordfeminine", XKB_KEY_ordfeminine }, + { "osfActivate", XKB_KEY_osfActivate }, + { "osfAddMode", XKB_KEY_osfAddMode }, + { "osfBackSpace", XKB_KEY_osfBackSpace }, + { "osfBackTab", XKB_KEY_osfBackTab }, + { "osfBeginData", XKB_KEY_osfBeginData }, + { "osfBeginLine", XKB_KEY_osfBeginLine }, + { "osfCancel", XKB_KEY_osfCancel }, + { "osfClear", XKB_KEY_osfClear }, + { "osfCopy", XKB_KEY_osfCopy }, + { "osfCut", XKB_KEY_osfCut }, + { "osfDelete", XKB_KEY_osfDelete }, + { "osfDeselectAll", XKB_KEY_osfDeselectAll }, + { "osfDown", XKB_KEY_osfDown }, + { "osfEndData", XKB_KEY_osfEndData }, + { "osfEndLine", XKB_KEY_osfEndLine }, + { "osfEscape", XKB_KEY_osfEscape }, + { "osfExtend", XKB_KEY_osfExtend }, + { "osfHelp", XKB_KEY_osfHelp }, + { "osfInsert", XKB_KEY_osfInsert }, + { "osfLeft", XKB_KEY_osfLeft }, + { "osfMenu", XKB_KEY_osfMenu }, + { "osfMenuBar", XKB_KEY_osfMenuBar }, + { "osfNextField", XKB_KEY_osfNextField }, + { "osfNextMenu", XKB_KEY_osfNextMenu }, + { "osfPageDown", XKB_KEY_osfPageDown }, + { "osfPageLeft", XKB_KEY_osfPageLeft }, + { "osfPageRight", XKB_KEY_osfPageRight }, + { "osfPageUp", XKB_KEY_osfPageUp }, + { "osfPaste", XKB_KEY_osfPaste }, + { "osfPrevField", XKB_KEY_osfPrevField }, + { "osfPrevMenu", XKB_KEY_osfPrevMenu }, + { "osfPrimaryPaste", XKB_KEY_osfPrimaryPaste }, + { "osfQuickPaste", XKB_KEY_osfQuickPaste }, + { "osfReselect", XKB_KEY_osfReselect }, + { "osfRestore", XKB_KEY_osfRestore }, + { "osfRight", XKB_KEY_osfRight }, + { "osfSelect", XKB_KEY_osfSelect }, + { "osfSelectAll", XKB_KEY_osfSelectAll }, + { "osfUndo", XKB_KEY_osfUndo }, + { "osfUp", XKB_KEY_osfUp }, + { "Oslash", XKB_KEY_Oslash }, + { "oslash", XKB_KEY_oslash }, + { "Otilde", XKB_KEY_Otilde }, + { "otilde", XKB_KEY_otilde }, + { "overbar", XKB_KEY_overbar }, + { "Overlay1_Enable", XKB_KEY_Overlay1_Enable }, + { "Overlay2_Enable", XKB_KEY_Overlay2_Enable }, + { "overline", XKB_KEY_overline }, + { "P", XKB_KEY_P }, + { "p", XKB_KEY_p }, + { "Pabovedot", XKB_KEY_Pabovedot }, + { "pabovedot", XKB_KEY_pabovedot }, + { "Page_Down", XKB_KEY_Page_Down }, + { "Page_Up", XKB_KEY_Page_Up }, + { "paragraph", XKB_KEY_paragraph }, + { "parenleft", XKB_KEY_parenleft }, + { "parenright", XKB_KEY_parenright }, + { "partdifferential", XKB_KEY_partdifferential }, + { "partialderivative", XKB_KEY_partialderivative }, + { "Pause", XKB_KEY_Pause }, + { "percent", XKB_KEY_percent }, + { "period", XKB_KEY_period }, + { "periodcentered", XKB_KEY_periodcentered }, + { "permille", XKB_KEY_permille }, + { "PesetaSign", XKB_KEY_PesetaSign }, + { "phonographcopyright", XKB_KEY_phonographcopyright }, + { "plus", XKB_KEY_plus }, + { "plusminus", XKB_KEY_plusminus }, + { "Pointer_Accelerate", XKB_KEY_Pointer_Accelerate }, + { "Pointer_Button1", XKB_KEY_Pointer_Button1 }, + { "Pointer_Button2", XKB_KEY_Pointer_Button2 }, + { "Pointer_Button3", XKB_KEY_Pointer_Button3 }, + { "Pointer_Button4", XKB_KEY_Pointer_Button4 }, + { "Pointer_Button5", XKB_KEY_Pointer_Button5 }, + { "Pointer_Button_Dflt", XKB_KEY_Pointer_Button_Dflt }, + { "Pointer_DblClick1", XKB_KEY_Pointer_DblClick1 }, + { "Pointer_DblClick2", XKB_KEY_Pointer_DblClick2 }, + { "Pointer_DblClick3", XKB_KEY_Pointer_DblClick3 }, + { "Pointer_DblClick4", XKB_KEY_Pointer_DblClick4 }, + { "Pointer_DblClick5", XKB_KEY_Pointer_DblClick5 }, + { "Pointer_DblClick_Dflt", XKB_KEY_Pointer_DblClick_Dflt }, + { "Pointer_DfltBtnNext", XKB_KEY_Pointer_DfltBtnNext }, + { "Pointer_DfltBtnPrev", XKB_KEY_Pointer_DfltBtnPrev }, + { "Pointer_Down", XKB_KEY_Pointer_Down }, + { "Pointer_DownLeft", XKB_KEY_Pointer_DownLeft }, + { "Pointer_DownRight", XKB_KEY_Pointer_DownRight }, + { "Pointer_Drag1", XKB_KEY_Pointer_Drag1 }, + { "Pointer_Drag2", XKB_KEY_Pointer_Drag2 }, + { "Pointer_Drag3", XKB_KEY_Pointer_Drag3 }, + { "Pointer_Drag4", XKB_KEY_Pointer_Drag4 }, + { "Pointer_Drag5", XKB_KEY_Pointer_Drag5 }, + { "Pointer_Drag_Dflt", XKB_KEY_Pointer_Drag_Dflt }, + { "Pointer_EnableKeys", XKB_KEY_Pointer_EnableKeys }, + { "Pointer_Left", XKB_KEY_Pointer_Left }, + { "Pointer_Right", XKB_KEY_Pointer_Right }, + { "Pointer_Up", XKB_KEY_Pointer_Up }, + { "Pointer_UpLeft", XKB_KEY_Pointer_UpLeft }, + { "Pointer_UpRight", XKB_KEY_Pointer_UpRight }, + { "prescription", XKB_KEY_prescription }, + { "Prev_Virtual_Screen", XKB_KEY_Prev_Virtual_Screen }, + { "PreviousCandidate", XKB_KEY_PreviousCandidate }, + { "Print", XKB_KEY_Print }, + { "Prior", XKB_KEY_Prior }, + { "prolongedsound", XKB_KEY_prolongedsound }, + { "punctspace", XKB_KEY_punctspace }, + { "Q", XKB_KEY_Q }, + { "q", XKB_KEY_q }, + { "quad", XKB_KEY_quad }, + { "question", XKB_KEY_question }, + { "questiondown", XKB_KEY_questiondown }, + { "quotedbl", XKB_KEY_quotedbl }, + { "quoteleft", XKB_KEY_quoteleft }, + { "quoteright", XKB_KEY_quoteright }, + { "R", XKB_KEY_R }, + { "r", XKB_KEY_r }, + { "R1", XKB_KEY_R1 }, + { "R10", XKB_KEY_R10 }, + { "R11", XKB_KEY_R11 }, + { "R12", XKB_KEY_R12 }, + { "R13", XKB_KEY_R13 }, + { "R14", XKB_KEY_R14 }, + { "R15", XKB_KEY_R15 }, + { "R2", XKB_KEY_R2 }, + { "R3", XKB_KEY_R3 }, + { "R4", XKB_KEY_R4 }, + { "R5", XKB_KEY_R5 }, + { "R6", XKB_KEY_R6 }, + { "R7", XKB_KEY_R7 }, + { "R8", XKB_KEY_R8 }, + { "R9", XKB_KEY_R9 }, + { "Racute", XKB_KEY_Racute }, + { "racute", XKB_KEY_racute }, + { "radical", XKB_KEY_radical }, + { "Rcaron", XKB_KEY_Rcaron }, + { "rcaron", XKB_KEY_rcaron }, + { "Rcedilla", XKB_KEY_Rcedilla }, + { "rcedilla", XKB_KEY_rcedilla }, + { "Redo", XKB_KEY_Redo }, + { "registered", XKB_KEY_registered }, + { "RepeatKeys_Enable", XKB_KEY_RepeatKeys_Enable }, + { "Reset", XKB_KEY_Reset }, + { "Return", XKB_KEY_Return }, + { "Right", XKB_KEY_Right }, + { "rightanglebracket", XKB_KEY_rightanglebracket }, + { "rightarrow", XKB_KEY_rightarrow }, + { "rightcaret", XKB_KEY_rightcaret }, + { "rightdoublequotemark", XKB_KEY_rightdoublequotemark }, + { "rightmiddlecurlybrace", XKB_KEY_rightmiddlecurlybrace }, + { "rightmiddlesummation", XKB_KEY_rightmiddlesummation }, + { "rightopentriangle", XKB_KEY_rightopentriangle }, + { "rightpointer", XKB_KEY_rightpointer }, + { "rightshoe", XKB_KEY_rightshoe }, + { "rightsinglequotemark", XKB_KEY_rightsinglequotemark }, + { "rightt", XKB_KEY_rightt }, + { "righttack", XKB_KEY_righttack }, + { "Romaji", XKB_KEY_Romaji }, + { "RupeeSign", XKB_KEY_RupeeSign }, + { "S", XKB_KEY_S }, + { "s", XKB_KEY_s }, + { "Sabovedot", XKB_KEY_Sabovedot }, + { "sabovedot", XKB_KEY_sabovedot }, + { "Sacute", XKB_KEY_Sacute }, + { "sacute", XKB_KEY_sacute }, + { "Scaron", XKB_KEY_Scaron }, + { "scaron", XKB_KEY_scaron }, + { "Scedilla", XKB_KEY_Scedilla }, + { "scedilla", XKB_KEY_scedilla }, + { "SCHWA", XKB_KEY_SCHWA }, + { "schwa", XKB_KEY_schwa }, + { "Scircumflex", XKB_KEY_Scircumflex }, + { "scircumflex", XKB_KEY_scircumflex }, + { "script_switch", XKB_KEY_script_switch }, + { "Scroll_Lock", XKB_KEY_Scroll_Lock }, + { "seconds", XKB_KEY_seconds }, + { "section", XKB_KEY_section }, + { "Select", XKB_KEY_Select }, + { "semicolon", XKB_KEY_semicolon }, + { "semivoicedsound", XKB_KEY_semivoicedsound }, + { "Serbian_dje", XKB_KEY_Serbian_dje }, + { "Serbian_DJE", XKB_KEY_Serbian_DJE }, + { "Serbian_dze", XKB_KEY_Serbian_dze }, + { "Serbian_DZE", XKB_KEY_Serbian_DZE }, + { "Serbian_je", XKB_KEY_Serbian_je }, + { "Serbian_JE", XKB_KEY_Serbian_JE }, + { "Serbian_lje", XKB_KEY_Serbian_lje }, + { "Serbian_LJE", XKB_KEY_Serbian_LJE }, + { "Serbian_nje", XKB_KEY_Serbian_nje }, + { "Serbian_NJE", XKB_KEY_Serbian_NJE }, + { "Serbian_tshe", XKB_KEY_Serbian_tshe }, + { "Serbian_TSHE", XKB_KEY_Serbian_TSHE }, + { "seveneighths", XKB_KEY_seveneighths }, + { "sevensubscript", XKB_KEY_sevensubscript }, + { "sevensuperior", XKB_KEY_sevensuperior }, + { "Shift_L", XKB_KEY_Shift_L }, + { "Shift_Lock", XKB_KEY_Shift_Lock }, + { "Shift_R", XKB_KEY_Shift_R }, + { "signaturemark", XKB_KEY_signaturemark }, + { "signifblank", XKB_KEY_signifblank }, + { "similarequal", XKB_KEY_similarequal }, + { "SingleCandidate", XKB_KEY_SingleCandidate }, + { "singlelowquotemark", XKB_KEY_singlelowquotemark }, + { "Sinh_a", XKB_KEY_Sinh_a }, + { "Sinh_aa", XKB_KEY_Sinh_aa }, + { "Sinh_aa2", XKB_KEY_Sinh_aa2 }, + { "Sinh_ae", XKB_KEY_Sinh_ae }, + { "Sinh_ae2", XKB_KEY_Sinh_ae2 }, + { "Sinh_aee", XKB_KEY_Sinh_aee }, + { "Sinh_aee2", XKB_KEY_Sinh_aee2 }, + { "Sinh_ai", XKB_KEY_Sinh_ai }, + { "Sinh_ai2", XKB_KEY_Sinh_ai2 }, + { "Sinh_al", XKB_KEY_Sinh_al }, + { "Sinh_au", XKB_KEY_Sinh_au }, + { "Sinh_au2", XKB_KEY_Sinh_au2 }, + { "Sinh_ba", XKB_KEY_Sinh_ba }, + { "Sinh_bha", XKB_KEY_Sinh_bha }, + { "Sinh_ca", XKB_KEY_Sinh_ca }, + { "Sinh_cha", XKB_KEY_Sinh_cha }, + { "Sinh_dda", XKB_KEY_Sinh_dda }, + { "Sinh_ddha", XKB_KEY_Sinh_ddha }, + { "Sinh_dha", XKB_KEY_Sinh_dha }, + { "Sinh_dhha", XKB_KEY_Sinh_dhha }, + { "Sinh_e", XKB_KEY_Sinh_e }, + { "Sinh_e2", XKB_KEY_Sinh_e2 }, + { "Sinh_ee", XKB_KEY_Sinh_ee }, + { "Sinh_ee2", XKB_KEY_Sinh_ee2 }, + { "Sinh_fa", XKB_KEY_Sinh_fa }, + { "Sinh_ga", XKB_KEY_Sinh_ga }, + { "Sinh_gha", XKB_KEY_Sinh_gha }, + { "Sinh_h2", XKB_KEY_Sinh_h2 }, + { "Sinh_ha", XKB_KEY_Sinh_ha }, + { "Sinh_i", XKB_KEY_Sinh_i }, + { "Sinh_i2", XKB_KEY_Sinh_i2 }, + { "Sinh_ii", XKB_KEY_Sinh_ii }, + { "Sinh_ii2", XKB_KEY_Sinh_ii2 }, + { "Sinh_ja", XKB_KEY_Sinh_ja }, + { "Sinh_jha", XKB_KEY_Sinh_jha }, + { "Sinh_jnya", XKB_KEY_Sinh_jnya }, + { "Sinh_ka", XKB_KEY_Sinh_ka }, + { "Sinh_kha", XKB_KEY_Sinh_kha }, + { "Sinh_kunddaliya", XKB_KEY_Sinh_kunddaliya }, + { "Sinh_la", XKB_KEY_Sinh_la }, + { "Sinh_lla", XKB_KEY_Sinh_lla }, + { "Sinh_lu", XKB_KEY_Sinh_lu }, + { "Sinh_lu2", XKB_KEY_Sinh_lu2 }, + { "Sinh_luu", XKB_KEY_Sinh_luu }, + { "Sinh_luu2", XKB_KEY_Sinh_luu2 }, + { "Sinh_ma", XKB_KEY_Sinh_ma }, + { "Sinh_mba", XKB_KEY_Sinh_mba }, + { "Sinh_na", XKB_KEY_Sinh_na }, + { "Sinh_ndda", XKB_KEY_Sinh_ndda }, + { "Sinh_ndha", XKB_KEY_Sinh_ndha }, + { "Sinh_ng", XKB_KEY_Sinh_ng }, + { "Sinh_ng2", XKB_KEY_Sinh_ng2 }, + { "Sinh_nga", XKB_KEY_Sinh_nga }, + { "Sinh_nja", XKB_KEY_Sinh_nja }, + { "Sinh_nna", XKB_KEY_Sinh_nna }, + { "Sinh_nya", XKB_KEY_Sinh_nya }, + { "Sinh_o", XKB_KEY_Sinh_o }, + { "Sinh_o2", XKB_KEY_Sinh_o2 }, + { "Sinh_oo", XKB_KEY_Sinh_oo }, + { "Sinh_oo2", XKB_KEY_Sinh_oo2 }, + { "Sinh_pa", XKB_KEY_Sinh_pa }, + { "Sinh_pha", XKB_KEY_Sinh_pha }, + { "Sinh_ra", XKB_KEY_Sinh_ra }, + { "Sinh_ri", XKB_KEY_Sinh_ri }, + { "Sinh_rii", XKB_KEY_Sinh_rii }, + { "Sinh_ru2", XKB_KEY_Sinh_ru2 }, + { "Sinh_ruu2", XKB_KEY_Sinh_ruu2 }, + { "Sinh_sa", XKB_KEY_Sinh_sa }, + { "Sinh_sha", XKB_KEY_Sinh_sha }, + { "Sinh_ssha", XKB_KEY_Sinh_ssha }, + { "Sinh_tha", XKB_KEY_Sinh_tha }, + { "Sinh_thha", XKB_KEY_Sinh_thha }, + { "Sinh_tta", XKB_KEY_Sinh_tta }, + { "Sinh_ttha", XKB_KEY_Sinh_ttha }, + { "Sinh_u", XKB_KEY_Sinh_u }, + { "Sinh_u2", XKB_KEY_Sinh_u2 }, + { "Sinh_uu", XKB_KEY_Sinh_uu }, + { "Sinh_uu2", XKB_KEY_Sinh_uu2 }, + { "Sinh_va", XKB_KEY_Sinh_va }, + { "Sinh_ya", XKB_KEY_Sinh_ya }, + { "sixsubscript", XKB_KEY_sixsubscript }, + { "sixsuperior", XKB_KEY_sixsuperior }, + { "slash", XKB_KEY_slash }, + { "SlowKeys_Enable", XKB_KEY_SlowKeys_Enable }, + { "soliddiamond", XKB_KEY_soliddiamond }, + { "space", XKB_KEY_space }, + { "squareroot", XKB_KEY_squareroot }, + { "ssharp", XKB_KEY_ssharp }, + { "sterling", XKB_KEY_sterling }, + { "StickyKeys_Enable", XKB_KEY_StickyKeys_Enable }, + { "stricteq", XKB_KEY_stricteq }, + { "SunAgain", XKB_KEY_SunAgain }, + { "SunAltGraph", XKB_KEY_SunAltGraph }, + { "SunAudioLowerVolume", XKB_KEY_SunAudioLowerVolume }, + { "SunAudioMute", XKB_KEY_SunAudioMute }, + { "SunAudioRaiseVolume", XKB_KEY_SunAudioRaiseVolume }, + { "SunCompose", XKB_KEY_SunCompose }, + { "SunCopy", XKB_KEY_SunCopy }, + { "SunCut", XKB_KEY_SunCut }, + { "SunF36", XKB_KEY_SunF36 }, + { "SunF37", XKB_KEY_SunF37 }, + { "SunFA_Acute", XKB_KEY_SunFA_Acute }, + { "SunFA_Cedilla", XKB_KEY_SunFA_Cedilla }, + { "SunFA_Circum", XKB_KEY_SunFA_Circum }, + { "SunFA_Diaeresis", XKB_KEY_SunFA_Diaeresis }, + { "SunFA_Grave", XKB_KEY_SunFA_Grave }, + { "SunFA_Tilde", XKB_KEY_SunFA_Tilde }, + { "SunFind", XKB_KEY_SunFind }, + { "SunFront", XKB_KEY_SunFront }, + { "SunOpen", XKB_KEY_SunOpen }, + { "SunPageDown", XKB_KEY_SunPageDown }, + { "SunPageUp", XKB_KEY_SunPageUp }, + { "SunPaste", XKB_KEY_SunPaste }, + { "SunPowerSwitch", XKB_KEY_SunPowerSwitch }, + { "SunPowerSwitchShift", XKB_KEY_SunPowerSwitchShift }, + { "SunPrint_Screen", XKB_KEY_SunPrint_Screen }, + { "SunProps", XKB_KEY_SunProps }, + { "SunStop", XKB_KEY_SunStop }, + { "SunSys_Req", XKB_KEY_SunSys_Req }, + { "SunUndo", XKB_KEY_SunUndo }, + { "SunVideoDegauss", XKB_KEY_SunVideoDegauss }, + { "SunVideoLowerBrightness", XKB_KEY_SunVideoLowerBrightness }, + { "SunVideoRaiseBrightness", XKB_KEY_SunVideoRaiseBrightness }, + { "Super_L", XKB_KEY_Super_L }, + { "Super_R", XKB_KEY_Super_R }, + { "Sys_Req", XKB_KEY_Sys_Req }, + { "System", XKB_KEY_System }, + { "T", XKB_KEY_T }, + { "t", XKB_KEY_t }, + { "Tab", XKB_KEY_Tab }, + { "Tabovedot", XKB_KEY_Tabovedot }, + { "tabovedot", XKB_KEY_tabovedot }, + { "Tcaron", XKB_KEY_Tcaron }, + { "tcaron", XKB_KEY_tcaron }, + { "Tcedilla", XKB_KEY_Tcedilla }, + { "tcedilla", XKB_KEY_tcedilla }, + { "telephone", XKB_KEY_telephone }, + { "telephonerecorder", XKB_KEY_telephonerecorder }, + { "Terminate_Server", XKB_KEY_Terminate_Server }, + { "Thai_baht", XKB_KEY_Thai_baht }, + { "Thai_bobaimai", XKB_KEY_Thai_bobaimai }, + { "Thai_chochan", XKB_KEY_Thai_chochan }, + { "Thai_chochang", XKB_KEY_Thai_chochang }, + { "Thai_choching", XKB_KEY_Thai_choching }, + { "Thai_chochoe", XKB_KEY_Thai_chochoe }, + { "Thai_dochada", XKB_KEY_Thai_dochada }, + { "Thai_dodek", XKB_KEY_Thai_dodek }, + { "Thai_fofa", XKB_KEY_Thai_fofa }, + { "Thai_fofan", XKB_KEY_Thai_fofan }, + { "Thai_hohip", XKB_KEY_Thai_hohip }, + { "Thai_honokhuk", XKB_KEY_Thai_honokhuk }, + { "Thai_khokhai", XKB_KEY_Thai_khokhai }, + { "Thai_khokhon", XKB_KEY_Thai_khokhon }, + { "Thai_khokhuat", XKB_KEY_Thai_khokhuat }, + { "Thai_khokhwai", XKB_KEY_Thai_khokhwai }, + { "Thai_khorakhang", XKB_KEY_Thai_khorakhang }, + { "Thai_kokai", XKB_KEY_Thai_kokai }, + { "Thai_lakkhangyao", XKB_KEY_Thai_lakkhangyao }, + { "Thai_lekchet", XKB_KEY_Thai_lekchet }, + { "Thai_lekha", XKB_KEY_Thai_lekha }, + { "Thai_lekhok", XKB_KEY_Thai_lekhok }, + { "Thai_lekkao", XKB_KEY_Thai_lekkao }, + { "Thai_leknung", XKB_KEY_Thai_leknung }, + { "Thai_lekpaet", XKB_KEY_Thai_lekpaet }, + { "Thai_leksam", XKB_KEY_Thai_leksam }, + { "Thai_leksi", XKB_KEY_Thai_leksi }, + { "Thai_leksong", XKB_KEY_Thai_leksong }, + { "Thai_leksun", XKB_KEY_Thai_leksun }, + { "Thai_lochula", XKB_KEY_Thai_lochula }, + { "Thai_loling", XKB_KEY_Thai_loling }, + { "Thai_lu", XKB_KEY_Thai_lu }, + { "Thai_maichattawa", XKB_KEY_Thai_maichattawa }, + { "Thai_maiek", XKB_KEY_Thai_maiek }, + { "Thai_maihanakat", XKB_KEY_Thai_maihanakat }, + { "Thai_maihanakat_maitho", XKB_KEY_Thai_maihanakat_maitho }, + { "Thai_maitaikhu", XKB_KEY_Thai_maitaikhu }, + { "Thai_maitho", XKB_KEY_Thai_maitho }, + { "Thai_maitri", XKB_KEY_Thai_maitri }, + { "Thai_maiyamok", XKB_KEY_Thai_maiyamok }, + { "Thai_moma", XKB_KEY_Thai_moma }, + { "Thai_ngongu", XKB_KEY_Thai_ngongu }, + { "Thai_nikhahit", XKB_KEY_Thai_nikhahit }, + { "Thai_nonen", XKB_KEY_Thai_nonen }, + { "Thai_nonu", XKB_KEY_Thai_nonu }, + { "Thai_oang", XKB_KEY_Thai_oang }, + { "Thai_paiyannoi", XKB_KEY_Thai_paiyannoi }, + { "Thai_phinthu", XKB_KEY_Thai_phinthu }, + { "Thai_phophan", XKB_KEY_Thai_phophan }, + { "Thai_phophung", XKB_KEY_Thai_phophung }, + { "Thai_phosamphao", XKB_KEY_Thai_phosamphao }, + { "Thai_popla", XKB_KEY_Thai_popla }, + { "Thai_rorua", XKB_KEY_Thai_rorua }, + { "Thai_ru", XKB_KEY_Thai_ru }, + { "Thai_saraa", XKB_KEY_Thai_saraa }, + { "Thai_saraaa", XKB_KEY_Thai_saraaa }, + { "Thai_saraae", XKB_KEY_Thai_saraae }, + { "Thai_saraaimaimalai", XKB_KEY_Thai_saraaimaimalai }, + { "Thai_saraaimaimuan", XKB_KEY_Thai_saraaimaimuan }, + { "Thai_saraam", XKB_KEY_Thai_saraam }, + { "Thai_sarae", XKB_KEY_Thai_sarae }, + { "Thai_sarai", XKB_KEY_Thai_sarai }, + { "Thai_saraii", XKB_KEY_Thai_saraii }, + { "Thai_sarao", XKB_KEY_Thai_sarao }, + { "Thai_sarau", XKB_KEY_Thai_sarau }, + { "Thai_saraue", XKB_KEY_Thai_saraue }, + { "Thai_sarauee", XKB_KEY_Thai_sarauee }, + { "Thai_sarauu", XKB_KEY_Thai_sarauu }, + { "Thai_sorusi", XKB_KEY_Thai_sorusi }, + { "Thai_sosala", XKB_KEY_Thai_sosala }, + { "Thai_soso", XKB_KEY_Thai_soso }, + { "Thai_sosua", XKB_KEY_Thai_sosua }, + { "Thai_thanthakhat", XKB_KEY_Thai_thanthakhat }, + { "Thai_thonangmontho", XKB_KEY_Thai_thonangmontho }, + { "Thai_thophuthao", XKB_KEY_Thai_thophuthao }, + { "Thai_thothahan", XKB_KEY_Thai_thothahan }, + { "Thai_thothan", XKB_KEY_Thai_thothan }, + { "Thai_thothong", XKB_KEY_Thai_thothong }, + { "Thai_thothung", XKB_KEY_Thai_thothung }, + { "Thai_topatak", XKB_KEY_Thai_topatak }, + { "Thai_totao", XKB_KEY_Thai_totao }, + { "Thai_wowaen", XKB_KEY_Thai_wowaen }, + { "Thai_yoyak", XKB_KEY_Thai_yoyak }, + { "Thai_yoying", XKB_KEY_Thai_yoying }, + { "therefore", XKB_KEY_therefore }, + { "thinspace", XKB_KEY_thinspace }, + { "THORN", XKB_KEY_THORN }, + { "Thorn", XKB_KEY_Thorn }, + { "thorn", XKB_KEY_thorn }, + { "threeeighths", XKB_KEY_threeeighths }, + { "threefifths", XKB_KEY_threefifths }, + { "threequarters", XKB_KEY_threequarters }, + { "threesubscript", XKB_KEY_threesubscript }, + { "threesuperior", XKB_KEY_threesuperior }, + { "tintegral", XKB_KEY_tintegral }, + { "topintegral", XKB_KEY_topintegral }, + { "topleftparens", XKB_KEY_topleftparens }, + { "topleftradical", XKB_KEY_topleftradical }, + { "topleftsqbracket", XKB_KEY_topleftsqbracket }, + { "topleftsummation", XKB_KEY_topleftsummation }, + { "toprightparens", XKB_KEY_toprightparens }, + { "toprightsqbracket", XKB_KEY_toprightsqbracket }, + { "toprightsummation", XKB_KEY_toprightsummation }, + { "topt", XKB_KEY_topt }, + { "topvertsummationconnector", XKB_KEY_topvertsummationconnector }, + { "Touroku", XKB_KEY_Touroku }, + { "trademark", XKB_KEY_trademark }, + { "trademarkincircle", XKB_KEY_trademarkincircle }, + { "Tslash", XKB_KEY_Tslash }, + { "tslash", XKB_KEY_tslash }, + { "twofifths", XKB_KEY_twofifths }, + { "twosubscript", XKB_KEY_twosubscript }, + { "twosuperior", XKB_KEY_twosuperior }, + { "twothirds", XKB_KEY_twothirds }, + { "U", XKB_KEY_U }, + { "u", XKB_KEY_u }, + { "Uacute", XKB_KEY_Uacute }, + { "uacute", XKB_KEY_uacute }, + { "Ubelowdot", XKB_KEY_Ubelowdot }, + { "ubelowdot", XKB_KEY_ubelowdot }, + { "Ubreve", XKB_KEY_Ubreve }, + { "ubreve", XKB_KEY_ubreve }, + { "Ucircumflex", XKB_KEY_Ucircumflex }, + { "ucircumflex", XKB_KEY_ucircumflex }, + { "Udiaeresis", XKB_KEY_Udiaeresis }, + { "udiaeresis", XKB_KEY_udiaeresis }, + { "Udoubleacute", XKB_KEY_Udoubleacute }, + { "udoubleacute", XKB_KEY_udoubleacute }, + { "Ugrave", XKB_KEY_Ugrave }, + { "ugrave", XKB_KEY_ugrave }, + { "Uhook", XKB_KEY_Uhook }, + { "uhook", XKB_KEY_uhook }, + { "Uhorn", XKB_KEY_Uhorn }, + { "uhorn", XKB_KEY_uhorn }, + { "Uhornacute", XKB_KEY_Uhornacute }, + { "uhornacute", XKB_KEY_uhornacute }, + { "Uhornbelowdot", XKB_KEY_Uhornbelowdot }, + { "uhornbelowdot", XKB_KEY_uhornbelowdot }, + { "Uhorngrave", XKB_KEY_Uhorngrave }, + { "uhorngrave", XKB_KEY_uhorngrave }, + { "Uhornhook", XKB_KEY_Uhornhook }, + { "uhornhook", XKB_KEY_uhornhook }, + { "Uhorntilde", XKB_KEY_Uhorntilde }, + { "uhorntilde", XKB_KEY_uhorntilde }, + { "Ukrainian_ghe_with_upturn", XKB_KEY_Ukrainian_ghe_with_upturn }, + { "Ukrainian_GHE_WITH_UPTURN", XKB_KEY_Ukrainian_GHE_WITH_UPTURN }, + { "Ukrainian_i", XKB_KEY_Ukrainian_i }, + { "Ukrainian_I", XKB_KEY_Ukrainian_I }, + { "Ukrainian_ie", XKB_KEY_Ukrainian_ie }, + { "Ukrainian_IE", XKB_KEY_Ukrainian_IE }, + { "Ukrainian_yi", XKB_KEY_Ukrainian_yi }, + { "Ukrainian_YI", XKB_KEY_Ukrainian_YI }, + { "Ukranian_i", XKB_KEY_Ukranian_i }, + { "Ukranian_I", XKB_KEY_Ukranian_I }, + { "Ukranian_je", XKB_KEY_Ukranian_je }, + { "Ukranian_JE", XKB_KEY_Ukranian_JE }, + { "Ukranian_yi", XKB_KEY_Ukranian_yi }, + { "Ukranian_YI", XKB_KEY_Ukranian_YI }, + { "Umacron", XKB_KEY_Umacron }, + { "umacron", XKB_KEY_umacron }, + { "underbar", XKB_KEY_underbar }, + { "underscore", XKB_KEY_underscore }, + { "Undo", XKB_KEY_Undo }, + { "union", XKB_KEY_union }, + { "Uogonek", XKB_KEY_Uogonek }, + { "uogonek", XKB_KEY_uogonek }, + { "Up", XKB_KEY_Up }, + { "uparrow", XKB_KEY_uparrow }, + { "upcaret", XKB_KEY_upcaret }, + { "upleftcorner", XKB_KEY_upleftcorner }, + { "uprightcorner", XKB_KEY_uprightcorner }, + { "upshoe", XKB_KEY_upshoe }, + { "upstile", XKB_KEY_upstile }, + { "uptack", XKB_KEY_uptack }, + { "Uring", XKB_KEY_Uring }, + { "uring", XKB_KEY_uring }, + { "User", XKB_KEY_User }, + { "Utilde", XKB_KEY_Utilde }, + { "utilde", XKB_KEY_utilde }, + { "V", XKB_KEY_V }, + { "v", XKB_KEY_v }, + { "variation", XKB_KEY_variation }, + { "vertbar", XKB_KEY_vertbar }, + { "vertconnector", XKB_KEY_vertconnector }, + { "voicedsound", XKB_KEY_voicedsound }, + { "VoidSymbol", XKB_KEY_VoidSymbol }, + { "vt", XKB_KEY_vt }, + { "W", XKB_KEY_W }, + { "w", XKB_KEY_w }, + { "Wacute", XKB_KEY_Wacute }, + { "wacute", XKB_KEY_wacute }, + { "Wcircumflex", XKB_KEY_Wcircumflex }, + { "wcircumflex", XKB_KEY_wcircumflex }, + { "Wdiaeresis", XKB_KEY_Wdiaeresis }, + { "wdiaeresis", XKB_KEY_wdiaeresis }, + { "Wgrave", XKB_KEY_Wgrave }, + { "wgrave", XKB_KEY_wgrave }, + { "WonSign", XKB_KEY_WonSign }, + { "X", XKB_KEY_X }, + { "x", XKB_KEY_x }, + { "Xabovedot", XKB_KEY_Xabovedot }, + { "xabovedot", XKB_KEY_xabovedot }, + { "XF86AddFavorite", XKB_KEY_XF86AddFavorite }, + { "XF86ApplicationLeft", XKB_KEY_XF86ApplicationLeft }, + { "XF86ApplicationRight", XKB_KEY_XF86ApplicationRight }, + { "XF86AudioCycleTrack", XKB_KEY_XF86AudioCycleTrack }, + { "XF86AudioForward", XKB_KEY_XF86AudioForward }, + { "XF86AudioLowerVolume", XKB_KEY_XF86AudioLowerVolume }, + { "XF86AudioMedia", XKB_KEY_XF86AudioMedia }, + { "XF86AudioMute", XKB_KEY_XF86AudioMute }, + { "XF86AudioNext", XKB_KEY_XF86AudioNext }, + { "XF86AudioPause", XKB_KEY_XF86AudioPause }, + { "XF86AudioPlay", XKB_KEY_XF86AudioPlay }, + { "XF86AudioPrev", XKB_KEY_XF86AudioPrev }, + { "XF86AudioRaiseVolume", XKB_KEY_XF86AudioRaiseVolume }, + { "XF86AudioRandomPlay", XKB_KEY_XF86AudioRandomPlay }, + { "XF86AudioRecord", XKB_KEY_XF86AudioRecord }, + { "XF86AudioRepeat", XKB_KEY_XF86AudioRepeat }, + { "XF86AudioRewind", XKB_KEY_XF86AudioRewind }, + { "XF86AudioStop", XKB_KEY_XF86AudioStop }, + { "XF86Away", XKB_KEY_XF86Away }, + { "XF86Back", XKB_KEY_XF86Back }, + { "XF86BackForward", XKB_KEY_XF86BackForward }, + { "XF86Battery", XKB_KEY_XF86Battery }, + { "XF86Blue", XKB_KEY_XF86Blue }, + { "XF86Bluetooth", XKB_KEY_XF86Bluetooth }, + { "XF86Book", XKB_KEY_XF86Book }, + { "XF86BrightnessAdjust", XKB_KEY_XF86BrightnessAdjust }, + { "XF86Calculater", XKB_KEY_XF86Calculater }, + { "XF86Calculator", XKB_KEY_XF86Calculator }, + { "XF86Calendar", XKB_KEY_XF86Calendar }, + { "XF86CD", XKB_KEY_XF86CD }, + { "XF86Clear", XKB_KEY_XF86Clear }, + { "XF86ClearGrab", XKB_KEY_XF86ClearGrab }, + { "XF86Close", XKB_KEY_XF86Close }, + { "XF86Community", XKB_KEY_XF86Community }, + { "XF86ContrastAdjust", XKB_KEY_XF86ContrastAdjust }, + { "XF86Copy", XKB_KEY_XF86Copy }, + { "XF86Cut", XKB_KEY_XF86Cut }, + { "XF86CycleAngle", XKB_KEY_XF86CycleAngle }, + { "XF86Display", XKB_KEY_XF86Display }, + { "XF86Documents", XKB_KEY_XF86Documents }, + { "XF86DOS", XKB_KEY_XF86DOS }, + { "XF86Eject", XKB_KEY_XF86Eject }, + { "XF86Excel", XKB_KEY_XF86Excel }, + { "XF86Explorer", XKB_KEY_XF86Explorer }, + { "XF86Favorites", XKB_KEY_XF86Favorites }, + { "XF86Finance", XKB_KEY_XF86Finance }, + { "XF86Forward", XKB_KEY_XF86Forward }, + { "XF86FrameBack", XKB_KEY_XF86FrameBack }, + { "XF86FrameForward", XKB_KEY_XF86FrameForward }, + { "XF86Game", XKB_KEY_XF86Game }, + { "XF86Go", XKB_KEY_XF86Go }, + { "XF86Green", XKB_KEY_XF86Green }, + { "XF86Hibernate", XKB_KEY_XF86Hibernate }, + { "XF86History", XKB_KEY_XF86History }, + { "XF86HomePage", XKB_KEY_XF86HomePage }, + { "XF86HotLinks", XKB_KEY_XF86HotLinks }, + { "XF86iTouch", XKB_KEY_XF86iTouch }, + { "XF86KbdBrightnessDown", XKB_KEY_XF86KbdBrightnessDown }, + { "XF86KbdBrightnessUp", XKB_KEY_XF86KbdBrightnessUp }, + { "XF86KbdLightOnOff", XKB_KEY_XF86KbdLightOnOff }, + { "XF86Launch0", XKB_KEY_XF86Launch0 }, + { "XF86Launch1", XKB_KEY_XF86Launch1 }, + { "XF86Launch2", XKB_KEY_XF86Launch2 }, + { "XF86Launch3", XKB_KEY_XF86Launch3 }, + { "XF86Launch4", XKB_KEY_XF86Launch4 }, + { "XF86Launch5", XKB_KEY_XF86Launch5 }, + { "XF86Launch6", XKB_KEY_XF86Launch6 }, + { "XF86Launch7", XKB_KEY_XF86Launch7 }, + { "XF86Launch8", XKB_KEY_XF86Launch8 }, + { "XF86Launch9", XKB_KEY_XF86Launch9 }, + { "XF86LaunchA", XKB_KEY_XF86LaunchA }, + { "XF86LaunchB", XKB_KEY_XF86LaunchB }, + { "XF86LaunchC", XKB_KEY_XF86LaunchC }, + { "XF86LaunchD", XKB_KEY_XF86LaunchD }, + { "XF86LaunchE", XKB_KEY_XF86LaunchE }, + { "XF86LaunchF", XKB_KEY_XF86LaunchF }, + { "XF86LightBulb", XKB_KEY_XF86LightBulb }, + { "XF86LogGrabInfo", XKB_KEY_XF86LogGrabInfo }, + { "XF86LogOff", XKB_KEY_XF86LogOff }, + { "XF86LogWindowTree", XKB_KEY_XF86LogWindowTree }, + { "XF86Mail", XKB_KEY_XF86Mail }, + { "XF86MailForward", XKB_KEY_XF86MailForward }, + { "XF86Market", XKB_KEY_XF86Market }, + { "XF86Meeting", XKB_KEY_XF86Meeting }, + { "XF86Memo", XKB_KEY_XF86Memo }, + { "XF86MenuKB", XKB_KEY_XF86MenuKB }, + { "XF86MenuPB", XKB_KEY_XF86MenuPB }, + { "XF86Messenger", XKB_KEY_XF86Messenger }, + { "XF86ModeLock", XKB_KEY_XF86ModeLock }, + { "XF86MonBrightnessDown", XKB_KEY_XF86MonBrightnessDown }, + { "XF86MonBrightnessUp", XKB_KEY_XF86MonBrightnessUp }, + { "XF86Music", XKB_KEY_XF86Music }, + { "XF86MyComputer", XKB_KEY_XF86MyComputer }, + { "XF86MySites", XKB_KEY_XF86MySites }, + { "XF86New", XKB_KEY_XF86New }, + { "XF86News", XKB_KEY_XF86News }, + { "XF86Next_VMode", XKB_KEY_XF86Next_VMode }, + { "XF86OfficeHome", XKB_KEY_XF86OfficeHome }, + { "XF86Open", XKB_KEY_XF86Open }, + { "XF86OpenURL", XKB_KEY_XF86OpenURL }, + { "XF86Option", XKB_KEY_XF86Option }, + { "XF86Paste", XKB_KEY_XF86Paste }, + { "XF86Phone", XKB_KEY_XF86Phone }, + { "XF86Pictures", XKB_KEY_XF86Pictures }, + { "XF86PowerDown", XKB_KEY_XF86PowerDown }, + { "XF86PowerOff", XKB_KEY_XF86PowerOff }, + { "XF86Prev_VMode", XKB_KEY_XF86Prev_VMode }, + { "XF86Q", XKB_KEY_XF86Q }, + { "XF86Red", XKB_KEY_XF86Red }, + { "XF86Refresh", XKB_KEY_XF86Refresh }, + { "XF86Reload", XKB_KEY_XF86Reload }, + { "XF86Reply", XKB_KEY_XF86Reply }, + { "XF86RockerDown", XKB_KEY_XF86RockerDown }, + { "XF86RockerEnter", XKB_KEY_XF86RockerEnter }, + { "XF86RockerUp", XKB_KEY_XF86RockerUp }, + { "XF86RotateWindows", XKB_KEY_XF86RotateWindows }, + { "XF86RotationKB", XKB_KEY_XF86RotationKB }, + { "XF86RotationPB", XKB_KEY_XF86RotationPB }, + { "XF86Save", XKB_KEY_XF86Save }, + { "XF86ScreenSaver", XKB_KEY_XF86ScreenSaver }, + { "XF86ScrollClick", XKB_KEY_XF86ScrollClick }, + { "XF86ScrollDown", XKB_KEY_XF86ScrollDown }, + { "XF86ScrollUp", XKB_KEY_XF86ScrollUp }, + { "XF86Search", XKB_KEY_XF86Search }, + { "XF86Select", XKB_KEY_XF86Select }, + { "XF86Send", XKB_KEY_XF86Send }, + { "XF86Shop", XKB_KEY_XF86Shop }, + { "XF86Sleep", XKB_KEY_XF86Sleep }, + { "XF86Spell", XKB_KEY_XF86Spell }, + { "XF86SplitScreen", XKB_KEY_XF86SplitScreen }, + { "XF86Standby", XKB_KEY_XF86Standby }, + { "XF86Start", XKB_KEY_XF86Start }, + { "XF86Stop", XKB_KEY_XF86Stop }, + { "XF86Subtitle", XKB_KEY_XF86Subtitle }, + { "XF86Support", XKB_KEY_XF86Support }, + { "XF86Suspend", XKB_KEY_XF86Suspend }, + { "XF86Switch_VT_1", XKB_KEY_XF86Switch_VT_1 }, + { "XF86Switch_VT_10", XKB_KEY_XF86Switch_VT_10 }, + { "XF86Switch_VT_11", XKB_KEY_XF86Switch_VT_11 }, + { "XF86Switch_VT_12", XKB_KEY_XF86Switch_VT_12 }, + { "XF86Switch_VT_2", XKB_KEY_XF86Switch_VT_2 }, + { "XF86Switch_VT_3", XKB_KEY_XF86Switch_VT_3 }, + { "XF86Switch_VT_4", XKB_KEY_XF86Switch_VT_4 }, + { "XF86Switch_VT_5", XKB_KEY_XF86Switch_VT_5 }, + { "XF86Switch_VT_6", XKB_KEY_XF86Switch_VT_6 }, + { "XF86Switch_VT_7", XKB_KEY_XF86Switch_VT_7 }, + { "XF86Switch_VT_8", XKB_KEY_XF86Switch_VT_8 }, + { "XF86Switch_VT_9", XKB_KEY_XF86Switch_VT_9 }, + { "XF86TaskPane", XKB_KEY_XF86TaskPane }, + { "XF86Terminal", XKB_KEY_XF86Terminal }, + { "XF86Time", XKB_KEY_XF86Time }, + { "XF86ToDoList", XKB_KEY_XF86ToDoList }, + { "XF86Tools", XKB_KEY_XF86Tools }, + { "XF86TopMenu", XKB_KEY_XF86TopMenu }, + { "XF86TouchpadOff", XKB_KEY_XF86TouchpadOff }, + { "XF86TouchpadOn", XKB_KEY_XF86TouchpadOn }, + { "XF86TouchpadToggle", XKB_KEY_XF86TouchpadToggle }, + { "XF86Travel", XKB_KEY_XF86Travel }, + { "XF86Ungrab", XKB_KEY_XF86Ungrab }, + { "XF86User1KB", XKB_KEY_XF86User1KB }, + { "XF86User2KB", XKB_KEY_XF86User2KB }, + { "XF86UserPB", XKB_KEY_XF86UserPB }, + { "XF86UWB", XKB_KEY_XF86UWB }, + { "XF86VendorHome", XKB_KEY_XF86VendorHome }, + { "XF86Video", XKB_KEY_XF86Video }, + { "XF86View", XKB_KEY_XF86View }, + { "XF86WakeUp", XKB_KEY_XF86WakeUp }, + { "XF86WebCam", XKB_KEY_XF86WebCam }, + { "XF86WheelButton", XKB_KEY_XF86WheelButton }, + { "XF86WLAN", XKB_KEY_XF86WLAN }, + { "XF86Word", XKB_KEY_XF86Word }, + { "XF86WWW", XKB_KEY_XF86WWW }, + { "XF86Xfer", XKB_KEY_XF86Xfer }, + { "XF86Yellow", XKB_KEY_XF86Yellow }, + { "XF86ZoomIn", XKB_KEY_XF86ZoomIn }, + { "XF86ZoomOut", XKB_KEY_XF86ZoomOut }, + { "Y", XKB_KEY_Y }, + { "y", XKB_KEY_y }, + { "Yacute", XKB_KEY_Yacute }, + { "yacute", XKB_KEY_yacute }, + { "Ybelowdot", XKB_KEY_Ybelowdot }, + { "ybelowdot", XKB_KEY_ybelowdot }, + { "Ycircumflex", XKB_KEY_Ycircumflex }, + { "ycircumflex", XKB_KEY_ycircumflex }, + { "ydiaeresis", XKB_KEY_ydiaeresis }, + { "Ydiaeresis", XKB_KEY_Ydiaeresis }, + { "yen", XKB_KEY_yen }, + { "Ygrave", XKB_KEY_Ygrave }, + { "ygrave", XKB_KEY_ygrave }, + { "Yhook", XKB_KEY_Yhook }, + { "yhook", XKB_KEY_yhook }, + { "Ytilde", XKB_KEY_Ytilde }, + { "ytilde", XKB_KEY_ytilde }, + { "Z", XKB_KEY_Z }, + { "z", XKB_KEY_z }, + { "Zabovedot", XKB_KEY_Zabovedot }, + { "zabovedot", XKB_KEY_zabovedot }, + { "Zacute", XKB_KEY_Zacute }, + { "zacute", XKB_KEY_zacute }, + { "Zcaron", XKB_KEY_Zcaron }, + { "zcaron", XKB_KEY_zcaron }, + { "Zen_Koho", XKB_KEY_Zen_Koho }, + { "Zenkaku", XKB_KEY_Zenkaku }, + { "Zenkaku_Hankaku", XKB_KEY_Zenkaku_Hankaku }, + { "zerosubscript", XKB_KEY_zerosubscript }, + { "zerosuperior", XKB_KEY_zerosuperior }, + { "Zstroke", XKB_KEY_Zstroke }, + { "zstroke", XKB_KEY_zstroke }, +}; + +static const struct name_keysym keysym_to_name[] = { + { "NoSymbol", XKB_KEY_NoSymbol }, + { "space", XKB_KEY_space }, + { "exclam", XKB_KEY_exclam }, + { "quotedbl", XKB_KEY_quotedbl }, + { "numbersign", XKB_KEY_numbersign }, + { "dollar", XKB_KEY_dollar }, + { "percent", XKB_KEY_percent }, + { "ampersand", XKB_KEY_ampersand }, + { "apostrophe", XKB_KEY_apostrophe }, + { "parenleft", XKB_KEY_parenleft }, + { "parenright", XKB_KEY_parenright }, + { "asterisk", XKB_KEY_asterisk }, + { "plus", XKB_KEY_plus }, + { "comma", XKB_KEY_comma }, + { "minus", XKB_KEY_minus }, + { "period", XKB_KEY_period }, + { "slash", XKB_KEY_slash }, + { "0", XKB_KEY_0 }, + { "1", XKB_KEY_1 }, + { "2", XKB_KEY_2 }, + { "3", XKB_KEY_3 }, + { "4", XKB_KEY_4 }, + { "5", XKB_KEY_5 }, + { "6", XKB_KEY_6 }, + { "7", XKB_KEY_7 }, + { "8", XKB_KEY_8 }, + { "9", XKB_KEY_9 }, + { "colon", XKB_KEY_colon }, + { "semicolon", XKB_KEY_semicolon }, + { "less", XKB_KEY_less }, + { "equal", XKB_KEY_equal }, + { "greater", XKB_KEY_greater }, + { "question", XKB_KEY_question }, + { "at", XKB_KEY_at }, + { "A", XKB_KEY_A }, + { "B", XKB_KEY_B }, + { "C", XKB_KEY_C }, + { "D", XKB_KEY_D }, + { "E", XKB_KEY_E }, + { "F", XKB_KEY_F }, + { "G", XKB_KEY_G }, + { "H", XKB_KEY_H }, + { "I", XKB_KEY_I }, + { "J", XKB_KEY_J }, + { "K", XKB_KEY_K }, + { "L", XKB_KEY_L }, + { "M", XKB_KEY_M }, + { "N", XKB_KEY_N }, + { "O", XKB_KEY_O }, + { "P", XKB_KEY_P }, + { "Q", XKB_KEY_Q }, + { "R", XKB_KEY_R }, + { "S", XKB_KEY_S }, + { "T", XKB_KEY_T }, + { "U", XKB_KEY_U }, + { "V", XKB_KEY_V }, + { "W", XKB_KEY_W }, + { "X", XKB_KEY_X }, + { "Y", XKB_KEY_Y }, + { "Z", XKB_KEY_Z }, + { "bracketleft", XKB_KEY_bracketleft }, + { "backslash", XKB_KEY_backslash }, + { "bracketright", XKB_KEY_bracketright }, + { "asciicircum", XKB_KEY_asciicircum }, + { "underscore", XKB_KEY_underscore }, + { "grave", XKB_KEY_grave }, + { "a", XKB_KEY_a }, + { "b", XKB_KEY_b }, + { "c", XKB_KEY_c }, + { "d", XKB_KEY_d }, + { "e", XKB_KEY_e }, + { "f", XKB_KEY_f }, + { "g", XKB_KEY_g }, + { "h", XKB_KEY_h }, + { "i", XKB_KEY_i }, + { "j", XKB_KEY_j }, + { "k", XKB_KEY_k }, + { "l", XKB_KEY_l }, + { "m", XKB_KEY_m }, + { "n", XKB_KEY_n }, + { "o", XKB_KEY_o }, + { "p", XKB_KEY_p }, + { "q", XKB_KEY_q }, + { "r", XKB_KEY_r }, + { "s", XKB_KEY_s }, + { "t", XKB_KEY_t }, + { "u", XKB_KEY_u }, + { "v", XKB_KEY_v }, + { "w", XKB_KEY_w }, + { "x", XKB_KEY_x }, + { "y", XKB_KEY_y }, + { "z", XKB_KEY_z }, + { "braceleft", XKB_KEY_braceleft }, + { "bar", XKB_KEY_bar }, + { "braceright", XKB_KEY_braceright }, + { "asciitilde", XKB_KEY_asciitilde }, + { "nobreakspace", XKB_KEY_nobreakspace }, + { "exclamdown", XKB_KEY_exclamdown }, + { "cent", XKB_KEY_cent }, + { "sterling", XKB_KEY_sterling }, + { "currency", XKB_KEY_currency }, + { "yen", XKB_KEY_yen }, + { "brokenbar", XKB_KEY_brokenbar }, + { "section", XKB_KEY_section }, + { "diaeresis", XKB_KEY_diaeresis }, + { "copyright", XKB_KEY_copyright }, + { "ordfeminine", XKB_KEY_ordfeminine }, + { "guillemotleft", XKB_KEY_guillemotleft }, + { "notsign", XKB_KEY_notsign }, + { "hyphen", XKB_KEY_hyphen }, + { "registered", XKB_KEY_registered }, + { "macron", XKB_KEY_macron }, + { "degree", XKB_KEY_degree }, + { "plusminus", XKB_KEY_plusminus }, + { "twosuperior", XKB_KEY_twosuperior }, + { "threesuperior", XKB_KEY_threesuperior }, + { "acute", XKB_KEY_acute }, + { "mu", XKB_KEY_mu }, + { "paragraph", XKB_KEY_paragraph }, + { "periodcentered", XKB_KEY_periodcentered }, + { "cedilla", XKB_KEY_cedilla }, + { "onesuperior", XKB_KEY_onesuperior }, + { "masculine", XKB_KEY_masculine }, + { "guillemotright", XKB_KEY_guillemotright }, + { "onequarter", XKB_KEY_onequarter }, + { "onehalf", XKB_KEY_onehalf }, + { "threequarters", XKB_KEY_threequarters }, + { "questiondown", XKB_KEY_questiondown }, + { "Agrave", XKB_KEY_Agrave }, + { "Aacute", XKB_KEY_Aacute }, + { "Acircumflex", XKB_KEY_Acircumflex }, + { "Atilde", XKB_KEY_Atilde }, + { "Adiaeresis", XKB_KEY_Adiaeresis }, + { "Aring", XKB_KEY_Aring }, + { "AE", XKB_KEY_AE }, + { "Ccedilla", XKB_KEY_Ccedilla }, + { "Egrave", XKB_KEY_Egrave }, + { "Eacute", XKB_KEY_Eacute }, + { "Ecircumflex", XKB_KEY_Ecircumflex }, + { "Ediaeresis", XKB_KEY_Ediaeresis }, + { "Igrave", XKB_KEY_Igrave }, + { "Iacute", XKB_KEY_Iacute }, + { "Icircumflex", XKB_KEY_Icircumflex }, + { "Idiaeresis", XKB_KEY_Idiaeresis }, + { "ETH", XKB_KEY_ETH }, + { "Ntilde", XKB_KEY_Ntilde }, + { "Ograve", XKB_KEY_Ograve }, + { "Oacute", XKB_KEY_Oacute }, + { "Ocircumflex", XKB_KEY_Ocircumflex }, + { "Otilde", XKB_KEY_Otilde }, + { "Odiaeresis", XKB_KEY_Odiaeresis }, + { "multiply", XKB_KEY_multiply }, + { "Oslash", XKB_KEY_Oslash }, + { "Ugrave", XKB_KEY_Ugrave }, + { "Uacute", XKB_KEY_Uacute }, + { "Ucircumflex", XKB_KEY_Ucircumflex }, + { "Udiaeresis", XKB_KEY_Udiaeresis }, + { "Yacute", XKB_KEY_Yacute }, + { "THORN", XKB_KEY_THORN }, + { "ssharp", XKB_KEY_ssharp }, + { "agrave", XKB_KEY_agrave }, + { "aacute", XKB_KEY_aacute }, + { "acircumflex", XKB_KEY_acircumflex }, + { "atilde", XKB_KEY_atilde }, + { "adiaeresis", XKB_KEY_adiaeresis }, + { "aring", XKB_KEY_aring }, + { "ae", XKB_KEY_ae }, + { "ccedilla", XKB_KEY_ccedilla }, + { "egrave", XKB_KEY_egrave }, + { "eacute", XKB_KEY_eacute }, + { "ecircumflex", XKB_KEY_ecircumflex }, + { "ediaeresis", XKB_KEY_ediaeresis }, + { "igrave", XKB_KEY_igrave }, + { "iacute", XKB_KEY_iacute }, + { "icircumflex", XKB_KEY_icircumflex }, + { "idiaeresis", XKB_KEY_idiaeresis }, + { "eth", XKB_KEY_eth }, + { "ntilde", XKB_KEY_ntilde }, + { "ograve", XKB_KEY_ograve }, + { "oacute", XKB_KEY_oacute }, + { "ocircumflex", XKB_KEY_ocircumflex }, + { "otilde", XKB_KEY_otilde }, + { "odiaeresis", XKB_KEY_odiaeresis }, + { "division", XKB_KEY_division }, + { "oslash", XKB_KEY_oslash }, + { "ugrave", XKB_KEY_ugrave }, + { "uacute", XKB_KEY_uacute }, + { "ucircumflex", XKB_KEY_ucircumflex }, + { "udiaeresis", XKB_KEY_udiaeresis }, + { "yacute", XKB_KEY_yacute }, + { "thorn", XKB_KEY_thorn }, + { "ydiaeresis", XKB_KEY_ydiaeresis }, + { "Aogonek", XKB_KEY_Aogonek }, + { "breve", XKB_KEY_breve }, + { "Lstroke", XKB_KEY_Lstroke }, + { "Lcaron", XKB_KEY_Lcaron }, + { "Sacute", XKB_KEY_Sacute }, + { "Scaron", XKB_KEY_Scaron }, + { "Scedilla", XKB_KEY_Scedilla }, + { "Tcaron", XKB_KEY_Tcaron }, + { "Zacute", XKB_KEY_Zacute }, + { "Zcaron", XKB_KEY_Zcaron }, + { "Zabovedot", XKB_KEY_Zabovedot }, + { "aogonek", XKB_KEY_aogonek }, + { "ogonek", XKB_KEY_ogonek }, + { "lstroke", XKB_KEY_lstroke }, + { "lcaron", XKB_KEY_lcaron }, + { "sacute", XKB_KEY_sacute }, + { "caron", XKB_KEY_caron }, + { "scaron", XKB_KEY_scaron }, + { "scedilla", XKB_KEY_scedilla }, + { "tcaron", XKB_KEY_tcaron }, + { "zacute", XKB_KEY_zacute }, + { "doubleacute", XKB_KEY_doubleacute }, + { "zcaron", XKB_KEY_zcaron }, + { "zabovedot", XKB_KEY_zabovedot }, + { "Racute", XKB_KEY_Racute }, + { "Abreve", XKB_KEY_Abreve }, + { "Lacute", XKB_KEY_Lacute }, + { "Cacute", XKB_KEY_Cacute }, + { "Ccaron", XKB_KEY_Ccaron }, + { "Eogonek", XKB_KEY_Eogonek }, + { "Ecaron", XKB_KEY_Ecaron }, + { "Dcaron", XKB_KEY_Dcaron }, + { "Dstroke", XKB_KEY_Dstroke }, + { "Nacute", XKB_KEY_Nacute }, + { "Ncaron", XKB_KEY_Ncaron }, + { "Odoubleacute", XKB_KEY_Odoubleacute }, + { "Rcaron", XKB_KEY_Rcaron }, + { "Uring", XKB_KEY_Uring }, + { "Udoubleacute", XKB_KEY_Udoubleacute }, + { "Tcedilla", XKB_KEY_Tcedilla }, + { "racute", XKB_KEY_racute }, + { "abreve", XKB_KEY_abreve }, + { "lacute", XKB_KEY_lacute }, + { "cacute", XKB_KEY_cacute }, + { "ccaron", XKB_KEY_ccaron }, + { "eogonek", XKB_KEY_eogonek }, + { "ecaron", XKB_KEY_ecaron }, + { "dcaron", XKB_KEY_dcaron }, + { "dstroke", XKB_KEY_dstroke }, + { "nacute", XKB_KEY_nacute }, + { "ncaron", XKB_KEY_ncaron }, + { "odoubleacute", XKB_KEY_odoubleacute }, + { "rcaron", XKB_KEY_rcaron }, + { "uring", XKB_KEY_uring }, + { "udoubleacute", XKB_KEY_udoubleacute }, + { "tcedilla", XKB_KEY_tcedilla }, + { "abovedot", XKB_KEY_abovedot }, + { "Hstroke", XKB_KEY_Hstroke }, + { "Hcircumflex", XKB_KEY_Hcircumflex }, + { "Iabovedot", XKB_KEY_Iabovedot }, + { "Gbreve", XKB_KEY_Gbreve }, + { "Jcircumflex", XKB_KEY_Jcircumflex }, + { "hstroke", XKB_KEY_hstroke }, + { "hcircumflex", XKB_KEY_hcircumflex }, + { "idotless", XKB_KEY_idotless }, + { "gbreve", XKB_KEY_gbreve }, + { "jcircumflex", XKB_KEY_jcircumflex }, + { "Cabovedot", XKB_KEY_Cabovedot }, + { "Ccircumflex", XKB_KEY_Ccircumflex }, + { "Gabovedot", XKB_KEY_Gabovedot }, + { "Gcircumflex", XKB_KEY_Gcircumflex }, + { "Ubreve", XKB_KEY_Ubreve }, + { "Scircumflex", XKB_KEY_Scircumflex }, + { "cabovedot", XKB_KEY_cabovedot }, + { "ccircumflex", XKB_KEY_ccircumflex }, + { "gabovedot", XKB_KEY_gabovedot }, + { "gcircumflex", XKB_KEY_gcircumflex }, + { "ubreve", XKB_KEY_ubreve }, + { "scircumflex", XKB_KEY_scircumflex }, + { "kra", XKB_KEY_kra }, + { "Rcedilla", XKB_KEY_Rcedilla }, + { "Itilde", XKB_KEY_Itilde }, + { "Lcedilla", XKB_KEY_Lcedilla }, + { "Emacron", XKB_KEY_Emacron }, + { "Gcedilla", XKB_KEY_Gcedilla }, + { "Tslash", XKB_KEY_Tslash }, + { "rcedilla", XKB_KEY_rcedilla }, + { "itilde", XKB_KEY_itilde }, + { "lcedilla", XKB_KEY_lcedilla }, + { "emacron", XKB_KEY_emacron }, + { "gcedilla", XKB_KEY_gcedilla }, + { "tslash", XKB_KEY_tslash }, + { "ENG", XKB_KEY_ENG }, + { "eng", XKB_KEY_eng }, + { "Amacron", XKB_KEY_Amacron }, + { "Iogonek", XKB_KEY_Iogonek }, + { "Eabovedot", XKB_KEY_Eabovedot }, + { "Imacron", XKB_KEY_Imacron }, + { "Ncedilla", XKB_KEY_Ncedilla }, + { "Omacron", XKB_KEY_Omacron }, + { "Kcedilla", XKB_KEY_Kcedilla }, + { "Uogonek", XKB_KEY_Uogonek }, + { "Utilde", XKB_KEY_Utilde }, + { "Umacron", XKB_KEY_Umacron }, + { "amacron", XKB_KEY_amacron }, + { "iogonek", XKB_KEY_iogonek }, + { "eabovedot", XKB_KEY_eabovedot }, + { "imacron", XKB_KEY_imacron }, + { "ncedilla", XKB_KEY_ncedilla }, + { "omacron", XKB_KEY_omacron }, + { "kcedilla", XKB_KEY_kcedilla }, + { "uogonek", XKB_KEY_uogonek }, + { "utilde", XKB_KEY_utilde }, + { "umacron", XKB_KEY_umacron }, + { "overline", XKB_KEY_overline }, + { "kana_fullstop", XKB_KEY_kana_fullstop }, + { "kana_openingbracket", XKB_KEY_kana_openingbracket }, + { "kana_closingbracket", XKB_KEY_kana_closingbracket }, + { "kana_comma", XKB_KEY_kana_comma }, + { "kana_conjunctive", XKB_KEY_kana_conjunctive }, + { "kana_WO", XKB_KEY_kana_WO }, + { "kana_a", XKB_KEY_kana_a }, + { "kana_i", XKB_KEY_kana_i }, + { "kana_u", XKB_KEY_kana_u }, + { "kana_e", XKB_KEY_kana_e }, + { "kana_o", XKB_KEY_kana_o }, + { "kana_ya", XKB_KEY_kana_ya }, + { "kana_yu", XKB_KEY_kana_yu }, + { "kana_yo", XKB_KEY_kana_yo }, + { "kana_tsu", XKB_KEY_kana_tsu }, + { "prolongedsound", XKB_KEY_prolongedsound }, + { "kana_A", XKB_KEY_kana_A }, + { "kana_I", XKB_KEY_kana_I }, + { "kana_U", XKB_KEY_kana_U }, + { "kana_E", XKB_KEY_kana_E }, + { "kana_O", XKB_KEY_kana_O }, + { "kana_KA", XKB_KEY_kana_KA }, + { "kana_KI", XKB_KEY_kana_KI }, + { "kana_KU", XKB_KEY_kana_KU }, + { "kana_KE", XKB_KEY_kana_KE }, + { "kana_KO", XKB_KEY_kana_KO }, + { "kana_SA", XKB_KEY_kana_SA }, + { "kana_SHI", XKB_KEY_kana_SHI }, + { "kana_SU", XKB_KEY_kana_SU }, + { "kana_SE", XKB_KEY_kana_SE }, + { "kana_SO", XKB_KEY_kana_SO }, + { "kana_TA", XKB_KEY_kana_TA }, + { "kana_CHI", XKB_KEY_kana_CHI }, + { "kana_TSU", XKB_KEY_kana_TSU }, + { "kana_TE", XKB_KEY_kana_TE }, + { "kana_TO", XKB_KEY_kana_TO }, + { "kana_NA", XKB_KEY_kana_NA }, + { "kana_NI", XKB_KEY_kana_NI }, + { "kana_NU", XKB_KEY_kana_NU }, + { "kana_NE", XKB_KEY_kana_NE }, + { "kana_NO", XKB_KEY_kana_NO }, + { "kana_HA", XKB_KEY_kana_HA }, + { "kana_HI", XKB_KEY_kana_HI }, + { "kana_FU", XKB_KEY_kana_FU }, + { "kana_HE", XKB_KEY_kana_HE }, + { "kana_HO", XKB_KEY_kana_HO }, + { "kana_MA", XKB_KEY_kana_MA }, + { "kana_MI", XKB_KEY_kana_MI }, + { "kana_MU", XKB_KEY_kana_MU }, + { "kana_ME", XKB_KEY_kana_ME }, + { "kana_MO", XKB_KEY_kana_MO }, + { "kana_YA", XKB_KEY_kana_YA }, + { "kana_YU", XKB_KEY_kana_YU }, + { "kana_YO", XKB_KEY_kana_YO }, + { "kana_RA", XKB_KEY_kana_RA }, + { "kana_RI", XKB_KEY_kana_RI }, + { "kana_RU", XKB_KEY_kana_RU }, + { "kana_RE", XKB_KEY_kana_RE }, + { "kana_RO", XKB_KEY_kana_RO }, + { "kana_WA", XKB_KEY_kana_WA }, + { "kana_N", XKB_KEY_kana_N }, + { "voicedsound", XKB_KEY_voicedsound }, + { "semivoicedsound", XKB_KEY_semivoicedsound }, + { "Arabic_comma", XKB_KEY_Arabic_comma }, + { "Arabic_semicolon", XKB_KEY_Arabic_semicolon }, + { "Arabic_question_mark", XKB_KEY_Arabic_question_mark }, + { "Arabic_hamza", XKB_KEY_Arabic_hamza }, + { "Arabic_maddaonalef", XKB_KEY_Arabic_maddaonalef }, + { "Arabic_hamzaonalef", XKB_KEY_Arabic_hamzaonalef }, + { "Arabic_hamzaonwaw", XKB_KEY_Arabic_hamzaonwaw }, + { "Arabic_hamzaunderalef", XKB_KEY_Arabic_hamzaunderalef }, + { "Arabic_hamzaonyeh", XKB_KEY_Arabic_hamzaonyeh }, + { "Arabic_alef", XKB_KEY_Arabic_alef }, + { "Arabic_beh", XKB_KEY_Arabic_beh }, + { "Arabic_tehmarbuta", XKB_KEY_Arabic_tehmarbuta }, + { "Arabic_teh", XKB_KEY_Arabic_teh }, + { "Arabic_theh", XKB_KEY_Arabic_theh }, + { "Arabic_jeem", XKB_KEY_Arabic_jeem }, + { "Arabic_hah", XKB_KEY_Arabic_hah }, + { "Arabic_khah", XKB_KEY_Arabic_khah }, + { "Arabic_dal", XKB_KEY_Arabic_dal }, + { "Arabic_thal", XKB_KEY_Arabic_thal }, + { "Arabic_ra", XKB_KEY_Arabic_ra }, + { "Arabic_zain", XKB_KEY_Arabic_zain }, + { "Arabic_seen", XKB_KEY_Arabic_seen }, + { "Arabic_sheen", XKB_KEY_Arabic_sheen }, + { "Arabic_sad", XKB_KEY_Arabic_sad }, + { "Arabic_dad", XKB_KEY_Arabic_dad }, + { "Arabic_tah", XKB_KEY_Arabic_tah }, + { "Arabic_zah", XKB_KEY_Arabic_zah }, + { "Arabic_ain", XKB_KEY_Arabic_ain }, + { "Arabic_ghain", XKB_KEY_Arabic_ghain }, + { "Arabic_tatweel", XKB_KEY_Arabic_tatweel }, + { "Arabic_feh", XKB_KEY_Arabic_feh }, + { "Arabic_qaf", XKB_KEY_Arabic_qaf }, + { "Arabic_kaf", XKB_KEY_Arabic_kaf }, + { "Arabic_lam", XKB_KEY_Arabic_lam }, + { "Arabic_meem", XKB_KEY_Arabic_meem }, + { "Arabic_noon", XKB_KEY_Arabic_noon }, + { "Arabic_ha", XKB_KEY_Arabic_ha }, + { "Arabic_waw", XKB_KEY_Arabic_waw }, + { "Arabic_alefmaksura", XKB_KEY_Arabic_alefmaksura }, + { "Arabic_yeh", XKB_KEY_Arabic_yeh }, + { "Arabic_fathatan", XKB_KEY_Arabic_fathatan }, + { "Arabic_dammatan", XKB_KEY_Arabic_dammatan }, + { "Arabic_kasratan", XKB_KEY_Arabic_kasratan }, + { "Arabic_fatha", XKB_KEY_Arabic_fatha }, + { "Arabic_damma", XKB_KEY_Arabic_damma }, + { "Arabic_kasra", XKB_KEY_Arabic_kasra }, + { "Arabic_shadda", XKB_KEY_Arabic_shadda }, + { "Arabic_sukun", XKB_KEY_Arabic_sukun }, + { "Serbian_dje", XKB_KEY_Serbian_dje }, + { "Macedonia_gje", XKB_KEY_Macedonia_gje }, + { "Cyrillic_io", XKB_KEY_Cyrillic_io }, + { "Ukrainian_ie", XKB_KEY_Ukrainian_ie }, + { "Macedonia_dse", XKB_KEY_Macedonia_dse }, + { "Ukrainian_i", XKB_KEY_Ukrainian_i }, + { "Ukrainian_yi", XKB_KEY_Ukrainian_yi }, + { "Cyrillic_je", XKB_KEY_Cyrillic_je }, + { "Cyrillic_lje", XKB_KEY_Cyrillic_lje }, + { "Cyrillic_nje", XKB_KEY_Cyrillic_nje }, + { "Serbian_tshe", XKB_KEY_Serbian_tshe }, + { "Macedonia_kje", XKB_KEY_Macedonia_kje }, + { "Ukrainian_ghe_with_upturn", XKB_KEY_Ukrainian_ghe_with_upturn }, + { "Byelorussian_shortu", XKB_KEY_Byelorussian_shortu }, + { "Cyrillic_dzhe", XKB_KEY_Cyrillic_dzhe }, + { "numerosign", XKB_KEY_numerosign }, + { "Serbian_DJE", XKB_KEY_Serbian_DJE }, + { "Macedonia_GJE", XKB_KEY_Macedonia_GJE }, + { "Cyrillic_IO", XKB_KEY_Cyrillic_IO }, + { "Ukrainian_IE", XKB_KEY_Ukrainian_IE }, + { "Macedonia_DSE", XKB_KEY_Macedonia_DSE }, + { "Ukrainian_I", XKB_KEY_Ukrainian_I }, + { "Ukrainian_YI", XKB_KEY_Ukrainian_YI }, + { "Cyrillic_JE", XKB_KEY_Cyrillic_JE }, + { "Cyrillic_LJE", XKB_KEY_Cyrillic_LJE }, + { "Cyrillic_NJE", XKB_KEY_Cyrillic_NJE }, + { "Serbian_TSHE", XKB_KEY_Serbian_TSHE }, + { "Macedonia_KJE", XKB_KEY_Macedonia_KJE }, + { "Ukrainian_GHE_WITH_UPTURN", XKB_KEY_Ukrainian_GHE_WITH_UPTURN }, + { "Byelorussian_SHORTU", XKB_KEY_Byelorussian_SHORTU }, + { "Cyrillic_DZHE", XKB_KEY_Cyrillic_DZHE }, + { "Cyrillic_yu", XKB_KEY_Cyrillic_yu }, + { "Cyrillic_a", XKB_KEY_Cyrillic_a }, + { "Cyrillic_be", XKB_KEY_Cyrillic_be }, + { "Cyrillic_tse", XKB_KEY_Cyrillic_tse }, + { "Cyrillic_de", XKB_KEY_Cyrillic_de }, + { "Cyrillic_ie", XKB_KEY_Cyrillic_ie }, + { "Cyrillic_ef", XKB_KEY_Cyrillic_ef }, + { "Cyrillic_ghe", XKB_KEY_Cyrillic_ghe }, + { "Cyrillic_ha", XKB_KEY_Cyrillic_ha }, + { "Cyrillic_i", XKB_KEY_Cyrillic_i }, + { "Cyrillic_shorti", XKB_KEY_Cyrillic_shorti }, + { "Cyrillic_ka", XKB_KEY_Cyrillic_ka }, + { "Cyrillic_el", XKB_KEY_Cyrillic_el }, + { "Cyrillic_em", XKB_KEY_Cyrillic_em }, + { "Cyrillic_en", XKB_KEY_Cyrillic_en }, + { "Cyrillic_o", XKB_KEY_Cyrillic_o }, + { "Cyrillic_pe", XKB_KEY_Cyrillic_pe }, + { "Cyrillic_ya", XKB_KEY_Cyrillic_ya }, + { "Cyrillic_er", XKB_KEY_Cyrillic_er }, + { "Cyrillic_es", XKB_KEY_Cyrillic_es }, + { "Cyrillic_te", XKB_KEY_Cyrillic_te }, + { "Cyrillic_u", XKB_KEY_Cyrillic_u }, + { "Cyrillic_zhe", XKB_KEY_Cyrillic_zhe }, + { "Cyrillic_ve", XKB_KEY_Cyrillic_ve }, + { "Cyrillic_softsign", XKB_KEY_Cyrillic_softsign }, + { "Cyrillic_yeru", XKB_KEY_Cyrillic_yeru }, + { "Cyrillic_ze", XKB_KEY_Cyrillic_ze }, + { "Cyrillic_sha", XKB_KEY_Cyrillic_sha }, + { "Cyrillic_e", XKB_KEY_Cyrillic_e }, + { "Cyrillic_shcha", XKB_KEY_Cyrillic_shcha }, + { "Cyrillic_che", XKB_KEY_Cyrillic_che }, + { "Cyrillic_hardsign", XKB_KEY_Cyrillic_hardsign }, + { "Cyrillic_YU", XKB_KEY_Cyrillic_YU }, + { "Cyrillic_A", XKB_KEY_Cyrillic_A }, + { "Cyrillic_BE", XKB_KEY_Cyrillic_BE }, + { "Cyrillic_TSE", XKB_KEY_Cyrillic_TSE }, + { "Cyrillic_DE", XKB_KEY_Cyrillic_DE }, + { "Cyrillic_IE", XKB_KEY_Cyrillic_IE }, + { "Cyrillic_EF", XKB_KEY_Cyrillic_EF }, + { "Cyrillic_GHE", XKB_KEY_Cyrillic_GHE }, + { "Cyrillic_HA", XKB_KEY_Cyrillic_HA }, + { "Cyrillic_I", XKB_KEY_Cyrillic_I }, + { "Cyrillic_SHORTI", XKB_KEY_Cyrillic_SHORTI }, + { "Cyrillic_KA", XKB_KEY_Cyrillic_KA }, + { "Cyrillic_EL", XKB_KEY_Cyrillic_EL }, + { "Cyrillic_EM", XKB_KEY_Cyrillic_EM }, + { "Cyrillic_EN", XKB_KEY_Cyrillic_EN }, + { "Cyrillic_O", XKB_KEY_Cyrillic_O }, + { "Cyrillic_PE", XKB_KEY_Cyrillic_PE }, + { "Cyrillic_YA", XKB_KEY_Cyrillic_YA }, + { "Cyrillic_ER", XKB_KEY_Cyrillic_ER }, + { "Cyrillic_ES", XKB_KEY_Cyrillic_ES }, + { "Cyrillic_TE", XKB_KEY_Cyrillic_TE }, + { "Cyrillic_U", XKB_KEY_Cyrillic_U }, + { "Cyrillic_ZHE", XKB_KEY_Cyrillic_ZHE }, + { "Cyrillic_VE", XKB_KEY_Cyrillic_VE }, + { "Cyrillic_SOFTSIGN", XKB_KEY_Cyrillic_SOFTSIGN }, + { "Cyrillic_YERU", XKB_KEY_Cyrillic_YERU }, + { "Cyrillic_ZE", XKB_KEY_Cyrillic_ZE }, + { "Cyrillic_SHA", XKB_KEY_Cyrillic_SHA }, + { "Cyrillic_E", XKB_KEY_Cyrillic_E }, + { "Cyrillic_SHCHA", XKB_KEY_Cyrillic_SHCHA }, + { "Cyrillic_CHE", XKB_KEY_Cyrillic_CHE }, + { "Cyrillic_HARDSIGN", XKB_KEY_Cyrillic_HARDSIGN }, + { "Greek_ALPHAaccent", XKB_KEY_Greek_ALPHAaccent }, + { "Greek_EPSILONaccent", XKB_KEY_Greek_EPSILONaccent }, + { "Greek_ETAaccent", XKB_KEY_Greek_ETAaccent }, + { "Greek_IOTAaccent", XKB_KEY_Greek_IOTAaccent }, + { "Greek_IOTAdieresis", XKB_KEY_Greek_IOTAdieresis }, + { "Greek_OMICRONaccent", XKB_KEY_Greek_OMICRONaccent }, + { "Greek_UPSILONaccent", XKB_KEY_Greek_UPSILONaccent }, + { "Greek_UPSILONdieresis", XKB_KEY_Greek_UPSILONdieresis }, + { "Greek_OMEGAaccent", XKB_KEY_Greek_OMEGAaccent }, + { "Greek_accentdieresis", XKB_KEY_Greek_accentdieresis }, + { "Greek_horizbar", XKB_KEY_Greek_horizbar }, + { "Greek_alphaaccent", XKB_KEY_Greek_alphaaccent }, + { "Greek_epsilonaccent", XKB_KEY_Greek_epsilonaccent }, + { "Greek_etaaccent", XKB_KEY_Greek_etaaccent }, + { "Greek_iotaaccent", XKB_KEY_Greek_iotaaccent }, + { "Greek_iotadieresis", XKB_KEY_Greek_iotadieresis }, + { "Greek_iotaaccentdieresis", XKB_KEY_Greek_iotaaccentdieresis }, + { "Greek_omicronaccent", XKB_KEY_Greek_omicronaccent }, + { "Greek_upsilonaccent", XKB_KEY_Greek_upsilonaccent }, + { "Greek_upsilondieresis", XKB_KEY_Greek_upsilondieresis }, + { "Greek_upsilonaccentdieresis", XKB_KEY_Greek_upsilonaccentdieresis }, + { "Greek_omegaaccent", XKB_KEY_Greek_omegaaccent }, + { "Greek_ALPHA", XKB_KEY_Greek_ALPHA }, + { "Greek_BETA", XKB_KEY_Greek_BETA }, + { "Greek_GAMMA", XKB_KEY_Greek_GAMMA }, + { "Greek_DELTA", XKB_KEY_Greek_DELTA }, + { "Greek_EPSILON", XKB_KEY_Greek_EPSILON }, + { "Greek_ZETA", XKB_KEY_Greek_ZETA }, + { "Greek_ETA", XKB_KEY_Greek_ETA }, + { "Greek_THETA", XKB_KEY_Greek_THETA }, + { "Greek_IOTA", XKB_KEY_Greek_IOTA }, + { "Greek_KAPPA", XKB_KEY_Greek_KAPPA }, + { "Greek_LAMDA", XKB_KEY_Greek_LAMDA }, + { "Greek_MU", XKB_KEY_Greek_MU }, + { "Greek_NU", XKB_KEY_Greek_NU }, + { "Greek_XI", XKB_KEY_Greek_XI }, + { "Greek_OMICRON", XKB_KEY_Greek_OMICRON }, + { "Greek_PI", XKB_KEY_Greek_PI }, + { "Greek_RHO", XKB_KEY_Greek_RHO }, + { "Greek_SIGMA", XKB_KEY_Greek_SIGMA }, + { "Greek_TAU", XKB_KEY_Greek_TAU }, + { "Greek_UPSILON", XKB_KEY_Greek_UPSILON }, + { "Greek_PHI", XKB_KEY_Greek_PHI }, + { "Greek_CHI", XKB_KEY_Greek_CHI }, + { "Greek_PSI", XKB_KEY_Greek_PSI }, + { "Greek_OMEGA", XKB_KEY_Greek_OMEGA }, + { "Greek_alpha", XKB_KEY_Greek_alpha }, + { "Greek_beta", XKB_KEY_Greek_beta }, + { "Greek_gamma", XKB_KEY_Greek_gamma }, + { "Greek_delta", XKB_KEY_Greek_delta }, + { "Greek_epsilon", XKB_KEY_Greek_epsilon }, + { "Greek_zeta", XKB_KEY_Greek_zeta }, + { "Greek_eta", XKB_KEY_Greek_eta }, + { "Greek_theta", XKB_KEY_Greek_theta }, + { "Greek_iota", XKB_KEY_Greek_iota }, + { "Greek_kappa", XKB_KEY_Greek_kappa }, + { "Greek_lamda", XKB_KEY_Greek_lamda }, + { "Greek_mu", XKB_KEY_Greek_mu }, + { "Greek_nu", XKB_KEY_Greek_nu }, + { "Greek_xi", XKB_KEY_Greek_xi }, + { "Greek_omicron", XKB_KEY_Greek_omicron }, + { "Greek_pi", XKB_KEY_Greek_pi }, + { "Greek_rho", XKB_KEY_Greek_rho }, + { "Greek_sigma", XKB_KEY_Greek_sigma }, + { "Greek_finalsmallsigma", XKB_KEY_Greek_finalsmallsigma }, + { "Greek_tau", XKB_KEY_Greek_tau }, + { "Greek_upsilon", XKB_KEY_Greek_upsilon }, + { "Greek_phi", XKB_KEY_Greek_phi }, + { "Greek_chi", XKB_KEY_Greek_chi }, + { "Greek_psi", XKB_KEY_Greek_psi }, + { "Greek_omega", XKB_KEY_Greek_omega }, + { "leftradical", XKB_KEY_leftradical }, + { "topleftradical", XKB_KEY_topleftradical }, + { "horizconnector", XKB_KEY_horizconnector }, + { "topintegral", XKB_KEY_topintegral }, + { "botintegral", XKB_KEY_botintegral }, + { "vertconnector", XKB_KEY_vertconnector }, + { "topleftsqbracket", XKB_KEY_topleftsqbracket }, + { "botleftsqbracket", XKB_KEY_botleftsqbracket }, + { "toprightsqbracket", XKB_KEY_toprightsqbracket }, + { "botrightsqbracket", XKB_KEY_botrightsqbracket }, + { "topleftparens", XKB_KEY_topleftparens }, + { "botleftparens", XKB_KEY_botleftparens }, + { "toprightparens", XKB_KEY_toprightparens }, + { "botrightparens", XKB_KEY_botrightparens }, + { "leftmiddlecurlybrace", XKB_KEY_leftmiddlecurlybrace }, + { "rightmiddlecurlybrace", XKB_KEY_rightmiddlecurlybrace }, + { "topleftsummation", XKB_KEY_topleftsummation }, + { "botleftsummation", XKB_KEY_botleftsummation }, + { "topvertsummationconnector", XKB_KEY_topvertsummationconnector }, + { "botvertsummationconnector", XKB_KEY_botvertsummationconnector }, + { "toprightsummation", XKB_KEY_toprightsummation }, + { "botrightsummation", XKB_KEY_botrightsummation }, + { "rightmiddlesummation", XKB_KEY_rightmiddlesummation }, + { "lessthanequal", XKB_KEY_lessthanequal }, + { "notequal", XKB_KEY_notequal }, + { "greaterthanequal", XKB_KEY_greaterthanequal }, + { "integral", XKB_KEY_integral }, + { "therefore", XKB_KEY_therefore }, + { "variation", XKB_KEY_variation }, + { "infinity", XKB_KEY_infinity }, + { "nabla", XKB_KEY_nabla }, + { "approximate", XKB_KEY_approximate }, + { "similarequal", XKB_KEY_similarequal }, + { "ifonlyif", XKB_KEY_ifonlyif }, + { "implies", XKB_KEY_implies }, + { "identical", XKB_KEY_identical }, + { "radical", XKB_KEY_radical }, + { "includedin", XKB_KEY_includedin }, + { "includes", XKB_KEY_includes }, + { "intersection", XKB_KEY_intersection }, + { "union", XKB_KEY_union }, + { "logicaland", XKB_KEY_logicaland }, + { "logicalor", XKB_KEY_logicalor }, + { "partialderivative", XKB_KEY_partialderivative }, + { "function", XKB_KEY_function }, + { "leftarrow", XKB_KEY_leftarrow }, + { "uparrow", XKB_KEY_uparrow }, + { "rightarrow", XKB_KEY_rightarrow }, + { "downarrow", XKB_KEY_downarrow }, + { "blank", XKB_KEY_blank }, + { "soliddiamond", XKB_KEY_soliddiamond }, + { "checkerboard", XKB_KEY_checkerboard }, + { "ht", XKB_KEY_ht }, + { "ff", XKB_KEY_ff }, + { "cr", XKB_KEY_cr }, + { "lf", XKB_KEY_lf }, + { "nl", XKB_KEY_nl }, + { "vt", XKB_KEY_vt }, + { "lowrightcorner", XKB_KEY_lowrightcorner }, + { "uprightcorner", XKB_KEY_uprightcorner }, + { "upleftcorner", XKB_KEY_upleftcorner }, + { "lowleftcorner", XKB_KEY_lowleftcorner }, + { "crossinglines", XKB_KEY_crossinglines }, + { "horizlinescan1", XKB_KEY_horizlinescan1 }, + { "horizlinescan3", XKB_KEY_horizlinescan3 }, + { "horizlinescan5", XKB_KEY_horizlinescan5 }, + { "horizlinescan7", XKB_KEY_horizlinescan7 }, + { "horizlinescan9", XKB_KEY_horizlinescan9 }, + { "leftt", XKB_KEY_leftt }, + { "rightt", XKB_KEY_rightt }, + { "bott", XKB_KEY_bott }, + { "topt", XKB_KEY_topt }, + { "vertbar", XKB_KEY_vertbar }, + { "emspace", XKB_KEY_emspace }, + { "enspace", XKB_KEY_enspace }, + { "em3space", XKB_KEY_em3space }, + { "em4space", XKB_KEY_em4space }, + { "digitspace", XKB_KEY_digitspace }, + { "punctspace", XKB_KEY_punctspace }, + { "thinspace", XKB_KEY_thinspace }, + { "hairspace", XKB_KEY_hairspace }, + { "emdash", XKB_KEY_emdash }, + { "endash", XKB_KEY_endash }, + { "signifblank", XKB_KEY_signifblank }, + { "ellipsis", XKB_KEY_ellipsis }, + { "doubbaselinedot", XKB_KEY_doubbaselinedot }, + { "onethird", XKB_KEY_onethird }, + { "twothirds", XKB_KEY_twothirds }, + { "onefifth", XKB_KEY_onefifth }, + { "twofifths", XKB_KEY_twofifths }, + { "threefifths", XKB_KEY_threefifths }, + { "fourfifths", XKB_KEY_fourfifths }, + { "onesixth", XKB_KEY_onesixth }, + { "fivesixths", XKB_KEY_fivesixths }, + { "careof", XKB_KEY_careof }, + { "figdash", XKB_KEY_figdash }, + { "leftanglebracket", XKB_KEY_leftanglebracket }, + { "decimalpoint", XKB_KEY_decimalpoint }, + { "rightanglebracket", XKB_KEY_rightanglebracket }, + { "marker", XKB_KEY_marker }, + { "oneeighth", XKB_KEY_oneeighth }, + { "threeeighths", XKB_KEY_threeeighths }, + { "fiveeighths", XKB_KEY_fiveeighths }, + { "seveneighths", XKB_KEY_seveneighths }, + { "trademark", XKB_KEY_trademark }, + { "signaturemark", XKB_KEY_signaturemark }, + { "trademarkincircle", XKB_KEY_trademarkincircle }, + { "leftopentriangle", XKB_KEY_leftopentriangle }, + { "rightopentriangle", XKB_KEY_rightopentriangle }, + { "emopencircle", XKB_KEY_emopencircle }, + { "emopenrectangle", XKB_KEY_emopenrectangle }, + { "leftsinglequotemark", XKB_KEY_leftsinglequotemark }, + { "rightsinglequotemark", XKB_KEY_rightsinglequotemark }, + { "leftdoublequotemark", XKB_KEY_leftdoublequotemark }, + { "rightdoublequotemark", XKB_KEY_rightdoublequotemark }, + { "prescription", XKB_KEY_prescription }, + { "permille", XKB_KEY_permille }, + { "minutes", XKB_KEY_minutes }, + { "seconds", XKB_KEY_seconds }, + { "latincross", XKB_KEY_latincross }, + { "hexagram", XKB_KEY_hexagram }, + { "filledrectbullet", XKB_KEY_filledrectbullet }, + { "filledlefttribullet", XKB_KEY_filledlefttribullet }, + { "filledrighttribullet", XKB_KEY_filledrighttribullet }, + { "emfilledcircle", XKB_KEY_emfilledcircle }, + { "emfilledrect", XKB_KEY_emfilledrect }, + { "enopencircbullet", XKB_KEY_enopencircbullet }, + { "enopensquarebullet", XKB_KEY_enopensquarebullet }, + { "openrectbullet", XKB_KEY_openrectbullet }, + { "opentribulletup", XKB_KEY_opentribulletup }, + { "opentribulletdown", XKB_KEY_opentribulletdown }, + { "openstar", XKB_KEY_openstar }, + { "enfilledcircbullet", XKB_KEY_enfilledcircbullet }, + { "enfilledsqbullet", XKB_KEY_enfilledsqbullet }, + { "filledtribulletup", XKB_KEY_filledtribulletup }, + { "filledtribulletdown", XKB_KEY_filledtribulletdown }, + { "leftpointer", XKB_KEY_leftpointer }, + { "rightpointer", XKB_KEY_rightpointer }, + { "club", XKB_KEY_club }, + { "diamond", XKB_KEY_diamond }, + { "heart", XKB_KEY_heart }, + { "maltesecross", XKB_KEY_maltesecross }, + { "dagger", XKB_KEY_dagger }, + { "doubledagger", XKB_KEY_doubledagger }, + { "checkmark", XKB_KEY_checkmark }, + { "ballotcross", XKB_KEY_ballotcross }, + { "musicalsharp", XKB_KEY_musicalsharp }, + { "musicalflat", XKB_KEY_musicalflat }, + { "malesymbol", XKB_KEY_malesymbol }, + { "femalesymbol", XKB_KEY_femalesymbol }, + { "telephone", XKB_KEY_telephone }, + { "telephonerecorder", XKB_KEY_telephonerecorder }, + { "phonographcopyright", XKB_KEY_phonographcopyright }, + { "caret", XKB_KEY_caret }, + { "singlelowquotemark", XKB_KEY_singlelowquotemark }, + { "doublelowquotemark", XKB_KEY_doublelowquotemark }, + { "cursor", XKB_KEY_cursor }, + { "leftcaret", XKB_KEY_leftcaret }, + { "rightcaret", XKB_KEY_rightcaret }, + { "downcaret", XKB_KEY_downcaret }, + { "upcaret", XKB_KEY_upcaret }, + { "overbar", XKB_KEY_overbar }, + { "downtack", XKB_KEY_downtack }, + { "upshoe", XKB_KEY_upshoe }, + { "downstile", XKB_KEY_downstile }, + { "underbar", XKB_KEY_underbar }, + { "jot", XKB_KEY_jot }, + { "quad", XKB_KEY_quad }, + { "uptack", XKB_KEY_uptack }, + { "circle", XKB_KEY_circle }, + { "upstile", XKB_KEY_upstile }, + { "downshoe", XKB_KEY_downshoe }, + { "rightshoe", XKB_KEY_rightshoe }, + { "leftshoe", XKB_KEY_leftshoe }, + { "lefttack", XKB_KEY_lefttack }, + { "righttack", XKB_KEY_righttack }, + { "hebrew_doublelowline", XKB_KEY_hebrew_doublelowline }, + { "hebrew_aleph", XKB_KEY_hebrew_aleph }, + { "hebrew_bet", XKB_KEY_hebrew_bet }, + { "hebrew_gimel", XKB_KEY_hebrew_gimel }, + { "hebrew_dalet", XKB_KEY_hebrew_dalet }, + { "hebrew_he", XKB_KEY_hebrew_he }, + { "hebrew_waw", XKB_KEY_hebrew_waw }, + { "hebrew_zain", XKB_KEY_hebrew_zain }, + { "hebrew_chet", XKB_KEY_hebrew_chet }, + { "hebrew_tet", XKB_KEY_hebrew_tet }, + { "hebrew_yod", XKB_KEY_hebrew_yod }, + { "hebrew_finalkaph", XKB_KEY_hebrew_finalkaph }, + { "hebrew_kaph", XKB_KEY_hebrew_kaph }, + { "hebrew_lamed", XKB_KEY_hebrew_lamed }, + { "hebrew_finalmem", XKB_KEY_hebrew_finalmem }, + { "hebrew_mem", XKB_KEY_hebrew_mem }, + { "hebrew_finalnun", XKB_KEY_hebrew_finalnun }, + { "hebrew_nun", XKB_KEY_hebrew_nun }, + { "hebrew_samech", XKB_KEY_hebrew_samech }, + { "hebrew_ayin", XKB_KEY_hebrew_ayin }, + { "hebrew_finalpe", XKB_KEY_hebrew_finalpe }, + { "hebrew_pe", XKB_KEY_hebrew_pe }, + { "hebrew_finalzade", XKB_KEY_hebrew_finalzade }, + { "hebrew_zade", XKB_KEY_hebrew_zade }, + { "hebrew_qoph", XKB_KEY_hebrew_qoph }, + { "hebrew_resh", XKB_KEY_hebrew_resh }, + { "hebrew_shin", XKB_KEY_hebrew_shin }, + { "hebrew_taw", XKB_KEY_hebrew_taw }, + { "Thai_kokai", XKB_KEY_Thai_kokai }, + { "Thai_khokhai", XKB_KEY_Thai_khokhai }, + { "Thai_khokhuat", XKB_KEY_Thai_khokhuat }, + { "Thai_khokhwai", XKB_KEY_Thai_khokhwai }, + { "Thai_khokhon", XKB_KEY_Thai_khokhon }, + { "Thai_khorakhang", XKB_KEY_Thai_khorakhang }, + { "Thai_ngongu", XKB_KEY_Thai_ngongu }, + { "Thai_chochan", XKB_KEY_Thai_chochan }, + { "Thai_choching", XKB_KEY_Thai_choching }, + { "Thai_chochang", XKB_KEY_Thai_chochang }, + { "Thai_soso", XKB_KEY_Thai_soso }, + { "Thai_chochoe", XKB_KEY_Thai_chochoe }, + { "Thai_yoying", XKB_KEY_Thai_yoying }, + { "Thai_dochada", XKB_KEY_Thai_dochada }, + { "Thai_topatak", XKB_KEY_Thai_topatak }, + { "Thai_thothan", XKB_KEY_Thai_thothan }, + { "Thai_thonangmontho", XKB_KEY_Thai_thonangmontho }, + { "Thai_thophuthao", XKB_KEY_Thai_thophuthao }, + { "Thai_nonen", XKB_KEY_Thai_nonen }, + { "Thai_dodek", XKB_KEY_Thai_dodek }, + { "Thai_totao", XKB_KEY_Thai_totao }, + { "Thai_thothung", XKB_KEY_Thai_thothung }, + { "Thai_thothahan", XKB_KEY_Thai_thothahan }, + { "Thai_thothong", XKB_KEY_Thai_thothong }, + { "Thai_nonu", XKB_KEY_Thai_nonu }, + { "Thai_bobaimai", XKB_KEY_Thai_bobaimai }, + { "Thai_popla", XKB_KEY_Thai_popla }, + { "Thai_phophung", XKB_KEY_Thai_phophung }, + { "Thai_fofa", XKB_KEY_Thai_fofa }, + { "Thai_phophan", XKB_KEY_Thai_phophan }, + { "Thai_fofan", XKB_KEY_Thai_fofan }, + { "Thai_phosamphao", XKB_KEY_Thai_phosamphao }, + { "Thai_moma", XKB_KEY_Thai_moma }, + { "Thai_yoyak", XKB_KEY_Thai_yoyak }, + { "Thai_rorua", XKB_KEY_Thai_rorua }, + { "Thai_ru", XKB_KEY_Thai_ru }, + { "Thai_loling", XKB_KEY_Thai_loling }, + { "Thai_lu", XKB_KEY_Thai_lu }, + { "Thai_wowaen", XKB_KEY_Thai_wowaen }, + { "Thai_sosala", XKB_KEY_Thai_sosala }, + { "Thai_sorusi", XKB_KEY_Thai_sorusi }, + { "Thai_sosua", XKB_KEY_Thai_sosua }, + { "Thai_hohip", XKB_KEY_Thai_hohip }, + { "Thai_lochula", XKB_KEY_Thai_lochula }, + { "Thai_oang", XKB_KEY_Thai_oang }, + { "Thai_honokhuk", XKB_KEY_Thai_honokhuk }, + { "Thai_paiyannoi", XKB_KEY_Thai_paiyannoi }, + { "Thai_saraa", XKB_KEY_Thai_saraa }, + { "Thai_maihanakat", XKB_KEY_Thai_maihanakat }, + { "Thai_saraaa", XKB_KEY_Thai_saraaa }, + { "Thai_saraam", XKB_KEY_Thai_saraam }, + { "Thai_sarai", XKB_KEY_Thai_sarai }, + { "Thai_saraii", XKB_KEY_Thai_saraii }, + { "Thai_saraue", XKB_KEY_Thai_saraue }, + { "Thai_sarauee", XKB_KEY_Thai_sarauee }, + { "Thai_sarau", XKB_KEY_Thai_sarau }, + { "Thai_sarauu", XKB_KEY_Thai_sarauu }, + { "Thai_phinthu", XKB_KEY_Thai_phinthu }, + { "Thai_maihanakat_maitho", XKB_KEY_Thai_maihanakat_maitho }, + { "Thai_baht", XKB_KEY_Thai_baht }, + { "Thai_sarae", XKB_KEY_Thai_sarae }, + { "Thai_saraae", XKB_KEY_Thai_saraae }, + { "Thai_sarao", XKB_KEY_Thai_sarao }, + { "Thai_saraaimaimuan", XKB_KEY_Thai_saraaimaimuan }, + { "Thai_saraaimaimalai", XKB_KEY_Thai_saraaimaimalai }, + { "Thai_lakkhangyao", XKB_KEY_Thai_lakkhangyao }, + { "Thai_maiyamok", XKB_KEY_Thai_maiyamok }, + { "Thai_maitaikhu", XKB_KEY_Thai_maitaikhu }, + { "Thai_maiek", XKB_KEY_Thai_maiek }, + { "Thai_maitho", XKB_KEY_Thai_maitho }, + { "Thai_maitri", XKB_KEY_Thai_maitri }, + { "Thai_maichattawa", XKB_KEY_Thai_maichattawa }, + { "Thai_thanthakhat", XKB_KEY_Thai_thanthakhat }, + { "Thai_nikhahit", XKB_KEY_Thai_nikhahit }, + { "Thai_leksun", XKB_KEY_Thai_leksun }, + { "Thai_leknung", XKB_KEY_Thai_leknung }, + { "Thai_leksong", XKB_KEY_Thai_leksong }, + { "Thai_leksam", XKB_KEY_Thai_leksam }, + { "Thai_leksi", XKB_KEY_Thai_leksi }, + { "Thai_lekha", XKB_KEY_Thai_lekha }, + { "Thai_lekhok", XKB_KEY_Thai_lekhok }, + { "Thai_lekchet", XKB_KEY_Thai_lekchet }, + { "Thai_lekpaet", XKB_KEY_Thai_lekpaet }, + { "Thai_lekkao", XKB_KEY_Thai_lekkao }, + { "Hangul_Kiyeog", XKB_KEY_Hangul_Kiyeog }, + { "Hangul_SsangKiyeog", XKB_KEY_Hangul_SsangKiyeog }, + { "Hangul_KiyeogSios", XKB_KEY_Hangul_KiyeogSios }, + { "Hangul_Nieun", XKB_KEY_Hangul_Nieun }, + { "Hangul_NieunJieuj", XKB_KEY_Hangul_NieunJieuj }, + { "Hangul_NieunHieuh", XKB_KEY_Hangul_NieunHieuh }, + { "Hangul_Dikeud", XKB_KEY_Hangul_Dikeud }, + { "Hangul_SsangDikeud", XKB_KEY_Hangul_SsangDikeud }, + { "Hangul_Rieul", XKB_KEY_Hangul_Rieul }, + { "Hangul_RieulKiyeog", XKB_KEY_Hangul_RieulKiyeog }, + { "Hangul_RieulMieum", XKB_KEY_Hangul_RieulMieum }, + { "Hangul_RieulPieub", XKB_KEY_Hangul_RieulPieub }, + { "Hangul_RieulSios", XKB_KEY_Hangul_RieulSios }, + { "Hangul_RieulTieut", XKB_KEY_Hangul_RieulTieut }, + { "Hangul_RieulPhieuf", XKB_KEY_Hangul_RieulPhieuf }, + { "Hangul_RieulHieuh", XKB_KEY_Hangul_RieulHieuh }, + { "Hangul_Mieum", XKB_KEY_Hangul_Mieum }, + { "Hangul_Pieub", XKB_KEY_Hangul_Pieub }, + { "Hangul_SsangPieub", XKB_KEY_Hangul_SsangPieub }, + { "Hangul_PieubSios", XKB_KEY_Hangul_PieubSios }, + { "Hangul_Sios", XKB_KEY_Hangul_Sios }, + { "Hangul_SsangSios", XKB_KEY_Hangul_SsangSios }, + { "Hangul_Ieung", XKB_KEY_Hangul_Ieung }, + { "Hangul_Jieuj", XKB_KEY_Hangul_Jieuj }, + { "Hangul_SsangJieuj", XKB_KEY_Hangul_SsangJieuj }, + { "Hangul_Cieuc", XKB_KEY_Hangul_Cieuc }, + { "Hangul_Khieuq", XKB_KEY_Hangul_Khieuq }, + { "Hangul_Tieut", XKB_KEY_Hangul_Tieut }, + { "Hangul_Phieuf", XKB_KEY_Hangul_Phieuf }, + { "Hangul_Hieuh", XKB_KEY_Hangul_Hieuh }, + { "Hangul_A", XKB_KEY_Hangul_A }, + { "Hangul_AE", XKB_KEY_Hangul_AE }, + { "Hangul_YA", XKB_KEY_Hangul_YA }, + { "Hangul_YAE", XKB_KEY_Hangul_YAE }, + { "Hangul_EO", XKB_KEY_Hangul_EO }, + { "Hangul_E", XKB_KEY_Hangul_E }, + { "Hangul_YEO", XKB_KEY_Hangul_YEO }, + { "Hangul_YE", XKB_KEY_Hangul_YE }, + { "Hangul_O", XKB_KEY_Hangul_O }, + { "Hangul_WA", XKB_KEY_Hangul_WA }, + { "Hangul_WAE", XKB_KEY_Hangul_WAE }, + { "Hangul_OE", XKB_KEY_Hangul_OE }, + { "Hangul_YO", XKB_KEY_Hangul_YO }, + { "Hangul_U", XKB_KEY_Hangul_U }, + { "Hangul_WEO", XKB_KEY_Hangul_WEO }, + { "Hangul_WE", XKB_KEY_Hangul_WE }, + { "Hangul_WI", XKB_KEY_Hangul_WI }, + { "Hangul_YU", XKB_KEY_Hangul_YU }, + { "Hangul_EU", XKB_KEY_Hangul_EU }, + { "Hangul_YI", XKB_KEY_Hangul_YI }, + { "Hangul_I", XKB_KEY_Hangul_I }, + { "Hangul_J_Kiyeog", XKB_KEY_Hangul_J_Kiyeog }, + { "Hangul_J_SsangKiyeog", XKB_KEY_Hangul_J_SsangKiyeog }, + { "Hangul_J_KiyeogSios", XKB_KEY_Hangul_J_KiyeogSios }, + { "Hangul_J_Nieun", XKB_KEY_Hangul_J_Nieun }, + { "Hangul_J_NieunJieuj", XKB_KEY_Hangul_J_NieunJieuj }, + { "Hangul_J_NieunHieuh", XKB_KEY_Hangul_J_NieunHieuh }, + { "Hangul_J_Dikeud", XKB_KEY_Hangul_J_Dikeud }, + { "Hangul_J_Rieul", XKB_KEY_Hangul_J_Rieul }, + { "Hangul_J_RieulKiyeog", XKB_KEY_Hangul_J_RieulKiyeog }, + { "Hangul_J_RieulMieum", XKB_KEY_Hangul_J_RieulMieum }, + { "Hangul_J_RieulPieub", XKB_KEY_Hangul_J_RieulPieub }, + { "Hangul_J_RieulSios", XKB_KEY_Hangul_J_RieulSios }, + { "Hangul_J_RieulTieut", XKB_KEY_Hangul_J_RieulTieut }, + { "Hangul_J_RieulPhieuf", XKB_KEY_Hangul_J_RieulPhieuf }, + { "Hangul_J_RieulHieuh", XKB_KEY_Hangul_J_RieulHieuh }, + { "Hangul_J_Mieum", XKB_KEY_Hangul_J_Mieum }, + { "Hangul_J_Pieub", XKB_KEY_Hangul_J_Pieub }, + { "Hangul_J_PieubSios", XKB_KEY_Hangul_J_PieubSios }, + { "Hangul_J_Sios", XKB_KEY_Hangul_J_Sios }, + { "Hangul_J_SsangSios", XKB_KEY_Hangul_J_SsangSios }, + { "Hangul_J_Ieung", XKB_KEY_Hangul_J_Ieung }, + { "Hangul_J_Jieuj", XKB_KEY_Hangul_J_Jieuj }, + { "Hangul_J_Cieuc", XKB_KEY_Hangul_J_Cieuc }, + { "Hangul_J_Khieuq", XKB_KEY_Hangul_J_Khieuq }, + { "Hangul_J_Tieut", XKB_KEY_Hangul_J_Tieut }, + { "Hangul_J_Phieuf", XKB_KEY_Hangul_J_Phieuf }, + { "Hangul_J_Hieuh", XKB_KEY_Hangul_J_Hieuh }, + { "Hangul_RieulYeorinHieuh", XKB_KEY_Hangul_RieulYeorinHieuh }, + { "Hangul_SunkyeongeumMieum", XKB_KEY_Hangul_SunkyeongeumMieum }, + { "Hangul_SunkyeongeumPieub", XKB_KEY_Hangul_SunkyeongeumPieub }, + { "Hangul_PanSios", XKB_KEY_Hangul_PanSios }, + { "Hangul_KkogjiDalrinIeung", XKB_KEY_Hangul_KkogjiDalrinIeung }, + { "Hangul_SunkyeongeumPhieuf", XKB_KEY_Hangul_SunkyeongeumPhieuf }, + { "Hangul_YeorinHieuh", XKB_KEY_Hangul_YeorinHieuh }, + { "Hangul_AraeA", XKB_KEY_Hangul_AraeA }, + { "Hangul_AraeAE", XKB_KEY_Hangul_AraeAE }, + { "Hangul_J_PanSios", XKB_KEY_Hangul_J_PanSios }, + { "Hangul_J_KkogjiDalrinIeung", XKB_KEY_Hangul_J_KkogjiDalrinIeung }, + { "Hangul_J_YeorinHieuh", XKB_KEY_Hangul_J_YeorinHieuh }, + { "Korean_Won", XKB_KEY_Korean_Won }, + { "OE", XKB_KEY_OE }, + { "oe", XKB_KEY_oe }, + { "Ydiaeresis", XKB_KEY_Ydiaeresis }, + { "EuroSign", XKB_KEY_EuroSign }, + { "3270_Duplicate", XKB_KEY_3270_Duplicate }, + { "3270_FieldMark", XKB_KEY_3270_FieldMark }, + { "3270_Right2", XKB_KEY_3270_Right2 }, + { "3270_Left2", XKB_KEY_3270_Left2 }, + { "3270_BackTab", XKB_KEY_3270_BackTab }, + { "3270_EraseEOF", XKB_KEY_3270_EraseEOF }, + { "3270_EraseInput", XKB_KEY_3270_EraseInput }, + { "3270_Reset", XKB_KEY_3270_Reset }, + { "3270_Quit", XKB_KEY_3270_Quit }, + { "3270_PA1", XKB_KEY_3270_PA1 }, + { "3270_PA2", XKB_KEY_3270_PA2 }, + { "3270_PA3", XKB_KEY_3270_PA3 }, + { "3270_Test", XKB_KEY_3270_Test }, + { "3270_Attn", XKB_KEY_3270_Attn }, + { "3270_CursorBlink", XKB_KEY_3270_CursorBlink }, + { "3270_AltCursor", XKB_KEY_3270_AltCursor }, + { "3270_KeyClick", XKB_KEY_3270_KeyClick }, + { "3270_Jump", XKB_KEY_3270_Jump }, + { "3270_Ident", XKB_KEY_3270_Ident }, + { "3270_Rule", XKB_KEY_3270_Rule }, + { "3270_Copy", XKB_KEY_3270_Copy }, + { "3270_Play", XKB_KEY_3270_Play }, + { "3270_Setup", XKB_KEY_3270_Setup }, + { "3270_Record", XKB_KEY_3270_Record }, + { "3270_ChangeScreen", XKB_KEY_3270_ChangeScreen }, + { "3270_DeleteWord", XKB_KEY_3270_DeleteWord }, + { "3270_ExSelect", XKB_KEY_3270_ExSelect }, + { "3270_CursorSelect", XKB_KEY_3270_CursorSelect }, + { "3270_PrintScreen", XKB_KEY_3270_PrintScreen }, + { "3270_Enter", XKB_KEY_3270_Enter }, + { "ISO_Lock", XKB_KEY_ISO_Lock }, + { "ISO_Level2_Latch", XKB_KEY_ISO_Level2_Latch }, + { "ISO_Level3_Shift", XKB_KEY_ISO_Level3_Shift }, + { "ISO_Level3_Latch", XKB_KEY_ISO_Level3_Latch }, + { "ISO_Level3_Lock", XKB_KEY_ISO_Level3_Lock }, + { "ISO_Group_Latch", XKB_KEY_ISO_Group_Latch }, + { "ISO_Group_Lock", XKB_KEY_ISO_Group_Lock }, + { "ISO_Next_Group", XKB_KEY_ISO_Next_Group }, + { "ISO_Next_Group_Lock", XKB_KEY_ISO_Next_Group_Lock }, + { "ISO_Prev_Group", XKB_KEY_ISO_Prev_Group }, + { "ISO_Prev_Group_Lock", XKB_KEY_ISO_Prev_Group_Lock }, + { "ISO_First_Group", XKB_KEY_ISO_First_Group }, + { "ISO_First_Group_Lock", XKB_KEY_ISO_First_Group_Lock }, + { "ISO_Last_Group", XKB_KEY_ISO_Last_Group }, + { "ISO_Last_Group_Lock", XKB_KEY_ISO_Last_Group_Lock }, + { "ISO_Level5_Shift", XKB_KEY_ISO_Level5_Shift }, + { "ISO_Level5_Latch", XKB_KEY_ISO_Level5_Latch }, + { "ISO_Level5_Lock", XKB_KEY_ISO_Level5_Lock }, + { "ISO_Left_Tab", XKB_KEY_ISO_Left_Tab }, + { "ISO_Move_Line_Up", XKB_KEY_ISO_Move_Line_Up }, + { "ISO_Move_Line_Down", XKB_KEY_ISO_Move_Line_Down }, + { "ISO_Partial_Line_Up", XKB_KEY_ISO_Partial_Line_Up }, + { "ISO_Partial_Line_Down", XKB_KEY_ISO_Partial_Line_Down }, + { "ISO_Partial_Space_Left", XKB_KEY_ISO_Partial_Space_Left }, + { "ISO_Partial_Space_Right", XKB_KEY_ISO_Partial_Space_Right }, + { "ISO_Set_Margin_Left", XKB_KEY_ISO_Set_Margin_Left }, + { "ISO_Set_Margin_Right", XKB_KEY_ISO_Set_Margin_Right }, + { "ISO_Release_Margin_Left", XKB_KEY_ISO_Release_Margin_Left }, + { "ISO_Release_Margin_Right", XKB_KEY_ISO_Release_Margin_Right }, + { "ISO_Release_Both_Margins", XKB_KEY_ISO_Release_Both_Margins }, + { "ISO_Fast_Cursor_Left", XKB_KEY_ISO_Fast_Cursor_Left }, + { "ISO_Fast_Cursor_Right", XKB_KEY_ISO_Fast_Cursor_Right }, + { "ISO_Fast_Cursor_Up", XKB_KEY_ISO_Fast_Cursor_Up }, + { "ISO_Fast_Cursor_Down", XKB_KEY_ISO_Fast_Cursor_Down }, + { "ISO_Continuous_Underline", XKB_KEY_ISO_Continuous_Underline }, + { "ISO_Discontinuous_Underline", XKB_KEY_ISO_Discontinuous_Underline }, + { "ISO_Emphasize", XKB_KEY_ISO_Emphasize }, + { "ISO_Center_Object", XKB_KEY_ISO_Center_Object }, + { "ISO_Enter", XKB_KEY_ISO_Enter }, + { "dead_grave", XKB_KEY_dead_grave }, + { "dead_acute", XKB_KEY_dead_acute }, + { "dead_circumflex", XKB_KEY_dead_circumflex }, + { "dead_tilde", XKB_KEY_dead_tilde }, + { "dead_macron", XKB_KEY_dead_macron }, + { "dead_breve", XKB_KEY_dead_breve }, + { "dead_abovedot", XKB_KEY_dead_abovedot }, + { "dead_diaeresis", XKB_KEY_dead_diaeresis }, + { "dead_abovering", XKB_KEY_dead_abovering }, + { "dead_doubleacute", XKB_KEY_dead_doubleacute }, + { "dead_caron", XKB_KEY_dead_caron }, + { "dead_cedilla", XKB_KEY_dead_cedilla }, + { "dead_ogonek", XKB_KEY_dead_ogonek }, + { "dead_iota", XKB_KEY_dead_iota }, + { "dead_voiced_sound", XKB_KEY_dead_voiced_sound }, + { "dead_semivoiced_sound", XKB_KEY_dead_semivoiced_sound }, + { "dead_belowdot", XKB_KEY_dead_belowdot }, + { "dead_hook", XKB_KEY_dead_hook }, + { "dead_horn", XKB_KEY_dead_horn }, + { "dead_stroke", XKB_KEY_dead_stroke }, + { "dead_abovecomma", XKB_KEY_dead_abovecomma }, + { "dead_abovereversedcomma", XKB_KEY_dead_abovereversedcomma }, + { "dead_doublegrave", XKB_KEY_dead_doublegrave }, + { "dead_belowring", XKB_KEY_dead_belowring }, + { "dead_belowmacron", XKB_KEY_dead_belowmacron }, + { "dead_belowcircumflex", XKB_KEY_dead_belowcircumflex }, + { "dead_belowtilde", XKB_KEY_dead_belowtilde }, + { "dead_belowbreve", XKB_KEY_dead_belowbreve }, + { "dead_belowdiaeresis", XKB_KEY_dead_belowdiaeresis }, + { "dead_invertedbreve", XKB_KEY_dead_invertedbreve }, + { "dead_belowcomma", XKB_KEY_dead_belowcomma }, + { "dead_currency", XKB_KEY_dead_currency }, + { "AccessX_Enable", XKB_KEY_AccessX_Enable }, + { "AccessX_Feedback_Enable", XKB_KEY_AccessX_Feedback_Enable }, + { "RepeatKeys_Enable", XKB_KEY_RepeatKeys_Enable }, + { "SlowKeys_Enable", XKB_KEY_SlowKeys_Enable }, + { "BounceKeys_Enable", XKB_KEY_BounceKeys_Enable }, + { "StickyKeys_Enable", XKB_KEY_StickyKeys_Enable }, + { "MouseKeys_Enable", XKB_KEY_MouseKeys_Enable }, + { "MouseKeys_Accel_Enable", XKB_KEY_MouseKeys_Accel_Enable }, + { "Overlay1_Enable", XKB_KEY_Overlay1_Enable }, + { "Overlay2_Enable", XKB_KEY_Overlay2_Enable }, + { "AudibleBell_Enable", XKB_KEY_AudibleBell_Enable }, + { "dead_a", XKB_KEY_dead_a }, + { "dead_A", XKB_KEY_dead_A }, + { "dead_e", XKB_KEY_dead_e }, + { "dead_E", XKB_KEY_dead_E }, + { "dead_i", XKB_KEY_dead_i }, + { "dead_I", XKB_KEY_dead_I }, + { "dead_o", XKB_KEY_dead_o }, + { "dead_O", XKB_KEY_dead_O }, + { "dead_u", XKB_KEY_dead_u }, + { "dead_U", XKB_KEY_dead_U }, + { "dead_small_schwa", XKB_KEY_dead_small_schwa }, + { "dead_capital_schwa", XKB_KEY_dead_capital_schwa }, + { "dead_greek", XKB_KEY_dead_greek }, + { "ch", XKB_KEY_ch }, + { "Ch", XKB_KEY_Ch }, + { "CH", XKB_KEY_CH }, + { "c_h", XKB_KEY_c_h }, + { "C_h", XKB_KEY_C_h }, + { "C_H", XKB_KEY_C_H }, + { "First_Virtual_Screen", XKB_KEY_First_Virtual_Screen }, + { "Prev_Virtual_Screen", XKB_KEY_Prev_Virtual_Screen }, + { "Next_Virtual_Screen", XKB_KEY_Next_Virtual_Screen }, + { "Last_Virtual_Screen", XKB_KEY_Last_Virtual_Screen }, + { "Terminate_Server", XKB_KEY_Terminate_Server }, + { "Pointer_Left", XKB_KEY_Pointer_Left }, + { "Pointer_Right", XKB_KEY_Pointer_Right }, + { "Pointer_Up", XKB_KEY_Pointer_Up }, + { "Pointer_Down", XKB_KEY_Pointer_Down }, + { "Pointer_UpLeft", XKB_KEY_Pointer_UpLeft }, + { "Pointer_UpRight", XKB_KEY_Pointer_UpRight }, + { "Pointer_DownLeft", XKB_KEY_Pointer_DownLeft }, + { "Pointer_DownRight", XKB_KEY_Pointer_DownRight }, + { "Pointer_Button_Dflt", XKB_KEY_Pointer_Button_Dflt }, + { "Pointer_Button1", XKB_KEY_Pointer_Button1 }, + { "Pointer_Button2", XKB_KEY_Pointer_Button2 }, + { "Pointer_Button3", XKB_KEY_Pointer_Button3 }, + { "Pointer_Button4", XKB_KEY_Pointer_Button4 }, + { "Pointer_Button5", XKB_KEY_Pointer_Button5 }, + { "Pointer_DblClick_Dflt", XKB_KEY_Pointer_DblClick_Dflt }, + { "Pointer_DblClick1", XKB_KEY_Pointer_DblClick1 }, + { "Pointer_DblClick2", XKB_KEY_Pointer_DblClick2 }, + { "Pointer_DblClick3", XKB_KEY_Pointer_DblClick3 }, + { "Pointer_DblClick4", XKB_KEY_Pointer_DblClick4 }, + { "Pointer_DblClick5", XKB_KEY_Pointer_DblClick5 }, + { "Pointer_Drag_Dflt", XKB_KEY_Pointer_Drag_Dflt }, + { "Pointer_Drag1", XKB_KEY_Pointer_Drag1 }, + { "Pointer_Drag2", XKB_KEY_Pointer_Drag2 }, + { "Pointer_Drag3", XKB_KEY_Pointer_Drag3 }, + { "Pointer_Drag4", XKB_KEY_Pointer_Drag4 }, + { "Pointer_EnableKeys", XKB_KEY_Pointer_EnableKeys }, + { "Pointer_Accelerate", XKB_KEY_Pointer_Accelerate }, + { "Pointer_DfltBtnNext", XKB_KEY_Pointer_DfltBtnNext }, + { "Pointer_DfltBtnPrev", XKB_KEY_Pointer_DfltBtnPrev }, + { "Pointer_Drag5", XKB_KEY_Pointer_Drag5 }, + { "BackSpace", XKB_KEY_BackSpace }, + { "Tab", XKB_KEY_Tab }, + { "Linefeed", XKB_KEY_Linefeed }, + { "Clear", XKB_KEY_Clear }, + { "Return", XKB_KEY_Return }, + { "Pause", XKB_KEY_Pause }, + { "Scroll_Lock", XKB_KEY_Scroll_Lock }, + { "Sys_Req", XKB_KEY_Sys_Req }, + { "Escape", XKB_KEY_Escape }, + { "Multi_key", XKB_KEY_Multi_key }, + { "Kanji", XKB_KEY_Kanji }, + { "Muhenkan", XKB_KEY_Muhenkan }, + { "Henkan_Mode", XKB_KEY_Henkan_Mode }, + { "Romaji", XKB_KEY_Romaji }, + { "Hiragana", XKB_KEY_Hiragana }, + { "Katakana", XKB_KEY_Katakana }, + { "Hiragana_Katakana", XKB_KEY_Hiragana_Katakana }, + { "Zenkaku", XKB_KEY_Zenkaku }, + { "Hankaku", XKB_KEY_Hankaku }, + { "Zenkaku_Hankaku", XKB_KEY_Zenkaku_Hankaku }, + { "Touroku", XKB_KEY_Touroku }, + { "Massyo", XKB_KEY_Massyo }, + { "Kana_Lock", XKB_KEY_Kana_Lock }, + { "Kana_Shift", XKB_KEY_Kana_Shift }, + { "Eisu_Shift", XKB_KEY_Eisu_Shift }, + { "Eisu_toggle", XKB_KEY_Eisu_toggle }, + { "Hangul", XKB_KEY_Hangul }, + { "Hangul_Start", XKB_KEY_Hangul_Start }, + { "Hangul_End", XKB_KEY_Hangul_End }, + { "Hangul_Hanja", XKB_KEY_Hangul_Hanja }, + { "Hangul_Jamo", XKB_KEY_Hangul_Jamo }, + { "Hangul_Romaja", XKB_KEY_Hangul_Romaja }, + { "Codeinput", XKB_KEY_Codeinput }, + { "Hangul_Jeonja", XKB_KEY_Hangul_Jeonja }, + { "Hangul_Banja", XKB_KEY_Hangul_Banja }, + { "Hangul_PreHanja", XKB_KEY_Hangul_PreHanja }, + { "Hangul_PostHanja", XKB_KEY_Hangul_PostHanja }, + { "SingleCandidate", XKB_KEY_SingleCandidate }, + { "MultipleCandidate", XKB_KEY_MultipleCandidate }, + { "PreviousCandidate", XKB_KEY_PreviousCandidate }, + { "Hangul_Special", XKB_KEY_Hangul_Special }, + { "Home", XKB_KEY_Home }, + { "Left", XKB_KEY_Left }, + { "Up", XKB_KEY_Up }, + { "Right", XKB_KEY_Right }, + { "Down", XKB_KEY_Down }, + { "Prior", XKB_KEY_Prior }, + { "Next", XKB_KEY_Next }, + { "End", XKB_KEY_End }, + { "Begin", XKB_KEY_Begin }, + { "Select", XKB_KEY_Select }, + { "Print", XKB_KEY_Print }, + { "Execute", XKB_KEY_Execute }, + { "Insert", XKB_KEY_Insert }, + { "Undo", XKB_KEY_Undo }, + { "Redo", XKB_KEY_Redo }, + { "Menu", XKB_KEY_Menu }, + { "Find", XKB_KEY_Find }, + { "Cancel", XKB_KEY_Cancel }, + { "Help", XKB_KEY_Help }, + { "Break", XKB_KEY_Break }, + { "Mode_switch", XKB_KEY_Mode_switch }, + { "Num_Lock", XKB_KEY_Num_Lock }, + { "KP_Space", XKB_KEY_KP_Space }, + { "KP_Tab", XKB_KEY_KP_Tab }, + { "KP_Enter", XKB_KEY_KP_Enter }, + { "KP_F1", XKB_KEY_KP_F1 }, + { "KP_F2", XKB_KEY_KP_F2 }, + { "KP_F3", XKB_KEY_KP_F3 }, + { "KP_F4", XKB_KEY_KP_F4 }, + { "KP_Home", XKB_KEY_KP_Home }, + { "KP_Left", XKB_KEY_KP_Left }, + { "KP_Up", XKB_KEY_KP_Up }, + { "KP_Right", XKB_KEY_KP_Right }, + { "KP_Down", XKB_KEY_KP_Down }, + { "KP_Prior", XKB_KEY_KP_Prior }, + { "KP_Next", XKB_KEY_KP_Next }, + { "KP_End", XKB_KEY_KP_End }, + { "KP_Begin", XKB_KEY_KP_Begin }, + { "KP_Insert", XKB_KEY_KP_Insert }, + { "KP_Delete", XKB_KEY_KP_Delete }, + { "KP_Multiply", XKB_KEY_KP_Multiply }, + { "KP_Add", XKB_KEY_KP_Add }, + { "KP_Separator", XKB_KEY_KP_Separator }, + { "KP_Subtract", XKB_KEY_KP_Subtract }, + { "KP_Decimal", XKB_KEY_KP_Decimal }, + { "KP_Divide", XKB_KEY_KP_Divide }, + { "KP_0", XKB_KEY_KP_0 }, + { "KP_1", XKB_KEY_KP_1 }, + { "KP_2", XKB_KEY_KP_2 }, + { "KP_3", XKB_KEY_KP_3 }, + { "KP_4", XKB_KEY_KP_4 }, + { "KP_5", XKB_KEY_KP_5 }, + { "KP_6", XKB_KEY_KP_6 }, + { "KP_7", XKB_KEY_KP_7 }, + { "KP_8", XKB_KEY_KP_8 }, + { "KP_9", XKB_KEY_KP_9 }, + { "KP_Equal", XKB_KEY_KP_Equal }, + { "F1", XKB_KEY_F1 }, + { "F2", XKB_KEY_F2 }, + { "F3", XKB_KEY_F3 }, + { "F4", XKB_KEY_F4 }, + { "F5", XKB_KEY_F5 }, + { "F6", XKB_KEY_F6 }, + { "F7", XKB_KEY_F7 }, + { "F8", XKB_KEY_F8 }, + { "F9", XKB_KEY_F9 }, + { "F10", XKB_KEY_F10 }, + { "F11", XKB_KEY_F11 }, + { "F12", XKB_KEY_F12 }, + { "F13", XKB_KEY_F13 }, + { "F14", XKB_KEY_F14 }, + { "F15", XKB_KEY_F15 }, + { "F16", XKB_KEY_F16 }, + { "F17", XKB_KEY_F17 }, + { "F18", XKB_KEY_F18 }, + { "F19", XKB_KEY_F19 }, + { "F20", XKB_KEY_F20 }, + { "F21", XKB_KEY_F21 }, + { "F22", XKB_KEY_F22 }, + { "F23", XKB_KEY_F23 }, + { "F24", XKB_KEY_F24 }, + { "F25", XKB_KEY_F25 }, + { "F26", XKB_KEY_F26 }, + { "F27", XKB_KEY_F27 }, + { "F28", XKB_KEY_F28 }, + { "F29", XKB_KEY_F29 }, + { "F30", XKB_KEY_F30 }, + { "F31", XKB_KEY_F31 }, + { "F32", XKB_KEY_F32 }, + { "F33", XKB_KEY_F33 }, + { "F34", XKB_KEY_F34 }, + { "F35", XKB_KEY_F35 }, + { "Shift_L", XKB_KEY_Shift_L }, + { "Shift_R", XKB_KEY_Shift_R }, + { "Control_L", XKB_KEY_Control_L }, + { "Control_R", XKB_KEY_Control_R }, + { "Caps_Lock", XKB_KEY_Caps_Lock }, + { "Shift_Lock", XKB_KEY_Shift_Lock }, + { "Meta_L", XKB_KEY_Meta_L }, + { "Meta_R", XKB_KEY_Meta_R }, + { "Alt_L", XKB_KEY_Alt_L }, + { "Alt_R", XKB_KEY_Alt_R }, + { "Super_L", XKB_KEY_Super_L }, + { "Super_R", XKB_KEY_Super_R }, + { "Hyper_L", XKB_KEY_Hyper_L }, + { "Hyper_R", XKB_KEY_Hyper_R }, + { "braille_dot_1", XKB_KEY_braille_dot_1 }, + { "braille_dot_2", XKB_KEY_braille_dot_2 }, + { "braille_dot_3", XKB_KEY_braille_dot_3 }, + { "braille_dot_4", XKB_KEY_braille_dot_4 }, + { "braille_dot_5", XKB_KEY_braille_dot_5 }, + { "braille_dot_6", XKB_KEY_braille_dot_6 }, + { "braille_dot_7", XKB_KEY_braille_dot_7 }, + { "braille_dot_8", XKB_KEY_braille_dot_8 }, + { "braille_dot_9", XKB_KEY_braille_dot_9 }, + { "braille_dot_10", XKB_KEY_braille_dot_10 }, + { "Delete", XKB_KEY_Delete }, + { "VoidSymbol", XKB_KEY_VoidSymbol }, + { "Ibreve", XKB_KEY_Ibreve }, + { "ibreve", XKB_KEY_ibreve }, + { "Wcircumflex", XKB_KEY_Wcircumflex }, + { "wcircumflex", XKB_KEY_wcircumflex }, + { "Ycircumflex", XKB_KEY_Ycircumflex }, + { "ycircumflex", XKB_KEY_ycircumflex }, + { "SCHWA", XKB_KEY_SCHWA }, + { "Obarred", XKB_KEY_Obarred }, + { "Ohorn", XKB_KEY_Ohorn }, + { "ohorn", XKB_KEY_ohorn }, + { "Uhorn", XKB_KEY_Uhorn }, + { "uhorn", XKB_KEY_uhorn }, + { "Zstroke", XKB_KEY_Zstroke }, + { "zstroke", XKB_KEY_zstroke }, + { "EZH", XKB_KEY_EZH }, + { "Ocaron", XKB_KEY_Ocaron }, + { "ocaron", XKB_KEY_ocaron }, + { "Gcaron", XKB_KEY_Gcaron }, + { "gcaron", XKB_KEY_gcaron }, + { "schwa", XKB_KEY_schwa }, + { "obarred", XKB_KEY_obarred }, + { "ezh", XKB_KEY_ezh }, + { "Cyrillic_GHE_bar", XKB_KEY_Cyrillic_GHE_bar }, + { "Cyrillic_ghe_bar", XKB_KEY_Cyrillic_ghe_bar }, + { "Cyrillic_ZHE_descender", XKB_KEY_Cyrillic_ZHE_descender }, + { "Cyrillic_zhe_descender", XKB_KEY_Cyrillic_zhe_descender }, + { "Cyrillic_KA_descender", XKB_KEY_Cyrillic_KA_descender }, + { "Cyrillic_ka_descender", XKB_KEY_Cyrillic_ka_descender }, + { "Cyrillic_KA_vertstroke", XKB_KEY_Cyrillic_KA_vertstroke }, + { "Cyrillic_ka_vertstroke", XKB_KEY_Cyrillic_ka_vertstroke }, + { "Cyrillic_EN_descender", XKB_KEY_Cyrillic_EN_descender }, + { "Cyrillic_en_descender", XKB_KEY_Cyrillic_en_descender }, + { "Cyrillic_U_straight", XKB_KEY_Cyrillic_U_straight }, + { "Cyrillic_u_straight", XKB_KEY_Cyrillic_u_straight }, + { "Cyrillic_U_straight_bar", XKB_KEY_Cyrillic_U_straight_bar }, + { "Cyrillic_u_straight_bar", XKB_KEY_Cyrillic_u_straight_bar }, + { "Cyrillic_HA_descender", XKB_KEY_Cyrillic_HA_descender }, + { "Cyrillic_ha_descender", XKB_KEY_Cyrillic_ha_descender }, + { "Cyrillic_CHE_descender", XKB_KEY_Cyrillic_CHE_descender }, + { "Cyrillic_che_descender", XKB_KEY_Cyrillic_che_descender }, + { "Cyrillic_CHE_vertstroke", XKB_KEY_Cyrillic_CHE_vertstroke }, + { "Cyrillic_che_vertstroke", XKB_KEY_Cyrillic_che_vertstroke }, + { "Cyrillic_SHHA", XKB_KEY_Cyrillic_SHHA }, + { "Cyrillic_shha", XKB_KEY_Cyrillic_shha }, + { "Cyrillic_SCHWA", XKB_KEY_Cyrillic_SCHWA }, + { "Cyrillic_schwa", XKB_KEY_Cyrillic_schwa }, + { "Cyrillic_I_macron", XKB_KEY_Cyrillic_I_macron }, + { "Cyrillic_i_macron", XKB_KEY_Cyrillic_i_macron }, + { "Cyrillic_O_bar", XKB_KEY_Cyrillic_O_bar }, + { "Cyrillic_o_bar", XKB_KEY_Cyrillic_o_bar }, + { "Cyrillic_U_macron", XKB_KEY_Cyrillic_U_macron }, + { "Cyrillic_u_macron", XKB_KEY_Cyrillic_u_macron }, + { "Armenian_AYB", XKB_KEY_Armenian_AYB }, + { "Armenian_BEN", XKB_KEY_Armenian_BEN }, + { "Armenian_GIM", XKB_KEY_Armenian_GIM }, + { "Armenian_DA", XKB_KEY_Armenian_DA }, + { "Armenian_YECH", XKB_KEY_Armenian_YECH }, + { "Armenian_ZA", XKB_KEY_Armenian_ZA }, + { "Armenian_E", XKB_KEY_Armenian_E }, + { "Armenian_AT", XKB_KEY_Armenian_AT }, + { "Armenian_TO", XKB_KEY_Armenian_TO }, + { "Armenian_ZHE", XKB_KEY_Armenian_ZHE }, + { "Armenian_INI", XKB_KEY_Armenian_INI }, + { "Armenian_LYUN", XKB_KEY_Armenian_LYUN }, + { "Armenian_KHE", XKB_KEY_Armenian_KHE }, + { "Armenian_TSA", XKB_KEY_Armenian_TSA }, + { "Armenian_KEN", XKB_KEY_Armenian_KEN }, + { "Armenian_HO", XKB_KEY_Armenian_HO }, + { "Armenian_DZA", XKB_KEY_Armenian_DZA }, + { "Armenian_GHAT", XKB_KEY_Armenian_GHAT }, + { "Armenian_TCHE", XKB_KEY_Armenian_TCHE }, + { "Armenian_MEN", XKB_KEY_Armenian_MEN }, + { "Armenian_HI", XKB_KEY_Armenian_HI }, + { "Armenian_NU", XKB_KEY_Armenian_NU }, + { "Armenian_SHA", XKB_KEY_Armenian_SHA }, + { "Armenian_VO", XKB_KEY_Armenian_VO }, + { "Armenian_CHA", XKB_KEY_Armenian_CHA }, + { "Armenian_PE", XKB_KEY_Armenian_PE }, + { "Armenian_JE", XKB_KEY_Armenian_JE }, + { "Armenian_RA", XKB_KEY_Armenian_RA }, + { "Armenian_SE", XKB_KEY_Armenian_SE }, + { "Armenian_VEV", XKB_KEY_Armenian_VEV }, + { "Armenian_TYUN", XKB_KEY_Armenian_TYUN }, + { "Armenian_RE", XKB_KEY_Armenian_RE }, + { "Armenian_TSO", XKB_KEY_Armenian_TSO }, + { "Armenian_VYUN", XKB_KEY_Armenian_VYUN }, + { "Armenian_PYUR", XKB_KEY_Armenian_PYUR }, + { "Armenian_KE", XKB_KEY_Armenian_KE }, + { "Armenian_O", XKB_KEY_Armenian_O }, + { "Armenian_FE", XKB_KEY_Armenian_FE }, + { "Armenian_apostrophe", XKB_KEY_Armenian_apostrophe }, + { "Armenian_accent", XKB_KEY_Armenian_accent }, + { "Armenian_exclam", XKB_KEY_Armenian_exclam }, + { "Armenian_separation_mark", XKB_KEY_Armenian_separation_mark }, + { "Armenian_question", XKB_KEY_Armenian_question }, + { "Armenian_ayb", XKB_KEY_Armenian_ayb }, + { "Armenian_ben", XKB_KEY_Armenian_ben }, + { "Armenian_gim", XKB_KEY_Armenian_gim }, + { "Armenian_da", XKB_KEY_Armenian_da }, + { "Armenian_yech", XKB_KEY_Armenian_yech }, + { "Armenian_za", XKB_KEY_Armenian_za }, + { "Armenian_e", XKB_KEY_Armenian_e }, + { "Armenian_at", XKB_KEY_Armenian_at }, + { "Armenian_to", XKB_KEY_Armenian_to }, + { "Armenian_zhe", XKB_KEY_Armenian_zhe }, + { "Armenian_ini", XKB_KEY_Armenian_ini }, + { "Armenian_lyun", XKB_KEY_Armenian_lyun }, + { "Armenian_khe", XKB_KEY_Armenian_khe }, + { "Armenian_tsa", XKB_KEY_Armenian_tsa }, + { "Armenian_ken", XKB_KEY_Armenian_ken }, + { "Armenian_ho", XKB_KEY_Armenian_ho }, + { "Armenian_dza", XKB_KEY_Armenian_dza }, + { "Armenian_ghat", XKB_KEY_Armenian_ghat }, + { "Armenian_tche", XKB_KEY_Armenian_tche }, + { "Armenian_men", XKB_KEY_Armenian_men }, + { "Armenian_hi", XKB_KEY_Armenian_hi }, + { "Armenian_nu", XKB_KEY_Armenian_nu }, + { "Armenian_sha", XKB_KEY_Armenian_sha }, + { "Armenian_vo", XKB_KEY_Armenian_vo }, + { "Armenian_cha", XKB_KEY_Armenian_cha }, + { "Armenian_pe", XKB_KEY_Armenian_pe }, + { "Armenian_je", XKB_KEY_Armenian_je }, + { "Armenian_ra", XKB_KEY_Armenian_ra }, + { "Armenian_se", XKB_KEY_Armenian_se }, + { "Armenian_vev", XKB_KEY_Armenian_vev }, + { "Armenian_tyun", XKB_KEY_Armenian_tyun }, + { "Armenian_re", XKB_KEY_Armenian_re }, + { "Armenian_tso", XKB_KEY_Armenian_tso }, + { "Armenian_vyun", XKB_KEY_Armenian_vyun }, + { "Armenian_pyur", XKB_KEY_Armenian_pyur }, + { "Armenian_ke", XKB_KEY_Armenian_ke }, + { "Armenian_o", XKB_KEY_Armenian_o }, + { "Armenian_fe", XKB_KEY_Armenian_fe }, + { "Armenian_ligature_ew", XKB_KEY_Armenian_ligature_ew }, + { "Armenian_full_stop", XKB_KEY_Armenian_full_stop }, + { "Armenian_hyphen", XKB_KEY_Armenian_hyphen }, + { "Arabic_madda_above", XKB_KEY_Arabic_madda_above }, + { "Arabic_hamza_above", XKB_KEY_Arabic_hamza_above }, + { "Arabic_hamza_below", XKB_KEY_Arabic_hamza_below }, + { "Arabic_0", XKB_KEY_Arabic_0 }, + { "Arabic_1", XKB_KEY_Arabic_1 }, + { "Arabic_2", XKB_KEY_Arabic_2 }, + { "Arabic_3", XKB_KEY_Arabic_3 }, + { "Arabic_4", XKB_KEY_Arabic_4 }, + { "Arabic_5", XKB_KEY_Arabic_5 }, + { "Arabic_6", XKB_KEY_Arabic_6 }, + { "Arabic_7", XKB_KEY_Arabic_7 }, + { "Arabic_8", XKB_KEY_Arabic_8 }, + { "Arabic_9", XKB_KEY_Arabic_9 }, + { "Arabic_percent", XKB_KEY_Arabic_percent }, + { "Arabic_superscript_alef", XKB_KEY_Arabic_superscript_alef }, + { "Arabic_tteh", XKB_KEY_Arabic_tteh }, + { "Arabic_peh", XKB_KEY_Arabic_peh }, + { "Arabic_tcheh", XKB_KEY_Arabic_tcheh }, + { "Arabic_ddal", XKB_KEY_Arabic_ddal }, + { "Arabic_rreh", XKB_KEY_Arabic_rreh }, + { "Arabic_jeh", XKB_KEY_Arabic_jeh }, + { "Arabic_veh", XKB_KEY_Arabic_veh }, + { "Arabic_keheh", XKB_KEY_Arabic_keheh }, + { "Arabic_gaf", XKB_KEY_Arabic_gaf }, + { "Arabic_noon_ghunna", XKB_KEY_Arabic_noon_ghunna }, + { "Arabic_heh_doachashmee", XKB_KEY_Arabic_heh_doachashmee }, + { "Arabic_heh_goal", XKB_KEY_Arabic_heh_goal }, + { "Farsi_yeh", XKB_KEY_Farsi_yeh }, + { "Arabic_yeh_baree", XKB_KEY_Arabic_yeh_baree }, + { "Arabic_fullstop", XKB_KEY_Arabic_fullstop }, + { "Farsi_0", XKB_KEY_Farsi_0 }, + { "Farsi_1", XKB_KEY_Farsi_1 }, + { "Farsi_2", XKB_KEY_Farsi_2 }, + { "Farsi_3", XKB_KEY_Farsi_3 }, + { "Farsi_4", XKB_KEY_Farsi_4 }, + { "Farsi_5", XKB_KEY_Farsi_5 }, + { "Farsi_6", XKB_KEY_Farsi_6 }, + { "Farsi_7", XKB_KEY_Farsi_7 }, + { "Farsi_8", XKB_KEY_Farsi_8 }, + { "Farsi_9", XKB_KEY_Farsi_9 }, + { "Sinh_ng", XKB_KEY_Sinh_ng }, + { "Sinh_h2", XKB_KEY_Sinh_h2 }, + { "Sinh_a", XKB_KEY_Sinh_a }, + { "Sinh_aa", XKB_KEY_Sinh_aa }, + { "Sinh_ae", XKB_KEY_Sinh_ae }, + { "Sinh_aee", XKB_KEY_Sinh_aee }, + { "Sinh_i", XKB_KEY_Sinh_i }, + { "Sinh_ii", XKB_KEY_Sinh_ii }, + { "Sinh_u", XKB_KEY_Sinh_u }, + { "Sinh_uu", XKB_KEY_Sinh_uu }, + { "Sinh_ri", XKB_KEY_Sinh_ri }, + { "Sinh_rii", XKB_KEY_Sinh_rii }, + { "Sinh_lu", XKB_KEY_Sinh_lu }, + { "Sinh_luu", XKB_KEY_Sinh_luu }, + { "Sinh_e", XKB_KEY_Sinh_e }, + { "Sinh_ee", XKB_KEY_Sinh_ee }, + { "Sinh_ai", XKB_KEY_Sinh_ai }, + { "Sinh_o", XKB_KEY_Sinh_o }, + { "Sinh_oo", XKB_KEY_Sinh_oo }, + { "Sinh_au", XKB_KEY_Sinh_au }, + { "Sinh_ka", XKB_KEY_Sinh_ka }, + { "Sinh_kha", XKB_KEY_Sinh_kha }, + { "Sinh_ga", XKB_KEY_Sinh_ga }, + { "Sinh_gha", XKB_KEY_Sinh_gha }, + { "Sinh_ng2", XKB_KEY_Sinh_ng2 }, + { "Sinh_nga", XKB_KEY_Sinh_nga }, + { "Sinh_ca", XKB_KEY_Sinh_ca }, + { "Sinh_cha", XKB_KEY_Sinh_cha }, + { "Sinh_ja", XKB_KEY_Sinh_ja }, + { "Sinh_jha", XKB_KEY_Sinh_jha }, + { "Sinh_nya", XKB_KEY_Sinh_nya }, + { "Sinh_jnya", XKB_KEY_Sinh_jnya }, + { "Sinh_nja", XKB_KEY_Sinh_nja }, + { "Sinh_tta", XKB_KEY_Sinh_tta }, + { "Sinh_ttha", XKB_KEY_Sinh_ttha }, + { "Sinh_dda", XKB_KEY_Sinh_dda }, + { "Sinh_ddha", XKB_KEY_Sinh_ddha }, + { "Sinh_nna", XKB_KEY_Sinh_nna }, + { "Sinh_ndda", XKB_KEY_Sinh_ndda }, + { "Sinh_tha", XKB_KEY_Sinh_tha }, + { "Sinh_thha", XKB_KEY_Sinh_thha }, + { "Sinh_dha", XKB_KEY_Sinh_dha }, + { "Sinh_dhha", XKB_KEY_Sinh_dhha }, + { "Sinh_na", XKB_KEY_Sinh_na }, + { "Sinh_ndha", XKB_KEY_Sinh_ndha }, + { "Sinh_pa", XKB_KEY_Sinh_pa }, + { "Sinh_pha", XKB_KEY_Sinh_pha }, + { "Sinh_ba", XKB_KEY_Sinh_ba }, + { "Sinh_bha", XKB_KEY_Sinh_bha }, + { "Sinh_ma", XKB_KEY_Sinh_ma }, + { "Sinh_mba", XKB_KEY_Sinh_mba }, + { "Sinh_ya", XKB_KEY_Sinh_ya }, + { "Sinh_ra", XKB_KEY_Sinh_ra }, + { "Sinh_la", XKB_KEY_Sinh_la }, + { "Sinh_va", XKB_KEY_Sinh_va }, + { "Sinh_sha", XKB_KEY_Sinh_sha }, + { "Sinh_ssha", XKB_KEY_Sinh_ssha }, + { "Sinh_sa", XKB_KEY_Sinh_sa }, + { "Sinh_ha", XKB_KEY_Sinh_ha }, + { "Sinh_lla", XKB_KEY_Sinh_lla }, + { "Sinh_fa", XKB_KEY_Sinh_fa }, + { "Sinh_al", XKB_KEY_Sinh_al }, + { "Sinh_aa2", XKB_KEY_Sinh_aa2 }, + { "Sinh_ae2", XKB_KEY_Sinh_ae2 }, + { "Sinh_aee2", XKB_KEY_Sinh_aee2 }, + { "Sinh_i2", XKB_KEY_Sinh_i2 }, + { "Sinh_ii2", XKB_KEY_Sinh_ii2 }, + { "Sinh_u2", XKB_KEY_Sinh_u2 }, + { "Sinh_uu2", XKB_KEY_Sinh_uu2 }, + { "Sinh_ru2", XKB_KEY_Sinh_ru2 }, + { "Sinh_e2", XKB_KEY_Sinh_e2 }, + { "Sinh_ee2", XKB_KEY_Sinh_ee2 }, + { "Sinh_ai2", XKB_KEY_Sinh_ai2 }, + { "Sinh_o2", XKB_KEY_Sinh_o2 }, + { "Sinh_oo2", XKB_KEY_Sinh_oo2 }, + { "Sinh_au2", XKB_KEY_Sinh_au2 }, + { "Sinh_lu2", XKB_KEY_Sinh_lu2 }, + { "Sinh_ruu2", XKB_KEY_Sinh_ruu2 }, + { "Sinh_luu2", XKB_KEY_Sinh_luu2 }, + { "Sinh_kunddaliya", XKB_KEY_Sinh_kunddaliya }, + { "Georgian_an", XKB_KEY_Georgian_an }, + { "Georgian_ban", XKB_KEY_Georgian_ban }, + { "Georgian_gan", XKB_KEY_Georgian_gan }, + { "Georgian_don", XKB_KEY_Georgian_don }, + { "Georgian_en", XKB_KEY_Georgian_en }, + { "Georgian_vin", XKB_KEY_Georgian_vin }, + { "Georgian_zen", XKB_KEY_Georgian_zen }, + { "Georgian_tan", XKB_KEY_Georgian_tan }, + { "Georgian_in", XKB_KEY_Georgian_in }, + { "Georgian_kan", XKB_KEY_Georgian_kan }, + { "Georgian_las", XKB_KEY_Georgian_las }, + { "Georgian_man", XKB_KEY_Georgian_man }, + { "Georgian_nar", XKB_KEY_Georgian_nar }, + { "Georgian_on", XKB_KEY_Georgian_on }, + { "Georgian_par", XKB_KEY_Georgian_par }, + { "Georgian_zhar", XKB_KEY_Georgian_zhar }, + { "Georgian_rae", XKB_KEY_Georgian_rae }, + { "Georgian_san", XKB_KEY_Georgian_san }, + { "Georgian_tar", XKB_KEY_Georgian_tar }, + { "Georgian_un", XKB_KEY_Georgian_un }, + { "Georgian_phar", XKB_KEY_Georgian_phar }, + { "Georgian_khar", XKB_KEY_Georgian_khar }, + { "Georgian_ghan", XKB_KEY_Georgian_ghan }, + { "Georgian_qar", XKB_KEY_Georgian_qar }, + { "Georgian_shin", XKB_KEY_Georgian_shin }, + { "Georgian_chin", XKB_KEY_Georgian_chin }, + { "Georgian_can", XKB_KEY_Georgian_can }, + { "Georgian_jil", XKB_KEY_Georgian_jil }, + { "Georgian_cil", XKB_KEY_Georgian_cil }, + { "Georgian_char", XKB_KEY_Georgian_char }, + { "Georgian_xan", XKB_KEY_Georgian_xan }, + { "Georgian_jhan", XKB_KEY_Georgian_jhan }, + { "Georgian_hae", XKB_KEY_Georgian_hae }, + { "Georgian_he", XKB_KEY_Georgian_he }, + { "Georgian_hie", XKB_KEY_Georgian_hie }, + { "Georgian_we", XKB_KEY_Georgian_we }, + { "Georgian_har", XKB_KEY_Georgian_har }, + { "Georgian_hoe", XKB_KEY_Georgian_hoe }, + { "Georgian_fi", XKB_KEY_Georgian_fi }, + { "Babovedot", XKB_KEY_Babovedot }, + { "babovedot", XKB_KEY_babovedot }, + { "Dabovedot", XKB_KEY_Dabovedot }, + { "dabovedot", XKB_KEY_dabovedot }, + { "Fabovedot", XKB_KEY_Fabovedot }, + { "fabovedot", XKB_KEY_fabovedot }, + { "Lbelowdot", XKB_KEY_Lbelowdot }, + { "lbelowdot", XKB_KEY_lbelowdot }, + { "Mabovedot", XKB_KEY_Mabovedot }, + { "mabovedot", XKB_KEY_mabovedot }, + { "Pabovedot", XKB_KEY_Pabovedot }, + { "pabovedot", XKB_KEY_pabovedot }, + { "Sabovedot", XKB_KEY_Sabovedot }, + { "sabovedot", XKB_KEY_sabovedot }, + { "Tabovedot", XKB_KEY_Tabovedot }, + { "tabovedot", XKB_KEY_tabovedot }, + { "Wgrave", XKB_KEY_Wgrave }, + { "wgrave", XKB_KEY_wgrave }, + { "Wacute", XKB_KEY_Wacute }, + { "wacute", XKB_KEY_wacute }, + { "Wdiaeresis", XKB_KEY_Wdiaeresis }, + { "wdiaeresis", XKB_KEY_wdiaeresis }, + { "Xabovedot", XKB_KEY_Xabovedot }, + { "xabovedot", XKB_KEY_xabovedot }, + { "Abelowdot", XKB_KEY_Abelowdot }, + { "abelowdot", XKB_KEY_abelowdot }, + { "Ahook", XKB_KEY_Ahook }, + { "ahook", XKB_KEY_ahook }, + { "Acircumflexacute", XKB_KEY_Acircumflexacute }, + { "acircumflexacute", XKB_KEY_acircumflexacute }, + { "Acircumflexgrave", XKB_KEY_Acircumflexgrave }, + { "acircumflexgrave", XKB_KEY_acircumflexgrave }, + { "Acircumflexhook", XKB_KEY_Acircumflexhook }, + { "acircumflexhook", XKB_KEY_acircumflexhook }, + { "Acircumflextilde", XKB_KEY_Acircumflextilde }, + { "acircumflextilde", XKB_KEY_acircumflextilde }, + { "Acircumflexbelowdot", XKB_KEY_Acircumflexbelowdot }, + { "acircumflexbelowdot", XKB_KEY_acircumflexbelowdot }, + { "Abreveacute", XKB_KEY_Abreveacute }, + { "abreveacute", XKB_KEY_abreveacute }, + { "Abrevegrave", XKB_KEY_Abrevegrave }, + { "abrevegrave", XKB_KEY_abrevegrave }, + { "Abrevehook", XKB_KEY_Abrevehook }, + { "abrevehook", XKB_KEY_abrevehook }, + { "Abrevetilde", XKB_KEY_Abrevetilde }, + { "abrevetilde", XKB_KEY_abrevetilde }, + { "Abrevebelowdot", XKB_KEY_Abrevebelowdot }, + { "abrevebelowdot", XKB_KEY_abrevebelowdot }, + { "Ebelowdot", XKB_KEY_Ebelowdot }, + { "ebelowdot", XKB_KEY_ebelowdot }, + { "Ehook", XKB_KEY_Ehook }, + { "ehook", XKB_KEY_ehook }, + { "Etilde", XKB_KEY_Etilde }, + { "etilde", XKB_KEY_etilde }, + { "Ecircumflexacute", XKB_KEY_Ecircumflexacute }, + { "ecircumflexacute", XKB_KEY_ecircumflexacute }, + { "Ecircumflexgrave", XKB_KEY_Ecircumflexgrave }, + { "ecircumflexgrave", XKB_KEY_ecircumflexgrave }, + { "Ecircumflexhook", XKB_KEY_Ecircumflexhook }, + { "ecircumflexhook", XKB_KEY_ecircumflexhook }, + { "Ecircumflextilde", XKB_KEY_Ecircumflextilde }, + { "ecircumflextilde", XKB_KEY_ecircumflextilde }, + { "Ecircumflexbelowdot", XKB_KEY_Ecircumflexbelowdot }, + { "ecircumflexbelowdot", XKB_KEY_ecircumflexbelowdot }, + { "Ihook", XKB_KEY_Ihook }, + { "ihook", XKB_KEY_ihook }, + { "Ibelowdot", XKB_KEY_Ibelowdot }, + { "ibelowdot", XKB_KEY_ibelowdot }, + { "Obelowdot", XKB_KEY_Obelowdot }, + { "obelowdot", XKB_KEY_obelowdot }, + { "Ohook", XKB_KEY_Ohook }, + { "ohook", XKB_KEY_ohook }, + { "Ocircumflexacute", XKB_KEY_Ocircumflexacute }, + { "ocircumflexacute", XKB_KEY_ocircumflexacute }, + { "Ocircumflexgrave", XKB_KEY_Ocircumflexgrave }, + { "ocircumflexgrave", XKB_KEY_ocircumflexgrave }, + { "Ocircumflexhook", XKB_KEY_Ocircumflexhook }, + { "ocircumflexhook", XKB_KEY_ocircumflexhook }, + { "Ocircumflextilde", XKB_KEY_Ocircumflextilde }, + { "ocircumflextilde", XKB_KEY_ocircumflextilde }, + { "Ocircumflexbelowdot", XKB_KEY_Ocircumflexbelowdot }, + { "ocircumflexbelowdot", XKB_KEY_ocircumflexbelowdot }, + { "Ohornacute", XKB_KEY_Ohornacute }, + { "ohornacute", XKB_KEY_ohornacute }, + { "Ohorngrave", XKB_KEY_Ohorngrave }, + { "ohorngrave", XKB_KEY_ohorngrave }, + { "Ohornhook", XKB_KEY_Ohornhook }, + { "ohornhook", XKB_KEY_ohornhook }, + { "Ohorntilde", XKB_KEY_Ohorntilde }, + { "ohorntilde", XKB_KEY_ohorntilde }, + { "Ohornbelowdot", XKB_KEY_Ohornbelowdot }, + { "ohornbelowdot", XKB_KEY_ohornbelowdot }, + { "Ubelowdot", XKB_KEY_Ubelowdot }, + { "ubelowdot", XKB_KEY_ubelowdot }, + { "Uhook", XKB_KEY_Uhook }, + { "uhook", XKB_KEY_uhook }, + { "Uhornacute", XKB_KEY_Uhornacute }, + { "uhornacute", XKB_KEY_uhornacute }, + { "Uhorngrave", XKB_KEY_Uhorngrave }, + { "uhorngrave", XKB_KEY_uhorngrave }, + { "Uhornhook", XKB_KEY_Uhornhook }, + { "uhornhook", XKB_KEY_uhornhook }, + { "Uhorntilde", XKB_KEY_Uhorntilde }, + { "uhorntilde", XKB_KEY_uhorntilde }, + { "Uhornbelowdot", XKB_KEY_Uhornbelowdot }, + { "uhornbelowdot", XKB_KEY_uhornbelowdot }, + { "Ygrave", XKB_KEY_Ygrave }, + { "ygrave", XKB_KEY_ygrave }, + { "Ybelowdot", XKB_KEY_Ybelowdot }, + { "ybelowdot", XKB_KEY_ybelowdot }, + { "Yhook", XKB_KEY_Yhook }, + { "yhook", XKB_KEY_yhook }, + { "Ytilde", XKB_KEY_Ytilde }, + { "ytilde", XKB_KEY_ytilde }, + { "zerosuperior", XKB_KEY_zerosuperior }, + { "foursuperior", XKB_KEY_foursuperior }, + { "fivesuperior", XKB_KEY_fivesuperior }, + { "sixsuperior", XKB_KEY_sixsuperior }, + { "sevensuperior", XKB_KEY_sevensuperior }, + { "eightsuperior", XKB_KEY_eightsuperior }, + { "ninesuperior", XKB_KEY_ninesuperior }, + { "zerosubscript", XKB_KEY_zerosubscript }, + { "onesubscript", XKB_KEY_onesubscript }, + { "twosubscript", XKB_KEY_twosubscript }, + { "threesubscript", XKB_KEY_threesubscript }, + { "foursubscript", XKB_KEY_foursubscript }, + { "fivesubscript", XKB_KEY_fivesubscript }, + { "sixsubscript", XKB_KEY_sixsubscript }, + { "sevensubscript", XKB_KEY_sevensubscript }, + { "eightsubscript", XKB_KEY_eightsubscript }, + { "ninesubscript", XKB_KEY_ninesubscript }, + { "EcuSign", XKB_KEY_EcuSign }, + { "ColonSign", XKB_KEY_ColonSign }, + { "CruzeiroSign", XKB_KEY_CruzeiroSign }, + { "FFrancSign", XKB_KEY_FFrancSign }, + { "LiraSign", XKB_KEY_LiraSign }, + { "MillSign", XKB_KEY_MillSign }, + { "NairaSign", XKB_KEY_NairaSign }, + { "PesetaSign", XKB_KEY_PesetaSign }, + { "RupeeSign", XKB_KEY_RupeeSign }, + { "WonSign", XKB_KEY_WonSign }, + { "NewSheqelSign", XKB_KEY_NewSheqelSign }, + { "DongSign", XKB_KEY_DongSign }, + { "partdifferential", XKB_KEY_partdifferential }, + { "emptyset", XKB_KEY_emptyset }, + { "elementof", XKB_KEY_elementof }, + { "notelementof", XKB_KEY_notelementof }, + { "containsas", XKB_KEY_containsas }, + { "squareroot", XKB_KEY_squareroot }, + { "cuberoot", XKB_KEY_cuberoot }, + { "fourthroot", XKB_KEY_fourthroot }, + { "dintegral", XKB_KEY_dintegral }, + { "tintegral", XKB_KEY_tintegral }, + { "because", XKB_KEY_because }, + { "notapproxeq", XKB_KEY_notapproxeq }, + { "approxeq", XKB_KEY_approxeq }, + { "notidentical", XKB_KEY_notidentical }, + { "stricteq", XKB_KEY_stricteq }, + { "braille_blank", XKB_KEY_braille_blank }, + { "braille_dots_1", XKB_KEY_braille_dots_1 }, + { "braille_dots_2", XKB_KEY_braille_dots_2 }, + { "braille_dots_12", XKB_KEY_braille_dots_12 }, + { "braille_dots_3", XKB_KEY_braille_dots_3 }, + { "braille_dots_13", XKB_KEY_braille_dots_13 }, + { "braille_dots_23", XKB_KEY_braille_dots_23 }, + { "braille_dots_123", XKB_KEY_braille_dots_123 }, + { "braille_dots_4", XKB_KEY_braille_dots_4 }, + { "braille_dots_14", XKB_KEY_braille_dots_14 }, + { "braille_dots_24", XKB_KEY_braille_dots_24 }, + { "braille_dots_124", XKB_KEY_braille_dots_124 }, + { "braille_dots_34", XKB_KEY_braille_dots_34 }, + { "braille_dots_134", XKB_KEY_braille_dots_134 }, + { "braille_dots_234", XKB_KEY_braille_dots_234 }, + { "braille_dots_1234", XKB_KEY_braille_dots_1234 }, + { "braille_dots_5", XKB_KEY_braille_dots_5 }, + { "braille_dots_15", XKB_KEY_braille_dots_15 }, + { "braille_dots_25", XKB_KEY_braille_dots_25 }, + { "braille_dots_125", XKB_KEY_braille_dots_125 }, + { "braille_dots_35", XKB_KEY_braille_dots_35 }, + { "braille_dots_135", XKB_KEY_braille_dots_135 }, + { "braille_dots_235", XKB_KEY_braille_dots_235 }, + { "braille_dots_1235", XKB_KEY_braille_dots_1235 }, + { "braille_dots_45", XKB_KEY_braille_dots_45 }, + { "braille_dots_145", XKB_KEY_braille_dots_145 }, + { "braille_dots_245", XKB_KEY_braille_dots_245 }, + { "braille_dots_1245", XKB_KEY_braille_dots_1245 }, + { "braille_dots_345", XKB_KEY_braille_dots_345 }, + { "braille_dots_1345", XKB_KEY_braille_dots_1345 }, + { "braille_dots_2345", XKB_KEY_braille_dots_2345 }, + { "braille_dots_12345", XKB_KEY_braille_dots_12345 }, + { "braille_dots_6", XKB_KEY_braille_dots_6 }, + { "braille_dots_16", XKB_KEY_braille_dots_16 }, + { "braille_dots_26", XKB_KEY_braille_dots_26 }, + { "braille_dots_126", XKB_KEY_braille_dots_126 }, + { "braille_dots_36", XKB_KEY_braille_dots_36 }, + { "braille_dots_136", XKB_KEY_braille_dots_136 }, + { "braille_dots_236", XKB_KEY_braille_dots_236 }, + { "braille_dots_1236", XKB_KEY_braille_dots_1236 }, + { "braille_dots_46", XKB_KEY_braille_dots_46 }, + { "braille_dots_146", XKB_KEY_braille_dots_146 }, + { "braille_dots_246", XKB_KEY_braille_dots_246 }, + { "braille_dots_1246", XKB_KEY_braille_dots_1246 }, + { "braille_dots_346", XKB_KEY_braille_dots_346 }, + { "braille_dots_1346", XKB_KEY_braille_dots_1346 }, + { "braille_dots_2346", XKB_KEY_braille_dots_2346 }, + { "braille_dots_12346", XKB_KEY_braille_dots_12346 }, + { "braille_dots_56", XKB_KEY_braille_dots_56 }, + { "braille_dots_156", XKB_KEY_braille_dots_156 }, + { "braille_dots_256", XKB_KEY_braille_dots_256 }, + { "braille_dots_1256", XKB_KEY_braille_dots_1256 }, + { "braille_dots_356", XKB_KEY_braille_dots_356 }, + { "braille_dots_1356", XKB_KEY_braille_dots_1356 }, + { "braille_dots_2356", XKB_KEY_braille_dots_2356 }, + { "braille_dots_12356", XKB_KEY_braille_dots_12356 }, + { "braille_dots_456", XKB_KEY_braille_dots_456 }, + { "braille_dots_1456", XKB_KEY_braille_dots_1456 }, + { "braille_dots_2456", XKB_KEY_braille_dots_2456 }, + { "braille_dots_12456", XKB_KEY_braille_dots_12456 }, + { "braille_dots_3456", XKB_KEY_braille_dots_3456 }, + { "braille_dots_13456", XKB_KEY_braille_dots_13456 }, + { "braille_dots_23456", XKB_KEY_braille_dots_23456 }, + { "braille_dots_123456", XKB_KEY_braille_dots_123456 }, + { "braille_dots_7", XKB_KEY_braille_dots_7 }, + { "braille_dots_17", XKB_KEY_braille_dots_17 }, + { "braille_dots_27", XKB_KEY_braille_dots_27 }, + { "braille_dots_127", XKB_KEY_braille_dots_127 }, + { "braille_dots_37", XKB_KEY_braille_dots_37 }, + { "braille_dots_137", XKB_KEY_braille_dots_137 }, + { "braille_dots_237", XKB_KEY_braille_dots_237 }, + { "braille_dots_1237", XKB_KEY_braille_dots_1237 }, + { "braille_dots_47", XKB_KEY_braille_dots_47 }, + { "braille_dots_147", XKB_KEY_braille_dots_147 }, + { "braille_dots_247", XKB_KEY_braille_dots_247 }, + { "braille_dots_1247", XKB_KEY_braille_dots_1247 }, + { "braille_dots_347", XKB_KEY_braille_dots_347 }, + { "braille_dots_1347", XKB_KEY_braille_dots_1347 }, + { "braille_dots_2347", XKB_KEY_braille_dots_2347 }, + { "braille_dots_12347", XKB_KEY_braille_dots_12347 }, + { "braille_dots_57", XKB_KEY_braille_dots_57 }, + { "braille_dots_157", XKB_KEY_braille_dots_157 }, + { "braille_dots_257", XKB_KEY_braille_dots_257 }, + { "braille_dots_1257", XKB_KEY_braille_dots_1257 }, + { "braille_dots_357", XKB_KEY_braille_dots_357 }, + { "braille_dots_1357", XKB_KEY_braille_dots_1357 }, + { "braille_dots_2357", XKB_KEY_braille_dots_2357 }, + { "braille_dots_12357", XKB_KEY_braille_dots_12357 }, + { "braille_dots_457", XKB_KEY_braille_dots_457 }, + { "braille_dots_1457", XKB_KEY_braille_dots_1457 }, + { "braille_dots_2457", XKB_KEY_braille_dots_2457 }, + { "braille_dots_12457", XKB_KEY_braille_dots_12457 }, + { "braille_dots_3457", XKB_KEY_braille_dots_3457 }, + { "braille_dots_13457", XKB_KEY_braille_dots_13457 }, + { "braille_dots_23457", XKB_KEY_braille_dots_23457 }, + { "braille_dots_123457", XKB_KEY_braille_dots_123457 }, + { "braille_dots_67", XKB_KEY_braille_dots_67 }, + { "braille_dots_167", XKB_KEY_braille_dots_167 }, + { "braille_dots_267", XKB_KEY_braille_dots_267 }, + { "braille_dots_1267", XKB_KEY_braille_dots_1267 }, + { "braille_dots_367", XKB_KEY_braille_dots_367 }, + { "braille_dots_1367", XKB_KEY_braille_dots_1367 }, + { "braille_dots_2367", XKB_KEY_braille_dots_2367 }, + { "braille_dots_12367", XKB_KEY_braille_dots_12367 }, + { "braille_dots_467", XKB_KEY_braille_dots_467 }, + { "braille_dots_1467", XKB_KEY_braille_dots_1467 }, + { "braille_dots_2467", XKB_KEY_braille_dots_2467 }, + { "braille_dots_12467", XKB_KEY_braille_dots_12467 }, + { "braille_dots_3467", XKB_KEY_braille_dots_3467 }, + { "braille_dots_13467", XKB_KEY_braille_dots_13467 }, + { "braille_dots_23467", XKB_KEY_braille_dots_23467 }, + { "braille_dots_123467", XKB_KEY_braille_dots_123467 }, + { "braille_dots_567", XKB_KEY_braille_dots_567 }, + { "braille_dots_1567", XKB_KEY_braille_dots_1567 }, + { "braille_dots_2567", XKB_KEY_braille_dots_2567 }, + { "braille_dots_12567", XKB_KEY_braille_dots_12567 }, + { "braille_dots_3567", XKB_KEY_braille_dots_3567 }, + { "braille_dots_13567", XKB_KEY_braille_dots_13567 }, + { "braille_dots_23567", XKB_KEY_braille_dots_23567 }, + { "braille_dots_123567", XKB_KEY_braille_dots_123567 }, + { "braille_dots_4567", XKB_KEY_braille_dots_4567 }, + { "braille_dots_14567", XKB_KEY_braille_dots_14567 }, + { "braille_dots_24567", XKB_KEY_braille_dots_24567 }, + { "braille_dots_124567", XKB_KEY_braille_dots_124567 }, + { "braille_dots_34567", XKB_KEY_braille_dots_34567 }, + { "braille_dots_134567", XKB_KEY_braille_dots_134567 }, + { "braille_dots_234567", XKB_KEY_braille_dots_234567 }, + { "braille_dots_1234567", XKB_KEY_braille_dots_1234567 }, + { "braille_dots_8", XKB_KEY_braille_dots_8 }, + { "braille_dots_18", XKB_KEY_braille_dots_18 }, + { "braille_dots_28", XKB_KEY_braille_dots_28 }, + { "braille_dots_128", XKB_KEY_braille_dots_128 }, + { "braille_dots_38", XKB_KEY_braille_dots_38 }, + { "braille_dots_138", XKB_KEY_braille_dots_138 }, + { "braille_dots_238", XKB_KEY_braille_dots_238 }, + { "braille_dots_1238", XKB_KEY_braille_dots_1238 }, + { "braille_dots_48", XKB_KEY_braille_dots_48 }, + { "braille_dots_148", XKB_KEY_braille_dots_148 }, + { "braille_dots_248", XKB_KEY_braille_dots_248 }, + { "braille_dots_1248", XKB_KEY_braille_dots_1248 }, + { "braille_dots_348", XKB_KEY_braille_dots_348 }, + { "braille_dots_1348", XKB_KEY_braille_dots_1348 }, + { "braille_dots_2348", XKB_KEY_braille_dots_2348 }, + { "braille_dots_12348", XKB_KEY_braille_dots_12348 }, + { "braille_dots_58", XKB_KEY_braille_dots_58 }, + { "braille_dots_158", XKB_KEY_braille_dots_158 }, + { "braille_dots_258", XKB_KEY_braille_dots_258 }, + { "braille_dots_1258", XKB_KEY_braille_dots_1258 }, + { "braille_dots_358", XKB_KEY_braille_dots_358 }, + { "braille_dots_1358", XKB_KEY_braille_dots_1358 }, + { "braille_dots_2358", XKB_KEY_braille_dots_2358 }, + { "braille_dots_12358", XKB_KEY_braille_dots_12358 }, + { "braille_dots_458", XKB_KEY_braille_dots_458 }, + { "braille_dots_1458", XKB_KEY_braille_dots_1458 }, + { "braille_dots_2458", XKB_KEY_braille_dots_2458 }, + { "braille_dots_12458", XKB_KEY_braille_dots_12458 }, + { "braille_dots_3458", XKB_KEY_braille_dots_3458 }, + { "braille_dots_13458", XKB_KEY_braille_dots_13458 }, + { "braille_dots_23458", XKB_KEY_braille_dots_23458 }, + { "braille_dots_123458", XKB_KEY_braille_dots_123458 }, + { "braille_dots_68", XKB_KEY_braille_dots_68 }, + { "braille_dots_168", XKB_KEY_braille_dots_168 }, + { "braille_dots_268", XKB_KEY_braille_dots_268 }, + { "braille_dots_1268", XKB_KEY_braille_dots_1268 }, + { "braille_dots_368", XKB_KEY_braille_dots_368 }, + { "braille_dots_1368", XKB_KEY_braille_dots_1368 }, + { "braille_dots_2368", XKB_KEY_braille_dots_2368 }, + { "braille_dots_12368", XKB_KEY_braille_dots_12368 }, + { "braille_dots_468", XKB_KEY_braille_dots_468 }, + { "braille_dots_1468", XKB_KEY_braille_dots_1468 }, + { "braille_dots_2468", XKB_KEY_braille_dots_2468 }, + { "braille_dots_12468", XKB_KEY_braille_dots_12468 }, + { "braille_dots_3468", XKB_KEY_braille_dots_3468 }, + { "braille_dots_13468", XKB_KEY_braille_dots_13468 }, + { "braille_dots_23468", XKB_KEY_braille_dots_23468 }, + { "braille_dots_123468", XKB_KEY_braille_dots_123468 }, + { "braille_dots_568", XKB_KEY_braille_dots_568 }, + { "braille_dots_1568", XKB_KEY_braille_dots_1568 }, + { "braille_dots_2568", XKB_KEY_braille_dots_2568 }, + { "braille_dots_12568", XKB_KEY_braille_dots_12568 }, + { "braille_dots_3568", XKB_KEY_braille_dots_3568 }, + { "braille_dots_13568", XKB_KEY_braille_dots_13568 }, + { "braille_dots_23568", XKB_KEY_braille_dots_23568 }, + { "braille_dots_123568", XKB_KEY_braille_dots_123568 }, + { "braille_dots_4568", XKB_KEY_braille_dots_4568 }, + { "braille_dots_14568", XKB_KEY_braille_dots_14568 }, + { "braille_dots_24568", XKB_KEY_braille_dots_24568 }, + { "braille_dots_124568", XKB_KEY_braille_dots_124568 }, + { "braille_dots_34568", XKB_KEY_braille_dots_34568 }, + { "braille_dots_134568", XKB_KEY_braille_dots_134568 }, + { "braille_dots_234568", XKB_KEY_braille_dots_234568 }, + { "braille_dots_1234568", XKB_KEY_braille_dots_1234568 }, + { "braille_dots_78", XKB_KEY_braille_dots_78 }, + { "braille_dots_178", XKB_KEY_braille_dots_178 }, + { "braille_dots_278", XKB_KEY_braille_dots_278 }, + { "braille_dots_1278", XKB_KEY_braille_dots_1278 }, + { "braille_dots_378", XKB_KEY_braille_dots_378 }, + { "braille_dots_1378", XKB_KEY_braille_dots_1378 }, + { "braille_dots_2378", XKB_KEY_braille_dots_2378 }, + { "braille_dots_12378", XKB_KEY_braille_dots_12378 }, + { "braille_dots_478", XKB_KEY_braille_dots_478 }, + { "braille_dots_1478", XKB_KEY_braille_dots_1478 }, + { "braille_dots_2478", XKB_KEY_braille_dots_2478 }, + { "braille_dots_12478", XKB_KEY_braille_dots_12478 }, + { "braille_dots_3478", XKB_KEY_braille_dots_3478 }, + { "braille_dots_13478", XKB_KEY_braille_dots_13478 }, + { "braille_dots_23478", XKB_KEY_braille_dots_23478 }, + { "braille_dots_123478", XKB_KEY_braille_dots_123478 }, + { "braille_dots_578", XKB_KEY_braille_dots_578 }, + { "braille_dots_1578", XKB_KEY_braille_dots_1578 }, + { "braille_dots_2578", XKB_KEY_braille_dots_2578 }, + { "braille_dots_12578", XKB_KEY_braille_dots_12578 }, + { "braille_dots_3578", XKB_KEY_braille_dots_3578 }, + { "braille_dots_13578", XKB_KEY_braille_dots_13578 }, + { "braille_dots_23578", XKB_KEY_braille_dots_23578 }, + { "braille_dots_123578", XKB_KEY_braille_dots_123578 }, + { "braille_dots_4578", XKB_KEY_braille_dots_4578 }, + { "braille_dots_14578", XKB_KEY_braille_dots_14578 }, + { "braille_dots_24578", XKB_KEY_braille_dots_24578 }, + { "braille_dots_124578", XKB_KEY_braille_dots_124578 }, + { "braille_dots_34578", XKB_KEY_braille_dots_34578 }, + { "braille_dots_134578", XKB_KEY_braille_dots_134578 }, + { "braille_dots_234578", XKB_KEY_braille_dots_234578 }, + { "braille_dots_1234578", XKB_KEY_braille_dots_1234578 }, + { "braille_dots_678", XKB_KEY_braille_dots_678 }, + { "braille_dots_1678", XKB_KEY_braille_dots_1678 }, + { "braille_dots_2678", XKB_KEY_braille_dots_2678 }, + { "braille_dots_12678", XKB_KEY_braille_dots_12678 }, + { "braille_dots_3678", XKB_KEY_braille_dots_3678 }, + { "braille_dots_13678", XKB_KEY_braille_dots_13678 }, + { "braille_dots_23678", XKB_KEY_braille_dots_23678 }, + { "braille_dots_123678", XKB_KEY_braille_dots_123678 }, + { "braille_dots_4678", XKB_KEY_braille_dots_4678 }, + { "braille_dots_14678", XKB_KEY_braille_dots_14678 }, + { "braille_dots_24678", XKB_KEY_braille_dots_24678 }, + { "braille_dots_124678", XKB_KEY_braille_dots_124678 }, + { "braille_dots_34678", XKB_KEY_braille_dots_34678 }, + { "braille_dots_134678", XKB_KEY_braille_dots_134678 }, + { "braille_dots_234678", XKB_KEY_braille_dots_234678 }, + { "braille_dots_1234678", XKB_KEY_braille_dots_1234678 }, + { "braille_dots_5678", XKB_KEY_braille_dots_5678 }, + { "braille_dots_15678", XKB_KEY_braille_dots_15678 }, + { "braille_dots_25678", XKB_KEY_braille_dots_25678 }, + { "braille_dots_125678", XKB_KEY_braille_dots_125678 }, + { "braille_dots_35678", XKB_KEY_braille_dots_35678 }, + { "braille_dots_135678", XKB_KEY_braille_dots_135678 }, + { "braille_dots_235678", XKB_KEY_braille_dots_235678 }, + { "braille_dots_1235678", XKB_KEY_braille_dots_1235678 }, + { "braille_dots_45678", XKB_KEY_braille_dots_45678 }, + { "braille_dots_145678", XKB_KEY_braille_dots_145678 }, + { "braille_dots_245678", XKB_KEY_braille_dots_245678 }, + { "braille_dots_1245678", XKB_KEY_braille_dots_1245678 }, + { "braille_dots_345678", XKB_KEY_braille_dots_345678 }, + { "braille_dots_1345678", XKB_KEY_braille_dots_1345678 }, + { "braille_dots_2345678", XKB_KEY_braille_dots_2345678 }, + { "braille_dots_12345678", XKB_KEY_braille_dots_12345678 }, + { "hpmute_acute", XKB_KEY_hpmute_acute }, + { "hpmute_grave", XKB_KEY_hpmute_grave }, + { "hpmute_asciicircum", XKB_KEY_hpmute_asciicircum }, + { "hpmute_diaeresis", XKB_KEY_hpmute_diaeresis }, + { "hpmute_asciitilde", XKB_KEY_hpmute_asciitilde }, + { "hplira", XKB_KEY_hplira }, + { "hpguilder", XKB_KEY_hpguilder }, + { "hpYdiaeresis", XKB_KEY_hpYdiaeresis }, + { "hplongminus", XKB_KEY_hplongminus }, + { "hpblock", XKB_KEY_hpblock }, + { "Ddiaeresis", XKB_KEY_Ddiaeresis }, + { "Dacute_accent", XKB_KEY_Dacute_accent }, + { "Dcedilla_accent", XKB_KEY_Dcedilla_accent }, + { "Dcircumflex_accent", XKB_KEY_Dcircumflex_accent }, + { "Dgrave_accent", XKB_KEY_Dgrave_accent }, + { "Dtilde", XKB_KEY_Dtilde }, + { "Dring_accent", XKB_KEY_Dring_accent }, + { "DRemove", XKB_KEY_DRemove }, + { "hpModelock1", XKB_KEY_hpModelock1 }, + { "hpModelock2", XKB_KEY_hpModelock2 }, + { "hpReset", XKB_KEY_hpReset }, + { "hpSystem", XKB_KEY_hpSystem }, + { "hpUser", XKB_KEY_hpUser }, + { "hpClearLine", XKB_KEY_hpClearLine }, + { "hpInsertLine", XKB_KEY_hpInsertLine }, + { "hpDeleteLine", XKB_KEY_hpDeleteLine }, + { "hpInsertChar", XKB_KEY_hpInsertChar }, + { "hpDeleteChar", XKB_KEY_hpDeleteChar }, + { "hpBackTab", XKB_KEY_hpBackTab }, + { "hpKP_BackTab", XKB_KEY_hpKP_BackTab }, + { "Ext16bit_L", XKB_KEY_Ext16bit_L }, + { "Ext16bit_R", XKB_KEY_Ext16bit_R }, + { "osfCopy", XKB_KEY_osfCopy }, + { "osfCut", XKB_KEY_osfCut }, + { "osfPaste", XKB_KEY_osfPaste }, + { "osfBackTab", XKB_KEY_osfBackTab }, + { "osfBackSpace", XKB_KEY_osfBackSpace }, + { "osfClear", XKB_KEY_osfClear }, + { "osfEscape", XKB_KEY_osfEscape }, + { "osfAddMode", XKB_KEY_osfAddMode }, + { "osfPrimaryPaste", XKB_KEY_osfPrimaryPaste }, + { "osfQuickPaste", XKB_KEY_osfQuickPaste }, + { "osfPageLeft", XKB_KEY_osfPageLeft }, + { "osfPageUp", XKB_KEY_osfPageUp }, + { "osfPageDown", XKB_KEY_osfPageDown }, + { "osfPageRight", XKB_KEY_osfPageRight }, + { "osfActivate", XKB_KEY_osfActivate }, + { "osfMenuBar", XKB_KEY_osfMenuBar }, + { "osfLeft", XKB_KEY_osfLeft }, + { "osfUp", XKB_KEY_osfUp }, + { "osfRight", XKB_KEY_osfRight }, + { "osfDown", XKB_KEY_osfDown }, + { "osfEndLine", XKB_KEY_osfEndLine }, + { "osfBeginLine", XKB_KEY_osfBeginLine }, + { "osfEndData", XKB_KEY_osfEndData }, + { "osfBeginData", XKB_KEY_osfBeginData }, + { "osfPrevMenu", XKB_KEY_osfPrevMenu }, + { "osfNextMenu", XKB_KEY_osfNextMenu }, + { "osfPrevField", XKB_KEY_osfPrevField }, + { "osfNextField", XKB_KEY_osfNextField }, + { "osfSelect", XKB_KEY_osfSelect }, + { "osfInsert", XKB_KEY_osfInsert }, + { "osfUndo", XKB_KEY_osfUndo }, + { "osfMenu", XKB_KEY_osfMenu }, + { "osfCancel", XKB_KEY_osfCancel }, + { "osfHelp", XKB_KEY_osfHelp }, + { "osfSelectAll", XKB_KEY_osfSelectAll }, + { "osfDeselectAll", XKB_KEY_osfDeselectAll }, + { "osfReselect", XKB_KEY_osfReselect }, + { "osfExtend", XKB_KEY_osfExtend }, + { "osfRestore", XKB_KEY_osfRestore }, + { "osfDelete", XKB_KEY_osfDelete }, + { "SunFA_Grave", XKB_KEY_SunFA_Grave }, + { "SunFA_Circum", XKB_KEY_SunFA_Circum }, + { "SunFA_Tilde", XKB_KEY_SunFA_Tilde }, + { "SunFA_Acute", XKB_KEY_SunFA_Acute }, + { "SunFA_Diaeresis", XKB_KEY_SunFA_Diaeresis }, + { "SunFA_Cedilla", XKB_KEY_SunFA_Cedilla }, + { "SunF36", XKB_KEY_SunF36 }, + { "SunF37", XKB_KEY_SunF37 }, + { "SunSys_Req", XKB_KEY_SunSys_Req }, + { "SunProps", XKB_KEY_SunProps }, + { "SunFront", XKB_KEY_SunFront }, + { "SunCopy", XKB_KEY_SunCopy }, + { "SunOpen", XKB_KEY_SunOpen }, + { "SunPaste", XKB_KEY_SunPaste }, + { "SunCut", XKB_KEY_SunCut }, + { "SunPowerSwitch", XKB_KEY_SunPowerSwitch }, + { "SunAudioLowerVolume", XKB_KEY_SunAudioLowerVolume }, + { "SunAudioMute", XKB_KEY_SunAudioMute }, + { "SunAudioRaiseVolume", XKB_KEY_SunAudioRaiseVolume }, + { "SunVideoDegauss", XKB_KEY_SunVideoDegauss }, + { "SunVideoLowerBrightness", XKB_KEY_SunVideoLowerBrightness }, + { "SunVideoRaiseBrightness", XKB_KEY_SunVideoRaiseBrightness }, + { "SunPowerSwitchShift", XKB_KEY_SunPowerSwitchShift }, + { "XF86Switch_VT_1", XKB_KEY_XF86Switch_VT_1 }, + { "XF86Switch_VT_2", XKB_KEY_XF86Switch_VT_2 }, + { "XF86Switch_VT_3", XKB_KEY_XF86Switch_VT_3 }, + { "XF86Switch_VT_4", XKB_KEY_XF86Switch_VT_4 }, + { "XF86Switch_VT_5", XKB_KEY_XF86Switch_VT_5 }, + { "XF86Switch_VT_6", XKB_KEY_XF86Switch_VT_6 }, + { "XF86Switch_VT_7", XKB_KEY_XF86Switch_VT_7 }, + { "XF86Switch_VT_8", XKB_KEY_XF86Switch_VT_8 }, + { "XF86Switch_VT_9", XKB_KEY_XF86Switch_VT_9 }, + { "XF86Switch_VT_10", XKB_KEY_XF86Switch_VT_10 }, + { "XF86Switch_VT_11", XKB_KEY_XF86Switch_VT_11 }, + { "XF86Switch_VT_12", XKB_KEY_XF86Switch_VT_12 }, + { "XF86Ungrab", XKB_KEY_XF86Ungrab }, + { "XF86ClearGrab", XKB_KEY_XF86ClearGrab }, + { "XF86Next_VMode", XKB_KEY_XF86Next_VMode }, + { "XF86Prev_VMode", XKB_KEY_XF86Prev_VMode }, + { "XF86LogWindowTree", XKB_KEY_XF86LogWindowTree }, + { "XF86LogGrabInfo", XKB_KEY_XF86LogGrabInfo }, + { "XF86ModeLock", XKB_KEY_XF86ModeLock }, + { "XF86MonBrightnessUp", XKB_KEY_XF86MonBrightnessUp }, + { "XF86MonBrightnessDown", XKB_KEY_XF86MonBrightnessDown }, + { "XF86KbdLightOnOff", XKB_KEY_XF86KbdLightOnOff }, + { "XF86KbdBrightnessUp", XKB_KEY_XF86KbdBrightnessUp }, + { "XF86KbdBrightnessDown", XKB_KEY_XF86KbdBrightnessDown }, + { "XF86Standby", XKB_KEY_XF86Standby }, + { "XF86AudioLowerVolume", XKB_KEY_XF86AudioLowerVolume }, + { "XF86AudioMute", XKB_KEY_XF86AudioMute }, + { "XF86AudioRaiseVolume", XKB_KEY_XF86AudioRaiseVolume }, + { "XF86AudioPlay", XKB_KEY_XF86AudioPlay }, + { "XF86AudioStop", XKB_KEY_XF86AudioStop }, + { "XF86AudioPrev", XKB_KEY_XF86AudioPrev }, + { "XF86AudioNext", XKB_KEY_XF86AudioNext }, + { "XF86HomePage", XKB_KEY_XF86HomePage }, + { "XF86Mail", XKB_KEY_XF86Mail }, + { "XF86Start", XKB_KEY_XF86Start }, + { "XF86Search", XKB_KEY_XF86Search }, + { "XF86AudioRecord", XKB_KEY_XF86AudioRecord }, + { "XF86Calculator", XKB_KEY_XF86Calculator }, + { "XF86Memo", XKB_KEY_XF86Memo }, + { "XF86ToDoList", XKB_KEY_XF86ToDoList }, + { "XF86Calendar", XKB_KEY_XF86Calendar }, + { "XF86PowerDown", XKB_KEY_XF86PowerDown }, + { "XF86ContrastAdjust", XKB_KEY_XF86ContrastAdjust }, + { "XF86RockerUp", XKB_KEY_XF86RockerUp }, + { "XF86RockerDown", XKB_KEY_XF86RockerDown }, + { "XF86RockerEnter", XKB_KEY_XF86RockerEnter }, + { "XF86Back", XKB_KEY_XF86Back }, + { "XF86Forward", XKB_KEY_XF86Forward }, + { "XF86Stop", XKB_KEY_XF86Stop }, + { "XF86Refresh", XKB_KEY_XF86Refresh }, + { "XF86PowerOff", XKB_KEY_XF86PowerOff }, + { "XF86WakeUp", XKB_KEY_XF86WakeUp }, + { "XF86Eject", XKB_KEY_XF86Eject }, + { "XF86ScreenSaver", XKB_KEY_XF86ScreenSaver }, + { "XF86WWW", XKB_KEY_XF86WWW }, + { "XF86Sleep", XKB_KEY_XF86Sleep }, + { "XF86Favorites", XKB_KEY_XF86Favorites }, + { "XF86AudioPause", XKB_KEY_XF86AudioPause }, + { "XF86AudioMedia", XKB_KEY_XF86AudioMedia }, + { "XF86MyComputer", XKB_KEY_XF86MyComputer }, + { "XF86VendorHome", XKB_KEY_XF86VendorHome }, + { "XF86LightBulb", XKB_KEY_XF86LightBulb }, + { "XF86Shop", XKB_KEY_XF86Shop }, + { "XF86History", XKB_KEY_XF86History }, + { "XF86OpenURL", XKB_KEY_XF86OpenURL }, + { "XF86AddFavorite", XKB_KEY_XF86AddFavorite }, + { "XF86HotLinks", XKB_KEY_XF86HotLinks }, + { "XF86BrightnessAdjust", XKB_KEY_XF86BrightnessAdjust }, + { "XF86Finance", XKB_KEY_XF86Finance }, + { "XF86Community", XKB_KEY_XF86Community }, + { "XF86AudioRewind", XKB_KEY_XF86AudioRewind }, + { "XF86BackForward", XKB_KEY_XF86BackForward }, + { "XF86Launch0", XKB_KEY_XF86Launch0 }, + { "XF86Launch1", XKB_KEY_XF86Launch1 }, + { "XF86Launch2", XKB_KEY_XF86Launch2 }, + { "XF86Launch3", XKB_KEY_XF86Launch3 }, + { "XF86Launch4", XKB_KEY_XF86Launch4 }, + { "XF86Launch5", XKB_KEY_XF86Launch5 }, + { "XF86Launch6", XKB_KEY_XF86Launch6 }, + { "XF86Launch7", XKB_KEY_XF86Launch7 }, + { "XF86Launch8", XKB_KEY_XF86Launch8 }, + { "XF86Launch9", XKB_KEY_XF86Launch9 }, + { "XF86LaunchA", XKB_KEY_XF86LaunchA }, + { "XF86LaunchB", XKB_KEY_XF86LaunchB }, + { "XF86LaunchC", XKB_KEY_XF86LaunchC }, + { "XF86LaunchD", XKB_KEY_XF86LaunchD }, + { "XF86LaunchE", XKB_KEY_XF86LaunchE }, + { "XF86LaunchF", XKB_KEY_XF86LaunchF }, + { "XF86ApplicationLeft", XKB_KEY_XF86ApplicationLeft }, + { "XF86ApplicationRight", XKB_KEY_XF86ApplicationRight }, + { "XF86Book", XKB_KEY_XF86Book }, + { "XF86CD", XKB_KEY_XF86CD }, + { "XF86Calculater", XKB_KEY_XF86Calculater }, + { "XF86Clear", XKB_KEY_XF86Clear }, + { "XF86Close", XKB_KEY_XF86Close }, + { "XF86Copy", XKB_KEY_XF86Copy }, + { "XF86Cut", XKB_KEY_XF86Cut }, + { "XF86Display", XKB_KEY_XF86Display }, + { "XF86DOS", XKB_KEY_XF86DOS }, + { "XF86Documents", XKB_KEY_XF86Documents }, + { "XF86Excel", XKB_KEY_XF86Excel }, + { "XF86Explorer", XKB_KEY_XF86Explorer }, + { "XF86Game", XKB_KEY_XF86Game }, + { "XF86Go", XKB_KEY_XF86Go }, + { "XF86iTouch", XKB_KEY_XF86iTouch }, + { "XF86LogOff", XKB_KEY_XF86LogOff }, + { "XF86Market", XKB_KEY_XF86Market }, + { "XF86Meeting", XKB_KEY_XF86Meeting }, + { "XF86MenuKB", XKB_KEY_XF86MenuKB }, + { "XF86MenuPB", XKB_KEY_XF86MenuPB }, + { "XF86MySites", XKB_KEY_XF86MySites }, + { "XF86New", XKB_KEY_XF86New }, + { "XF86News", XKB_KEY_XF86News }, + { "XF86OfficeHome", XKB_KEY_XF86OfficeHome }, + { "XF86Open", XKB_KEY_XF86Open }, + { "XF86Option", XKB_KEY_XF86Option }, + { "XF86Paste", XKB_KEY_XF86Paste }, + { "XF86Phone", XKB_KEY_XF86Phone }, + { "XF86Q", XKB_KEY_XF86Q }, + { "XF86Reply", XKB_KEY_XF86Reply }, + { "XF86Reload", XKB_KEY_XF86Reload }, + { "XF86RotateWindows", XKB_KEY_XF86RotateWindows }, + { "XF86RotationPB", XKB_KEY_XF86RotationPB }, + { "XF86RotationKB", XKB_KEY_XF86RotationKB }, + { "XF86Save", XKB_KEY_XF86Save }, + { "XF86ScrollUp", XKB_KEY_XF86ScrollUp }, + { "XF86ScrollDown", XKB_KEY_XF86ScrollDown }, + { "XF86ScrollClick", XKB_KEY_XF86ScrollClick }, + { "XF86Send", XKB_KEY_XF86Send }, + { "XF86Spell", XKB_KEY_XF86Spell }, + { "XF86SplitScreen", XKB_KEY_XF86SplitScreen }, + { "XF86Support", XKB_KEY_XF86Support }, + { "XF86TaskPane", XKB_KEY_XF86TaskPane }, + { "XF86Terminal", XKB_KEY_XF86Terminal }, + { "XF86Tools", XKB_KEY_XF86Tools }, + { "XF86Travel", XKB_KEY_XF86Travel }, + { "XF86UserPB", XKB_KEY_XF86UserPB }, + { "XF86User1KB", XKB_KEY_XF86User1KB }, + { "XF86User2KB", XKB_KEY_XF86User2KB }, + { "XF86Video", XKB_KEY_XF86Video }, + { "XF86WheelButton", XKB_KEY_XF86WheelButton }, + { "XF86Word", XKB_KEY_XF86Word }, + { "XF86Xfer", XKB_KEY_XF86Xfer }, + { "XF86ZoomIn", XKB_KEY_XF86ZoomIn }, + { "XF86ZoomOut", XKB_KEY_XF86ZoomOut }, + { "XF86Away", XKB_KEY_XF86Away }, + { "XF86Messenger", XKB_KEY_XF86Messenger }, + { "XF86WebCam", XKB_KEY_XF86WebCam }, + { "XF86MailForward", XKB_KEY_XF86MailForward }, + { "XF86Pictures", XKB_KEY_XF86Pictures }, + { "XF86Music", XKB_KEY_XF86Music }, + { "XF86Battery", XKB_KEY_XF86Battery }, + { "XF86Bluetooth", XKB_KEY_XF86Bluetooth }, + { "XF86WLAN", XKB_KEY_XF86WLAN }, + { "XF86UWB", XKB_KEY_XF86UWB }, + { "XF86AudioForward", XKB_KEY_XF86AudioForward }, + { "XF86AudioRepeat", XKB_KEY_XF86AudioRepeat }, + { "XF86AudioRandomPlay", XKB_KEY_XF86AudioRandomPlay }, + { "XF86Subtitle", XKB_KEY_XF86Subtitle }, + { "XF86AudioCycleTrack", XKB_KEY_XF86AudioCycleTrack }, + { "XF86CycleAngle", XKB_KEY_XF86CycleAngle }, + { "XF86FrameBack", XKB_KEY_XF86FrameBack }, + { "XF86FrameForward", XKB_KEY_XF86FrameForward }, + { "XF86Time", XKB_KEY_XF86Time }, + { "XF86Select", XKB_KEY_XF86Select }, + { "XF86View", XKB_KEY_XF86View }, + { "XF86TopMenu", XKB_KEY_XF86TopMenu }, + { "XF86Red", XKB_KEY_XF86Red }, + { "XF86Green", XKB_KEY_XF86Green }, + { "XF86Yellow", XKB_KEY_XF86Yellow }, + { "XF86Blue", XKB_KEY_XF86Blue }, + { "XF86Suspend", XKB_KEY_XF86Suspend }, + { "XF86Hibernate", XKB_KEY_XF86Hibernate }, + { "XF86TouchpadToggle", XKB_KEY_XF86TouchpadToggle }, + { "XF86TouchpadOn", XKB_KEY_XF86TouchpadOn }, + { "XF86TouchpadOff", XKB_KEY_XF86TouchpadOff }, +}; diff --git a/src/3rdparty/xkbcommon/src/state.c b/src/3rdparty/xkbcommon/src/state.c new file mode 100644 index 0000000000..ac4576f5b8 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/state.c @@ -0,0 +1,1144 @@ +/************************************************************ + * Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +/* + * Copyright © 2012 Intel Corporation + * Copyright © 2012 Ran Benita <ran234@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + */ + +/* + * This is a bastardised version of xkbActions.c from the X server which + * does not support, for the moment: + * - AccessX sticky/debounce/etc (will come later) + * - pointer keys (may come later) + * - key redirects (unlikely) + * - messages (very unlikely) + */ + +#include "keymap.h" + +struct xkb_filter { + union xkb_action action; + const struct xkb_key *key; + uint32_t priv; + bool (*func)(struct xkb_state *state, + struct xkb_filter *filter, + const struct xkb_key *key, + enum xkb_key_direction direction); + int refcnt; +}; + +struct state_components { + /* These may be negative, because of -1 group actions. */ + int32_t base_group; /**< depressed */ + int32_t latched_group; + int32_t locked_group; + xkb_layout_index_t group; /**< effective */ + + xkb_mod_mask_t base_mods; /**< depressed */ + xkb_mod_mask_t latched_mods; + xkb_mod_mask_t locked_mods; + xkb_mod_mask_t mods; /**< effective */ + + xkb_led_mask_t leds; +}; + +struct xkb_state { + /* + * Before updating the state, we keep a copy of just this struct. This + * allows us to report which components of the state have changed. + */ + struct state_components components; + + /* + * At each event, we accumulate all the needed modifications to the base + * modifiers, and apply them at the end. These keep track of this state. + */ + xkb_mod_mask_t set_mods; + xkb_mod_mask_t clear_mods; + + /* + * We mustn't clear a base modifier if there's another depressed key + * which affects it, e.g. given this sequence + * < Left Shift down, Right Shift down, Left Shift Up > + * the modifier should still be set. This keeps the count. + */ + int16_t mod_key_count[sizeof(xkb_mod_mask_t) * 8]; + + int refcnt; + darray(struct xkb_filter) filters; + struct xkb_keymap *keymap; +}; + +static const struct xkb_key_type_entry * +get_entry_for_key_state(struct xkb_state *state, const struct xkb_key *key, + xkb_layout_index_t group) +{ + const struct xkb_key_type *type = key->groups[group].type; + xkb_mod_mask_t active_mods = state->components.mods & type->mods.mask; + unsigned int i; + + for (i = 0; i < type->num_entries; i++) { + /* + * If the virtual modifiers are not bound to anything, we're + * supposed to skip the entry (xserver does this with cached + * entry->active field). + */ + if (!type->entries[i].mods.mask) + continue; + + if (type->entries[i].mods.mask == active_mods) + return &type->entries[i]; + } + + return NULL; +} + +/** + * Returns the level to use for the given key and state, or + * XKB_LEVEL_INVALID. + */ +XKB_EXPORT xkb_level_index_t +xkb_state_key_get_level(struct xkb_state *state, xkb_keycode_t kc, + xkb_layout_index_t layout) +{ + const struct xkb_key *key = XkbKey(state->keymap, kc); + const struct xkb_key_type_entry *entry; + + if (!key || layout >= key->num_groups) + return XKB_LEVEL_INVALID; + + /* If we don't find an explicit match the default is 0. */ + entry = get_entry_for_key_state(state, key, layout); + if (!entry) + return 0; + + return entry->level; +} + +xkb_layout_index_t +wrap_group_into_range(int32_t group, + xkb_layout_index_t num_groups, + enum xkb_range_exceed_type out_of_range_group_action, + xkb_layout_index_t out_of_range_group_number) +{ + if (num_groups == 0) + return XKB_LAYOUT_INVALID; + + if (group < num_groups) + return group; + + switch (out_of_range_group_action) { + case RANGE_REDIRECT: + if (out_of_range_group_number >= num_groups) + return 0; + return out_of_range_group_number; + + case RANGE_SATURATE: + if (group < 0) + return 0; + else + return num_groups - 1; + + case RANGE_WRAP: + default: + /* + * C99 says a negative dividend in a modulo operation always + * gives a negative result. + */ + if (group < 0) + return ((int) num_groups + (group % (int) num_groups)); + else + return group % num_groups; + } +} + +/** + * Returns the layout to use for the given key and state, taking + * wrapping/clamping/etc into account, or XKB_LAYOUT_INVALID. + */ +XKB_EXPORT xkb_layout_index_t +xkb_state_key_get_layout(struct xkb_state *state, xkb_keycode_t kc) +{ + const struct xkb_key *key = XkbKey(state->keymap, kc); + + if (!key) + return XKB_LAYOUT_INVALID; + + return wrap_group_into_range(state->components.group, key->num_groups, + key->out_of_range_group_action, + key->out_of_range_group_number); +} + +static const union xkb_action fake = { .type = ACTION_TYPE_NONE }; + +static const union xkb_action * +xkb_key_get_action(struct xkb_state *state, const struct xkb_key *key) +{ + xkb_layout_index_t layout; + xkb_level_index_t level; + + layout = xkb_state_key_get_layout(state, key->keycode); + if (layout == XKB_LAYOUT_INVALID) + return &fake; + + level = xkb_state_key_get_level(state, key->keycode, layout); + if (level == XKB_LEVEL_INVALID) + return &fake; + + return &key->groups[layout].levels[level].action; +} + +static struct xkb_filter * +xkb_filter_new(struct xkb_state *state) +{ + struct xkb_filter *filter = NULL, *iter; + + darray_foreach(iter, state->filters) { + if (iter->func) + continue; + filter = iter; + break; + } + + if (!filter) { + darray_resize0(state->filters, darray_size(state->filters) + 1); + filter = &darray_item(state->filters, darray_size(state->filters) -1); + } + + filter->refcnt = 1; + return filter; +} + +/***====================================================================***/ + +static bool +xkb_filter_group_set_func(struct xkb_state *state, + struct xkb_filter *filter, + const struct xkb_key *key, + enum xkb_key_direction direction) +{ + if (key != filter->key) { + filter->action.group.flags &= ~ACTION_LOCK_CLEAR; + return true; + } + + if (direction == XKB_KEY_DOWN) { + filter->refcnt++; + return false; + } + else if (--filter->refcnt > 0) { + return false; + } + + state->components.base_group = filter->priv; + + if (filter->action.group.flags & ACTION_LOCK_CLEAR) + state->components.locked_group = 0; + + filter->func = NULL; + return true; +} + +static void +xkb_filter_group_set_new(struct xkb_state *state, struct xkb_filter *filter) +{ + filter->priv = state->components.base_group; + if (filter->action.group.flags & ACTION_ABSOLUTE_SWITCH) + state->components.base_group = filter->action.group.group; + else + state->components.base_group += filter->action.group.group; +} + +static bool +xkb_filter_group_lock_func(struct xkb_state *state, + struct xkb_filter *filter, + const struct xkb_key *key, + enum xkb_key_direction direction) +{ + if (key != filter->key) + return true; + + if (direction == XKB_KEY_DOWN) { + filter->refcnt++; + return false; + } + if (--filter->refcnt > 0) + return false; + + filter->func = NULL; + return true; +} + +static void +xkb_filter_group_lock_new(struct xkb_state *state, struct xkb_filter *filter) +{ + if (filter->action.group.flags & ACTION_ABSOLUTE_SWITCH) + state->components.locked_group = filter->action.group.group; + else + state->components.locked_group += filter->action.group.group; +} + +static bool +xkb_filter_mod_set_func(struct xkb_state *state, + struct xkb_filter *filter, + const struct xkb_key *key, + enum xkb_key_direction direction) +{ + if (key != filter->key) { + filter->action.mods.flags &= ~ACTION_LOCK_CLEAR; + return true; + } + + if (direction == XKB_KEY_DOWN) { + filter->refcnt++; + return false; + } + else if (--filter->refcnt > 0) { + return false; + } + + state->clear_mods = filter->action.mods.mods.mask; + if (filter->action.mods.flags & ACTION_LOCK_CLEAR) + state->components.locked_mods &= ~filter->action.mods.mods.mask; + + filter->func = NULL; + return true; +} + +static void +xkb_filter_mod_set_new(struct xkb_state *state, struct xkb_filter *filter) +{ + state->set_mods = filter->action.mods.mods.mask; +} + +static bool +xkb_filter_mod_lock_func(struct xkb_state *state, + struct xkb_filter *filter, + const struct xkb_key *key, + enum xkb_key_direction direction) +{ + if (key != filter->key) + return true; + + if (direction == XKB_KEY_DOWN) { + filter->refcnt++; + return false; + } + if (--filter->refcnt > 0) + return false; + + state->clear_mods |= filter->action.mods.mods.mask; + if (!(filter->action.mods.flags & ACTION_LOCK_NO_UNLOCK)) + state->components.locked_mods &= ~filter->priv; + + filter->func = NULL; + return true; +} + +static void +xkb_filter_mod_lock_new(struct xkb_state *state, struct xkb_filter *filter) +{ + filter->priv = (state->components.locked_mods & + filter->action.mods.mods.mask); + state->set_mods |= filter->action.mods.mods.mask; + if (!(filter->action.mods.flags & ACTION_LOCK_NO_LOCK)) + state->components.locked_mods |= filter->action.mods.mods.mask; +} + +enum xkb_key_latch_state { + NO_LATCH, + LATCH_KEY_DOWN, + LATCH_PENDING, +}; + +static bool +xkb_action_breaks_latch(const union xkb_action *action) +{ + switch (action->type) { + case ACTION_TYPE_NONE: + case ACTION_TYPE_PTR_BUTTON: + case ACTION_TYPE_PTR_LOCK: + case ACTION_TYPE_CTRL_SET: + case ACTION_TYPE_CTRL_LOCK: + case ACTION_TYPE_KEY_REDIRECT: + case ACTION_TYPE_SWITCH_VT: + case ACTION_TYPE_TERMINATE: + return true; + default: + return false; + } +} + +static bool +xkb_filter_mod_latch_func(struct xkb_state *state, + struct xkb_filter *filter, + const struct xkb_key *key, + enum xkb_key_direction direction) +{ + enum xkb_key_latch_state latch = filter->priv; + + if (direction == XKB_KEY_DOWN && latch == LATCH_PENDING) { + /* If this is a new keypress and we're awaiting our single latched + * keypress, then either break the latch if any random key is pressed, + * or promote it to a lock or plain base set if it's the same + * modifier. */ + const union xkb_action *action = xkb_key_get_action(state, key); + if (action->type == ACTION_TYPE_MOD_LATCH && + action->mods.flags == filter->action.mods.flags && + action->mods.mods.mask == filter->action.mods.mods.mask) { + filter->action = *action; + if (filter->action.mods.flags & ACTION_LATCH_TO_LOCK) { + filter->action.type = ACTION_TYPE_MOD_LOCK; + filter->func = xkb_filter_mod_lock_func; + state->components.locked_mods |= filter->action.mods.mods.mask; + } + else { + filter->action.type = ACTION_TYPE_MOD_SET; + filter->func = xkb_filter_mod_set_func; + state->set_mods = filter->action.mods.mods.mask; + } + filter->key = key; + state->components.latched_mods &= ~filter->action.mods.mods.mask; + /* XXX beep beep! */ + return false; + } + else if (xkb_action_breaks_latch(action)) { + /* XXX: This may be totally broken, we might need to break the + * latch in the next run after this press? */ + state->components.latched_mods &= ~filter->action.mods.mods.mask; + filter->func = NULL; + return true; + } + } + else if (direction == XKB_KEY_UP && key == filter->key) { + /* Our key got released. If we've set it to clear locks, and we + * currently have the same modifiers locked, then release them and + * don't actually latch. Else we've actually hit the latching + * stage, so set PENDING and move our modifier from base to + * latched. */ + if (latch == NO_LATCH || + ((filter->action.mods.flags & ACTION_LOCK_CLEAR) && + (state->components.locked_mods & filter->action.mods.mods.mask) == + filter->action.mods.mods.mask)) { + /* XXX: We might be a bit overenthusiastic about clearing + * mods other filters have set here? */ + if (latch == LATCH_PENDING) + state->components.latched_mods &= + ~filter->action.mods.mods.mask; + else + state->clear_mods = filter->action.mods.mods.mask; + state->components.locked_mods &= ~filter->action.mods.mods.mask; + filter->func = NULL; + } + else { + latch = LATCH_PENDING; + state->clear_mods = filter->action.mods.mods.mask; + state->components.latched_mods |= filter->action.mods.mods.mask; + /* XXX beep beep! */ + } + } + else if (direction == XKB_KEY_DOWN && latch == LATCH_KEY_DOWN) { + /* Someone's pressed another key while we've still got the latching + * key held down, so keep the base modifier state active (from + * xkb_filter_mod_latch_new), but don't trip the latch, just clear + * it as soon as the modifier gets released. */ + latch = NO_LATCH; + } + + filter->priv = latch; + + return true; +} + +static void +xkb_filter_mod_latch_new(struct xkb_state *state, struct xkb_filter *filter) +{ + filter->priv = LATCH_KEY_DOWN; + state->set_mods = filter->action.mods.mods.mask; +} + +static const struct { + void (*new)(struct xkb_state *state, struct xkb_filter *filter); + bool (*func)(struct xkb_state *state, struct xkb_filter *filter, + const struct xkb_key *key, enum xkb_key_direction direction); +} filter_action_funcs[_ACTION_TYPE_NUM_ENTRIES] = { + [ACTION_TYPE_MOD_SET] = { xkb_filter_mod_set_new, + xkb_filter_mod_set_func }, + [ACTION_TYPE_MOD_LATCH] = { xkb_filter_mod_latch_new, + xkb_filter_mod_latch_func }, + [ACTION_TYPE_MOD_LOCK] = { xkb_filter_mod_lock_new, + xkb_filter_mod_lock_func }, + [ACTION_TYPE_GROUP_SET] = { xkb_filter_group_set_new, + xkb_filter_group_set_func }, + [ACTION_TYPE_GROUP_LOCK] = { xkb_filter_group_lock_new, + xkb_filter_group_lock_func }, +}; + +/** + * Applies any relevant filters to the key, first from the list of filters + * that are currently active, then if no filter has claimed the key, possibly + * apply a new filter from the key action. + */ +static void +xkb_filter_apply_all(struct xkb_state *state, + const struct xkb_key *key, + enum xkb_key_direction direction) +{ + struct xkb_filter *filter; + const union xkb_action *action; + bool send = true; + + /* First run through all the currently active filters and see if any of + * them have claimed this event. */ + darray_foreach(filter, state->filters) { + if (!filter->func) + continue; + send = filter->func(state, filter, key, direction) && send; + } + + if (!send || direction == XKB_KEY_UP) + return; + + action = xkb_key_get_action(state, key); + + /* + * It's possible for the keymap to set action->type explicitly, like so: + * interpret XF86_Next_VMode { + * action = Private(type=0x86, data="+VMode"); + * }; + * We don't handle those. + */ + if (action->type >= _ACTION_TYPE_NUM_ENTRIES) + return; + + if (!filter_action_funcs[action->type].new) + return; + + filter = xkb_filter_new(state); + if (!filter) + return; /* WSGO */ + + filter->key = key; + filter->func = filter_action_funcs[action->type].func; + filter->action = *action; + filter_action_funcs[action->type].new(state, filter); +} + +XKB_EXPORT struct xkb_state * +xkb_state_new(struct xkb_keymap *keymap) +{ + struct xkb_state *ret; + + ret = calloc(sizeof(*ret), 1); + if (!ret) + return NULL; + + ret->refcnt = 1; + ret->keymap = xkb_keymap_ref(keymap); + + return ret; +} + +XKB_EXPORT struct xkb_state * +xkb_state_ref(struct xkb_state *state) +{ + state->refcnt++; + return state; +} + +XKB_EXPORT void +xkb_state_unref(struct xkb_state *state) +{ + if (!state || --state->refcnt > 0) + return; + + xkb_keymap_unref(state->keymap); + darray_free(state->filters); + free(state); +} + +XKB_EXPORT struct xkb_keymap * +xkb_state_get_keymap(struct xkb_state *state) +{ + return state->keymap; +} + +/** + * Update the LED state to match the rest of the xkb_state. + */ +static void +xkb_state_led_update_all(struct xkb_state *state) +{ + xkb_led_index_t idx; + const struct xkb_led *led; + + state->components.leds = 0; + + darray_enumerate(idx, led, state->keymap->leds) { + xkb_mod_mask_t mod_mask = 0; + xkb_layout_mask_t group_mask = 0; + + if (led->which_mods & XKB_STATE_MODS_EFFECTIVE) + mod_mask |= state->components.mods; + if (led->which_mods & XKB_STATE_MODS_DEPRESSED) + mod_mask |= state->components.base_mods; + if (led->which_mods & XKB_STATE_MODS_LATCHED) + mod_mask |= state->components.latched_mods; + if (led->which_mods & XKB_STATE_MODS_LOCKED) + mod_mask |= state->components.locked_mods; + if (led->mods.mask & mod_mask) + state->components.leds |= (1 << idx); + + if (led->which_groups & XKB_STATE_LAYOUT_EFFECTIVE) + group_mask |= (1 << state->components.group); + if (led->which_groups & XKB_STATE_LAYOUT_DEPRESSED) + group_mask |= (1 << state->components.base_group); + if (led->which_groups & XKB_STATE_LAYOUT_LATCHED) + group_mask |= (1 << state->components.latched_group); + if (led->which_groups & XKB_STATE_LAYOUT_LOCKED) + group_mask |= (1 << state->components.locked_group); + if (led->groups & group_mask) + state->components.leds |= (1 << idx); + + if (led->ctrls & state->keymap->enabled_ctrls) + state->components.leds |= (1 << idx); + } +} + +/** + * Calculates the derived state (effective mods/group and LEDs) from an + * up-to-date xkb_state. + */ +static void +xkb_state_update_derived(struct xkb_state *state) +{ + state->components.mods = (state->components.base_mods | + state->components.latched_mods | + state->components.locked_mods); + + /* TODO: Use groups_wrap control instead of always RANGE_WRAP. */ + + state->components.locked_group = + wrap_group_into_range(state->components.locked_group, + state->keymap->num_groups, + RANGE_WRAP, 0); + + state->components.group = + wrap_group_into_range(state->components.base_group + + state->components.latched_group + + state->components.locked_group, + state->keymap->num_groups, + RANGE_WRAP, 0); + + xkb_state_led_update_all(state); +} + +static enum xkb_state_component +get_state_component_changes(const struct state_components *a, + const struct state_components *b) +{ + xkb_mod_mask_t mask = 0; + + if (a->group != b->group) + mask |= XKB_STATE_LAYOUT_EFFECTIVE; + if (a->base_group != b->base_group) + mask |= XKB_STATE_LAYOUT_DEPRESSED; + if (a->latched_group != b->latched_group) + mask |= XKB_STATE_LAYOUT_LATCHED; + if (a->locked_group != b->locked_group) + mask |= XKB_STATE_LAYOUT_LOCKED; + if (a->mods != b->mods) + mask |= XKB_STATE_MODS_EFFECTIVE; + if (a->base_mods != b->base_mods) + mask |= XKB_STATE_MODS_DEPRESSED; + if (a->latched_mods != b->latched_mods) + mask |= XKB_STATE_MODS_LATCHED; + if (a->locked_mods != b->locked_mods) + mask |= XKB_STATE_MODS_LOCKED; + if (a->leds != b->leds) + mask |= XKB_STATE_LEDS; + + return mask; +} + +/** + * Given a particular key event, updates the state structure to reflect the + * new modifiers. + */ +XKB_EXPORT enum xkb_state_component +xkb_state_update_key(struct xkb_state *state, xkb_keycode_t kc, + enum xkb_key_direction direction) +{ + xkb_mod_index_t i; + xkb_mod_mask_t bit; + struct state_components prev_components; + const struct xkb_key *key = XkbKey(state->keymap, kc); + + if (!key) + return 0; + + prev_components = state->components; + + state->set_mods = 0; + state->clear_mods = 0; + + xkb_filter_apply_all(state, key, direction); + + for (i = 0, bit = 1; state->set_mods; i++, bit <<= 1) { + if (state->set_mods & bit) { + state->mod_key_count[i]++; + state->components.base_mods |= bit; + state->set_mods &= ~bit; + } + } + + for (i = 0, bit = 1; state->clear_mods; i++, bit <<= 1) { + if (state->clear_mods & bit) { + state->mod_key_count[i]--; + if (state->mod_key_count[i] <= 0) { + state->components.base_mods &= ~bit; + state->mod_key_count[i] = 0; + } + state->clear_mods &= ~bit; + } + } + + xkb_state_update_derived(state); + + return get_state_component_changes(&prev_components, &state->components); +} + +/** + * Updates the state from a set of explicit masks as gained from + * xkb_state_serialize_mods and xkb_state_serialize_groups. As noted in the + * documentation for these functions in xkbcommon.h, this round-trip is + * lossy, and should only be used to update a slave state mirroring the + * master, e.g. in a client/server window system. + */ +XKB_EXPORT enum xkb_state_component +xkb_state_update_mask(struct xkb_state *state, + xkb_mod_mask_t base_mods, + xkb_mod_mask_t latched_mods, + xkb_mod_mask_t locked_mods, + xkb_layout_index_t base_group, + xkb_layout_index_t latched_group, + xkb_layout_index_t locked_group) +{ + struct state_components prev_components; + xkb_mod_index_t num_mods; + xkb_mod_index_t idx; + + prev_components = state->components; + + state->components.base_mods = 0; + state->components.latched_mods = 0; + state->components.locked_mods = 0; + num_mods = xkb_keymap_num_mods(state->keymap); + + for (idx = 0; idx < num_mods; idx++) { + xkb_mod_mask_t mod = (1 << idx); + if (base_mods & mod) + state->components.base_mods |= mod; + if (latched_mods & mod) + state->components.latched_mods |= mod; + if (locked_mods & mod) + state->components.locked_mods |= mod; + } + + state->components.base_group = base_group; + state->components.latched_group = latched_group; + state->components.locked_group = locked_group; + + xkb_state_update_derived(state); + + return get_state_component_changes(&prev_components, &state->components); +} + +/** + * Provides the symbols to use for the given key and state. Returns the + * number of symbols pointed to in syms_out. + */ +XKB_EXPORT int +xkb_state_key_get_syms(struct xkb_state *state, xkb_keycode_t kc, + const xkb_keysym_t **syms_out) +{ + xkb_layout_index_t layout; + xkb_level_index_t level; + + layout = xkb_state_key_get_layout(state, kc); + if (layout == XKB_LAYOUT_INVALID) + goto err; + + level = xkb_state_key_get_level(state, kc, layout); + if (level == XKB_LEVEL_INVALID) + goto err; + + return xkb_keymap_key_get_syms_by_level(state->keymap, kc, layout, level, + syms_out); + +err: + *syms_out = NULL; + return 0; +} + +/** + * Provides either exactly one symbol, or XKB_KEY_NoSymbol. + */ +XKB_EXPORT xkb_keysym_t +xkb_state_key_get_one_sym(struct xkb_state *state, xkb_keycode_t kc) +{ + const xkb_keysym_t *syms; + int num_syms; + + num_syms = xkb_state_key_get_syms(state, kc, &syms); + if (num_syms != 1) + return XKB_KEY_NoSymbol; + + return syms[0]; +} + +/** + * Serialises the requested modifier state into an xkb_mod_mask_t, with all + * the same disclaimers as in xkb_state_update_mask. + */ +XKB_EXPORT xkb_mod_mask_t +xkb_state_serialize_mods(struct xkb_state *state, + enum xkb_state_component type) +{ + xkb_mod_mask_t ret = 0; + + if (type & XKB_STATE_MODS_EFFECTIVE) + return state->components.mods; + + if (type & XKB_STATE_MODS_DEPRESSED) + ret |= state->components.base_mods; + if (type & XKB_STATE_MODS_LATCHED) + ret |= state->components.latched_mods; + if (type & XKB_STATE_MODS_LOCKED) + ret |= state->components.locked_mods; + + return ret; +} + +/** + * Serialises the requested group state, with all the same disclaimers as + * in xkb_state_update_mask. + */ +XKB_EXPORT xkb_layout_index_t +xkb_state_serialize_layout(struct xkb_state *state, + enum xkb_state_component type) +{ + xkb_layout_index_t ret = 0; + + if (type & XKB_STATE_LAYOUT_EFFECTIVE) + return state->components.group; + + if (type & XKB_STATE_LAYOUT_DEPRESSED) + ret += state->components.base_group; + if (type & XKB_STATE_LAYOUT_LATCHED) + ret += state->components.latched_group; + if (type & XKB_STATE_LAYOUT_LOCKED) + ret += state->components.locked_group; + + return ret; +} + +/** + * Returns 1 if the given modifier is active with the specified type(s), 0 if + * not, or -1 if the modifier is invalid. + */ +XKB_EXPORT int +xkb_state_mod_index_is_active(struct xkb_state *state, + xkb_mod_index_t idx, + enum xkb_state_component type) +{ + if (idx >= xkb_keymap_num_mods(state->keymap)) + return -1; + + return !!(xkb_state_serialize_mods(state, type) & (1 << idx)); +} + +/** + * Helper function for xkb_state_mod_indices_are_active and + * xkb_state_mod_names_are_active. + */ +static int +match_mod_masks(struct xkb_state *state, + enum xkb_state_component type, + enum xkb_state_match match, + xkb_mod_mask_t wanted) +{ + xkb_mod_mask_t active = xkb_state_serialize_mods(state, type); + + if (!(match & XKB_STATE_MATCH_NON_EXCLUSIVE) && (active & ~wanted)) + return 0; + + if (match & XKB_STATE_MATCH_ANY) + return !!(active & wanted); + else + return (active & wanted) == wanted; + + return 0; +} + +/** + * Returns 1 if the modifiers are active with the specified type(s), 0 if + * not, or -1 if any of the modifiers are invalid. + */ +XKB_EXPORT int +xkb_state_mod_indices_are_active(struct xkb_state *state, + enum xkb_state_component type, + enum xkb_state_match match, + ...) +{ + va_list ap; + xkb_mod_index_t idx = 0; + xkb_mod_mask_t wanted = 0; + int ret = 0; + xkb_mod_index_t num_mods = xkb_keymap_num_mods(state->keymap); + + va_start(ap, match); + while (1) { + idx = va_arg(ap, xkb_mod_index_t); + if (idx == XKB_MOD_INVALID) + break; + if (idx >= num_mods) { + ret = -1; + break; + } + wanted |= (1 << idx); + } + va_end(ap); + + if (ret == -1) + return ret; + + return match_mod_masks(state, type, match, wanted); +} + +/** + * Returns 1 if the given modifier is active with the specified type(s), 0 if + * not, or -1 if the modifier is invalid. + */ +XKB_EXPORT int +xkb_state_mod_name_is_active(struct xkb_state *state, const char *name, + enum xkb_state_component type) +{ + xkb_mod_index_t idx = xkb_keymap_mod_get_index(state->keymap, name); + + if (idx == XKB_MOD_INVALID) + return -1; + + return xkb_state_mod_index_is_active(state, idx, type); +} + +/** + * Returns 1 if the modifiers are active with the specified type(s), 0 if + * not, or -1 if any of the modifiers are invalid. + */ +XKB_EXPORT ATTR_NULL_SENTINEL int +xkb_state_mod_names_are_active(struct xkb_state *state, + enum xkb_state_component type, + enum xkb_state_match match, + ...) +{ + va_list ap; + xkb_mod_index_t idx = 0; + const char *str; + xkb_mod_mask_t wanted = 0; + int ret = 0; + + va_start(ap, match); + while (1) { + str = va_arg(ap, const char *); + if (str == NULL) + break; + idx = xkb_keymap_mod_get_index(state->keymap, str); + if (idx == XKB_MOD_INVALID) { + ret = -1; + break; + } + wanted |= (1 << idx); + } + va_end(ap); + + if (ret == -1) + return ret; + + return match_mod_masks(state, type, match, wanted); +} + +/** + * Returns 1 if the given group is active with the specified type(s), 0 if + * not, or -1 if the group is invalid. + */ +XKB_EXPORT int +xkb_state_layout_index_is_active(struct xkb_state *state, + xkb_layout_index_t idx, + enum xkb_state_component type) +{ + int ret = 0; + + if (idx >= state->keymap->num_groups) + return -1; + + if (type & XKB_STATE_LAYOUT_EFFECTIVE) + ret |= (state->components.group == idx); + if (type & XKB_STATE_LAYOUT_DEPRESSED) + ret |= (state->components.base_group == idx); + if (type & XKB_STATE_LAYOUT_LATCHED) + ret |= (state->components.latched_group == idx); + if (type & XKB_STATE_LAYOUT_LOCKED) + ret |= (state->components.locked_group == idx); + + return ret; +} + +/** + * Returns 1 if the given modifier is active with the specified type(s), 0 if + * not, or -1 if the modifier is invalid. + */ +XKB_EXPORT int +xkb_state_layout_name_is_active(struct xkb_state *state, const char *name, + enum xkb_state_component type) +{ + xkb_layout_index_t idx = xkb_keymap_layout_get_index(state->keymap, name); + + if (idx == XKB_LAYOUT_INVALID) + return -1; + + return xkb_state_layout_index_is_active(state, idx, type); +} + +/** + * Returns 1 if the given LED is active, 0 if not, or -1 if the LED is invalid. + */ +XKB_EXPORT int +xkb_state_led_index_is_active(struct xkb_state *state, xkb_led_index_t idx) +{ + if (idx >= darray_size(state->keymap->leds) || + darray_item(state->keymap->leds, idx).name == XKB_ATOM_NONE) + return -1; + + return !!(state->components.leds & (1 << idx)); +} + +/** + * Returns 1 if the given LED is active, 0 if not, or -1 if the LED is invalid. + */ +XKB_EXPORT int +xkb_state_led_name_is_active(struct xkb_state *state, const char *name) +{ + xkb_led_index_t idx = xkb_keymap_led_get_index(state->keymap, name); + + if (idx == XKB_LED_INVALID) + return -1; + + return xkb_state_led_index_is_active(state, idx); +} + +static xkb_mod_mask_t +key_get_consumed(struct xkb_state *state, const struct xkb_key *key) +{ + const struct xkb_key_type_entry *entry; + xkb_layout_index_t group; + + group = xkb_state_key_get_layout(state, key->keycode); + if (group == XKB_LAYOUT_INVALID) + return 0; + + entry = get_entry_for_key_state(state, key, group); + if (!entry) + return 0; + + return entry->mods.mask & ~entry->preserve.mask; +} + +/** + * Tests to see if a modifier is used up by our translation of a + * keycode to keysyms, taking note of the current modifier state and + * the appropriate key type's preserve information, if any. This allows + * the user to mask out the modifier in later processing of the + * modifiers, e.g. when implementing hot keys or accelerators. + * + * See also, for example: + * - XkbTranslateKeyCode(3), mod_rtrn return value, from libX11. + * - gdk_keymap_translate_keyboard_state, consumed_modifiers return value, + * from gtk+. + */ +XKB_EXPORT int +xkb_state_mod_index_is_consumed(struct xkb_state *state, xkb_keycode_t kc, + xkb_mod_index_t idx) +{ + const struct xkb_key *key = XkbKey(state->keymap, kc); + + if (!key || idx >= xkb_keymap_num_mods(state->keymap)) + return -1; + + return !!((1 << idx) & key_get_consumed(state, key)); +} + +/** + * Calculates which modifiers should be consumed during key processing, + * and returns the mask with all these modifiers removed. e.g. if + * given a state of Alt and Shift active for a two-level alphabetic + * key containing plus and equal on the first and second level + * respectively, will return a mask of only Alt, as Shift has been + * consumed by the type handling. + */ +XKB_EXPORT xkb_mod_mask_t +xkb_state_mod_mask_remove_consumed(struct xkb_state *state, xkb_keycode_t kc, + xkb_mod_mask_t mask) +{ + const struct xkb_key *key = XkbKey(state->keymap, kc); + + if (!key) + return 0; + + return mask & ~key_get_consumed(state, key); +} diff --git a/src/3rdparty/xkbcommon/src/text.c b/src/3rdparty/xkbcommon/src/text.c new file mode 100644 index 0000000000..4b8ad0984f --- /dev/null +++ b/src/3rdparty/xkbcommon/src/text.c @@ -0,0 +1,357 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +#include "keymap.h" +#include "text.h" + +bool +LookupString(const LookupEntry tab[], const char *string, + unsigned int *value_rtrn) +{ + if (!string) + return false; + + for (const LookupEntry *entry = tab; entry->name; entry++) { + if (istreq(entry->name, string)) { + *value_rtrn = entry->value; + return true; + } + } + + return false; +} + +const char * +LookupValue(const LookupEntry tab[], unsigned int value) +{ + for (const LookupEntry *entry = tab; entry->name; entry++) + if (entry->value == value) + return entry->name; + + return NULL; +} + +const LookupEntry ctrlMaskNames[] = { + { "RepeatKeys", CONTROL_REPEAT }, + { "Repeat", CONTROL_REPEAT }, + { "AutoRepeat", CONTROL_REPEAT }, + { "SlowKeys", CONTROL_SLOW }, + { "BounceKeys", CONTROL_DEBOUNCE }, + { "StickyKeys", CONTROL_STICKY }, + { "MouseKeys", CONTROL_MOUSEKEYS }, + { "MouseKeysAccel", CONTROL_MOUSEKEYS_ACCEL }, + { "AccessXKeys", CONTROL_AX }, + { "AccessXTimeout", CONTROL_AX_TIMEOUT }, + { "AccessXFeedback", CONTROL_AX_FEEDBACK }, + { "AudibleBell", CONTROL_BELL }, + { "IgnoreGroupLock", CONTROL_IGNORE_GROUP_LOCK }, + { "all", CONTROL_ALL }, + { "none", 0 }, + { "Overlay1", 0 }, + { "Overlay2", 0 }, + { NULL, 0 } +}; + +const LookupEntry modComponentMaskNames[] = { + { "base", XKB_STATE_MODS_DEPRESSED }, + { "latched", XKB_STATE_MODS_LATCHED }, + { "locked", XKB_STATE_MODS_LOCKED }, + { "effective", XKB_STATE_MODS_EFFECTIVE }, + { "compat", XKB_STATE_MODS_EFFECTIVE }, + { "any", XKB_STATE_MODS_EFFECTIVE }, + { "none", 0 }, + { NULL, 0 } +}; + +const LookupEntry groupComponentMaskNames[] = { + { "base", XKB_STATE_LAYOUT_DEPRESSED }, + { "latched", XKB_STATE_LAYOUT_LATCHED }, + { "locked", XKB_STATE_LAYOUT_LOCKED }, + { "effective", XKB_STATE_LAYOUT_EFFECTIVE }, + { "any", XKB_STATE_LAYOUT_EFFECTIVE }, + { "none", 0 }, + { NULL, 0 } +}; + +const LookupEntry groupMaskNames[] = { + { "Group1", 0x01 }, + { "Group2", 0x02 }, + { "Group3", 0x04 }, + { "Group4", 0x08 }, + { "Group5", 0x10 }, + { "Group6", 0x20 }, + { "Group7", 0x40 }, + { "Group8", 0x80 }, + { "none", 0x00 }, + { "all", 0xff }, + { NULL, 0 } +}; + +const LookupEntry groupNames[] = { + { "Group1", 1 }, + { "Group2", 2 }, + { "Group3", 3 }, + { "Group4", 4 }, + { "Group5", 5 }, + { "Group6", 6 }, + { "Group7", 7 }, + { "Group8", 8 }, + { NULL, 0 } +}; + +const LookupEntry levelNames[] = { + { "Level1", 1 }, + { "Level2", 2 }, + { "Level3", 3 }, + { "Level4", 4 }, + { "Level5", 5 }, + { "Level6", 6 }, + { "Level7", 7 }, + { "Level8", 8 }, + { NULL, 0 } +}; + +const LookupEntry buttonNames[] = { + { "Button1", 1 }, + { "Button2", 2 }, + { "Button3", 3 }, + { "Button4", 4 }, + { "Button5", 5 }, + { "default", 0 }, + { NULL, 0 } +}; + +const LookupEntry useModMapValueNames[] = { + { "LevelOne", 1 }, + { "Level1", 1 }, + { "AnyLevel", 0 }, + { "any", 0 }, + { NULL, 0 } +}; + +const LookupEntry actionTypeNames[] = { + { "NoAction", ACTION_TYPE_NONE }, + { "SetMods", ACTION_TYPE_MOD_SET }, + { "LatchMods", ACTION_TYPE_MOD_LATCH }, + { "LockMods", ACTION_TYPE_MOD_LOCK }, + { "SetGroup", ACTION_TYPE_GROUP_SET }, + { "LatchGroup", ACTION_TYPE_GROUP_LATCH }, + { "LockGroup", ACTION_TYPE_GROUP_LOCK }, + { "MovePtr", ACTION_TYPE_PTR_MOVE }, + { "MovePointer", ACTION_TYPE_PTR_MOVE }, + { "PtrBtn", ACTION_TYPE_PTR_BUTTON }, + { "PointerButton", ACTION_TYPE_PTR_BUTTON }, + { "LockPtrBtn", ACTION_TYPE_PTR_LOCK }, + { "LockPtrButton", ACTION_TYPE_PTR_LOCK }, + { "LockPointerButton", ACTION_TYPE_PTR_LOCK }, + { "LockPointerBtn", ACTION_TYPE_PTR_LOCK }, + { "SetPtrDflt", ACTION_TYPE_PTR_DEFAULT }, + { "SetPointerDefault", ACTION_TYPE_PTR_DEFAULT }, + { "Terminate", ACTION_TYPE_TERMINATE }, + { "TerminateServer", ACTION_TYPE_TERMINATE }, + { "SwitchScreen", ACTION_TYPE_SWITCH_VT }, + { "SetControls", ACTION_TYPE_CTRL_SET }, + { "LockControls", ACTION_TYPE_CTRL_LOCK }, + { "RedirectKey", ACTION_TYPE_KEY_REDIRECT }, + { "Redirect", ACTION_TYPE_KEY_REDIRECT }, + { "Private", ACTION_TYPE_PRIVATE }, + /* deprecated actions below here - unused */ + { "ISOLock", ACTION_TYPE_NONE }, + { "ActionMessage", ACTION_TYPE_NONE }, + { "MessageAction", ACTION_TYPE_NONE }, + { "Message", ACTION_TYPE_NONE }, + { "DeviceBtn", ACTION_TYPE_NONE }, + { "DevBtn", ACTION_TYPE_NONE }, + { "DevButton", ACTION_TYPE_NONE }, + { "DeviceButton", ACTION_TYPE_NONE }, + { "LockDeviceBtn", ACTION_TYPE_NONE }, + { "LockDevBtn", ACTION_TYPE_NONE }, + { "LockDevButton", ACTION_TYPE_NONE }, + { "LockDeviceButton", ACTION_TYPE_NONE }, + { "DeviceValuator", ACTION_TYPE_NONE }, + { "DevVal", ACTION_TYPE_NONE }, + { "DeviceVal", ACTION_TYPE_NONE }, + { "DevValuator", ACTION_TYPE_NONE }, + { NULL, 0 }, +}; + +const LookupEntry symInterpretMatchMaskNames[] = { + { "NoneOf", MATCH_NONE }, + { "AnyOfOrNone", MATCH_ANY_OR_NONE }, + { "AnyOf", MATCH_ANY }, + { "AllOf", MATCH_ALL }, + { "Exactly", MATCH_EXACTLY }, +}; + +const char * +ModIndexText(const struct xkb_keymap *keymap, xkb_mod_index_t ndx) +{ + if (ndx == XKB_MOD_INVALID) + return "none"; + + if (ndx >= darray_size(keymap->mods)) + return NULL; + + return xkb_atom_text(keymap->ctx, darray_item(keymap->mods, ndx).name); +} + +xkb_mod_index_t +ModNameToIndex(const struct xkb_keymap *keymap, xkb_atom_t name, + enum mod_type type) +{ + xkb_mod_index_t i; + const struct xkb_mod *mod; + + darray_enumerate(i, mod, keymap->mods) + if ((mod->type & type) && name == mod->name) + return i; + + return XKB_MOD_INVALID; +} + +const char * +ActionTypeText(enum xkb_action_type type) +{ + const char *name = LookupValue(actionTypeNames, type); + return name ? name : "Private"; +} + +const char * +KeysymText(struct xkb_context *ctx, xkb_keysym_t sym) +{ + char *buffer = xkb_context_get_buffer(ctx, 64); + xkb_keysym_get_name(sym, buffer, 64); + return buffer; +} + +const char * +KeyNameText(struct xkb_context *ctx, xkb_atom_t name) +{ + const char *sname = xkb_atom_text(ctx, name); + size_t len = strlen(sname) + 3; + char *buf = xkb_context_get_buffer(ctx, len); + snprintf(buf, len, "<%s>", sname); + return buf; +} + +const char * +SIMatchText(enum xkb_match_operation type) +{ + return LookupValue(symInterpretMatchMaskNames, type); +} + +const char * +ModMaskText(const struct xkb_keymap *keymap, xkb_mod_mask_t mask) +{ + char buf[1024]; + size_t pos = 0; + xkb_mod_index_t i; + const struct xkb_mod *mod; + + if (mask == 0) + return "none"; + + if (mask == MOD_REAL_MASK_ALL) + return "all"; + + darray_enumerate(i, mod, keymap->mods) { + int ret; + + if (!(mask & (1 << i))) + continue; + + ret = snprintf(buf + pos, sizeof(buf) - pos, "%s%s", + pos == 0 ? "" : "+", + xkb_atom_text(keymap->ctx, mod->name)); + if (ret <= 0 || pos + ret >= sizeof(buf)) + break; + else + pos += ret; + } + + return strcpy(xkb_context_get_buffer(keymap->ctx, pos + 1), buf); +} + +const char * +LedStateMaskText(struct xkb_context *ctx, enum xkb_state_component mask) +{ + char buf[1024]; + size_t pos = 0; + + if (mask == 0) + return "0"; + + for (unsigned i = 0; mask; i++) { + int ret; + + if (!(mask & (1 << i))) + continue; + + mask &= ~(1 << i); + + ret = snprintf(buf + pos, sizeof(buf) - pos, "%s%s", + pos == 0 ? "" : "+", + LookupValue(modComponentMaskNames, 1 << i)); + if (ret <= 0 || pos + ret >= sizeof(buf)) + break; + else + pos += ret; + } + + return strcpy(xkb_context_get_buffer(ctx, pos + 1), buf); +} + +const char * +ControlMaskText(struct xkb_context *ctx, enum xkb_action_controls mask) +{ + char buf[1024]; + size_t pos = 0; + + if (mask == 0) + return "none"; + + if (mask == CONTROL_ALL) + return "all"; + + for (unsigned i = 0; mask; i++) { + int ret; + + if (!(mask & (1 << i))) + continue; + + mask &= ~(1 << i); + + ret = snprintf(buf + pos, sizeof(buf) - pos, "%s%s", + pos == 0 ? "" : "+", + LookupValue(ctrlMaskNames, 1 << i)); + if (ret <= 0 || pos + ret >= sizeof(buf)) + break; + else + pos += ret; + } + + return strcpy(xkb_context_get_buffer(ctx, pos + 1), buf); +} diff --git a/src/3rdparty/xkbcommon/src/text.h b/src/3rdparty/xkbcommon/src/text.h new file mode 100644 index 0000000000..29f73abc95 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/text.h @@ -0,0 +1,78 @@ +/* + * Copyright © 2009 Dan Nicholson + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef TEXT_H +#define TEXT_H + +typedef struct { + const char *name; + unsigned int value; +} LookupEntry; + +bool +LookupString(const LookupEntry tab[], const char *string, + unsigned int *value_rtrn); + +const char * +LookupValue(const LookupEntry tab[], unsigned int value); + +extern const LookupEntry ctrlMaskNames[]; +extern const LookupEntry modComponentMaskNames[]; +extern const LookupEntry groupComponentMaskNames[]; +extern const LookupEntry groupMaskNames[]; +extern const LookupEntry groupNames[]; +extern const LookupEntry levelNames[]; +extern const LookupEntry buttonNames[]; +extern const LookupEntry useModMapValueNames[]; +extern const LookupEntry actionTypeNames[]; +extern const LookupEntry symInterpretMatchMaskNames[]; + +const char * +ModMaskText(const struct xkb_keymap *keymap, xkb_mod_mask_t mask); + +const char * +ModIndexText(const struct xkb_keymap *keymap, xkb_mod_index_t ndx); + +xkb_mod_index_t +ModNameToIndex(const struct xkb_keymap *keymap, xkb_atom_t name, + enum mod_type type); + +const char * +ActionTypeText(enum xkb_action_type type); + +const char * +KeysymText(struct xkb_context *ctx, xkb_keysym_t sym); + +const char * +KeyNameText(struct xkb_context *ctx, xkb_atom_t name); + +const char * +SIMatchText(enum xkb_match_operation type); + +const char * +LedStateMaskText(struct xkb_context *ctx, enum xkb_state_component mask); + +const char * +ControlMaskText(struct xkb_context *ctx, enum xkb_action_controls mask); + +#endif /* TEXT_H */ diff --git a/src/3rdparty/xkbcommon/src/utils.h b/src/3rdparty/xkbcommon/src/utils.h new file mode 100644 index 0000000000..b4daaddaaa --- /dev/null +++ b/src/3rdparty/xkbcommon/src/utils.h @@ -0,0 +1,136 @@ +/* + * Copyright © 2012 Ran Benita <ran234@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef UTILS_H +#define UTILS_H 1 + +#include <inttypes.h> +#include <stdbool.h> +#include <string.h> +#include <strings.h> + +#include "darray.h" + +/* + * We sometimes malloc strings and then expose them as const char*'s. This + * macro is used when we free these strings in order to avoid -Wcast-qual + * errors. + */ +#define UNCONSTIFY(const_ptr) ((void *) (uintptr_t) (const_ptr)) + +static inline bool +streq(const char *s1, const char *s2) +{ + return strcmp(s1, s2) == 0; +} + +static inline bool +streq_not_null(const char *s1, const char *s2) +{ + if (!s1 || !s2) + return false; + return streq(s1, s2); +} + +static inline bool +istreq(const char *s1, const char *s2) +{ + return strcasecmp(s1, s2) == 0; +} + +static inline bool +istreq_prefix(const char *s1, const char *s2) +{ + return strncasecmp(s1, s2, strlen(s1)) == 0; +} + +static inline char * +strdup_safe(const char *s) +{ + return s ? strdup(s) : NULL; +} + +static inline bool +isempty(const char *s) +{ + return s == NULL || s[0] == '\0'; +} + +static inline const char * +strnull(const char *s) +{ + return s ? s : "(null)"; +} + +static inline void * +memdup(const void *mem, size_t nmemb, size_t size) +{ + void *p = malloc(nmemb * size); + if (p) + memcpy(p, mem, nmemb * size); + return p; +} + +#define ARRAY_SIZE(arr) ((sizeof(arr) / sizeof(*(arr)))) + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MIN3(a, b, c) MIN(MIN((a), (b)), (c)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define MAX3(a, b, c) MAX(MAX((a), (b)), (c)) + +/* Compiler Attributes */ + +#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__) +# define XKB_EXPORT __attribute__((visibility("default"))) +#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) +# define XKB_EXPORT __global +#else /* not gcc >= 4 and not Sun Studio >= 8 */ +# define XKB_EXPORT +#endif + +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203) +# define ATTR_PRINTF(x,y) __attribute__((__format__(__printf__, x, y))) +#else /* not gcc >= 2.3 */ +# define ATTR_PRINTF(x,y) +#endif + +#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \ + || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# define ATTR_NORETURN __attribute__((__noreturn__)) +#else +# define ATTR_NORETURN +#endif /* GNUC */ + +#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 296) +#define ATTR_MALLOC __attribute__((__malloc__)) +#else +#define ATTR_MALLOC +#endif + +#if defined(__GNUC__) && (__GNUC__ >= 4) +# define ATTR_NULL_SENTINEL __attribute__((__sentinel__)) +#else +# define ATTR_NULL_SENTINEL +#endif /* GNUC >= 4 */ + +#endif /* UTILS_H */ diff --git a/src/3rdparty/xkbcommon/src/xkb-compat.c b/src/3rdparty/xkbcommon/src/xkb-compat.c new file mode 100644 index 0000000000..3cc3ab3d6e --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkb-compat.c @@ -0,0 +1,189 @@ +/* + * Copyright © 2012 Daniel Stone + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + */ + +#define _XKBCOMMON_COMPAT_H /* don't mangle our legacy names! */ + +#include "xkbcommon/xkbcommon.h" +#include "utils.h" + +/* We don't carry any prototypes for these functions, as we #define them + * to their newer versions so people link against those. */ +#pragma GCC diagnostic ignored "-Wmissing-prototypes" + +XKB_EXPORT struct xkb_keymap * +xkb_map_new_from_names(struct xkb_context *context, + const struct xkb_rule_names *names, + enum xkb_keymap_compile_flags flags) +{ + return xkb_keymap_new_from_names(context, names, flags); +} + +XKB_EXPORT struct xkb_keymap * +xkb_map_new_from_file(struct xkb_context *context, FILE *file, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags) +{ + return xkb_keymap_new_from_file(context, file, format, flags); +} + +XKB_EXPORT struct xkb_keymap * +xkb_map_new_from_string(struct xkb_context *context, const char *string, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags) +{ + return xkb_keymap_new_from_string(context, string, format, flags); +} + +XKB_EXPORT char * +xkb_map_get_as_string(struct xkb_keymap *keymap) +{ + return xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1); +} + +XKB_EXPORT struct xkb_keymap * +xkb_map_ref(struct xkb_keymap *keymap) +{ + return xkb_keymap_ref(keymap); +} + +XKB_EXPORT void +xkb_map_unref(struct xkb_keymap *keymap) +{ + xkb_keymap_unref(keymap); +} + +XKB_EXPORT xkb_mod_index_t +xkb_map_num_mods(struct xkb_keymap *keymap) +{ + return xkb_keymap_num_mods(keymap); +} + +XKB_EXPORT const char * +xkb_map_mod_get_name(struct xkb_keymap *keymap, xkb_mod_index_t idx) +{ + return xkb_keymap_mod_get_name(keymap, idx); +} + +XKB_EXPORT xkb_mod_index_t +xkb_map_mod_get_index(struct xkb_keymap *keymap, const char *name) +{ + return xkb_keymap_mod_get_index(keymap, name); +} + +XKB_EXPORT bool +xkb_key_mod_index_is_consumed(struct xkb_state *state, xkb_keycode_t kc, + xkb_mod_index_t idx) +{ + return xkb_state_mod_index_is_consumed(state, kc, idx); +} + +XKB_EXPORT xkb_mod_mask_t +xkb_key_mod_mask_remove_consumed(struct xkb_state *state, xkb_keycode_t kc, + xkb_mod_mask_t mask) +{ + return xkb_state_mod_mask_remove_consumed(state, kc, mask); +} + +XKB_EXPORT xkb_layout_index_t +xkb_map_num_groups(struct xkb_keymap *keymap) +{ + return xkb_keymap_num_layouts(keymap); +} + +XKB_EXPORT xkb_layout_index_t +xkb_key_num_groups(struct xkb_keymap *keymap, xkb_keycode_t kc) +{ + return xkb_keymap_num_layouts_for_key(keymap, kc); +} + +XKB_EXPORT const char * +xkb_map_group_get_name(struct xkb_keymap *keymap, xkb_layout_index_t idx) +{ + return xkb_keymap_layout_get_name(keymap, idx); +} + +XKB_EXPORT xkb_layout_index_t +xkb_map_group_get_index(struct xkb_keymap *keymap, const char *name) +{ + return xkb_keymap_layout_get_index(keymap, name); +} + +XKB_EXPORT xkb_led_index_t +xkb_map_num_leds(struct xkb_keymap *keymap) +{ + return xkb_keymap_num_leds(keymap); +} + +XKB_EXPORT const char * +xkb_map_led_get_name(struct xkb_keymap *keymap, xkb_led_index_t idx) +{ + return xkb_keymap_led_get_name(keymap, idx); +} + +XKB_EXPORT xkb_led_index_t +xkb_map_led_get_index(struct xkb_keymap *keymap, const char *name) +{ + return xkb_keymap_led_get_index(keymap, name); +} + +XKB_EXPORT bool +xkb_key_repeats(struct xkb_keymap *keymap, xkb_keycode_t kc) +{ + return xkb_keymap_key_repeats(keymap, kc); +} + +XKB_EXPORT int +xkb_key_get_syms(struct xkb_state *state, xkb_keycode_t kc, + const xkb_keysym_t **syms_out) +{ + return xkb_state_key_get_syms(state, kc, syms_out); +} + +XKB_EXPORT bool +xkb_state_group_name_is_active(struct xkb_state *state, const char *name, + enum xkb_state_component type) +{ + return xkb_state_layout_name_is_active(state, name, type); +} + +XKB_EXPORT bool +xkb_state_group_index_is_active(struct xkb_state *state, xkb_layout_index_t idx, + enum xkb_state_component type) +{ + return xkb_state_layout_index_is_active(state, idx, type); +} + +XKB_EXPORT xkb_layout_index_t +xkb_state_serialize_group(struct xkb_state *state, + enum xkb_state_component type) +{ + return xkb_state_serialize_layout(state, type); +} + +XKB_EXPORT struct xkb_keymap * +xkb_state_get_map(struct xkb_state *state) +{ + return xkb_state_get_keymap(state); +} diff --git a/src/3rdparty/xkbcommon/src/xkb-keymap.c b/src/3rdparty/xkbcommon/src/xkb-keymap.c new file mode 100644 index 0000000000..3df183a64f --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkb-keymap.c @@ -0,0 +1,555 @@ +/** + * Copyright © 2012 Intel Corporation + * Copyright © 2012 Ran Benita <ran234@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + */ + +/************************************************************ + * Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ********************************************************/ + +#include "keymap.h" +#include "text.h" + +static struct xkb_keymap * +xkb_keymap_new(struct xkb_context *ctx, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags) +{ + struct xkb_keymap *keymap; + + keymap = calloc(1, sizeof(*keymap)); + if (!keymap) + return NULL; + + keymap->refcnt = 1; + keymap->ctx = xkb_context_ref(ctx); + + keymap->format = format; + keymap->flags = flags; + + return keymap; +} + +XKB_EXPORT struct xkb_keymap * +xkb_keymap_ref(struct xkb_keymap *keymap) +{ + keymap->refcnt++; + return keymap; +} + +XKB_EXPORT void +xkb_keymap_unref(struct xkb_keymap *keymap) +{ + unsigned int i, j; + struct xkb_key *key; + + if (!keymap || --keymap->refcnt > 0) + return; + + if (keymap->keys) { + xkb_foreach_key(key, keymap) { + for (i = 0; i < key->num_groups; i++) { + for (j = 0; j < XkbKeyGroupWidth(key, i); j++) + if (key->groups[i].levels[j].num_syms > 1) + free(key->groups[i].levels[j].u.syms); + free(key->groups[i].levels); + } + free(key->groups); + } + free(keymap->keys); + } + for (i = 0; i < keymap->num_types; i++) { + free(keymap->types[i].entries); + free(keymap->types[i].level_names); + } + free(keymap->types); + darray_free(keymap->sym_interprets); + free(keymap->key_aliases); + free(keymap->group_names); + darray_free(keymap->mods); + darray_free(keymap->leds); + free(keymap->keycodes_section_name); + free(keymap->symbols_section_name); + free(keymap->types_section_name); + free(keymap->compat_section_name); + xkb_context_unref(keymap->ctx); + free(keymap); +} + +static const struct xkb_keymap_format_ops * +get_keymap_format_ops(enum xkb_keymap_format format) +{ + static const struct xkb_keymap_format_ops *keymap_format_ops[] = { + [XKB_KEYMAP_FORMAT_TEXT_V1] = &text_v1_keymap_format_ops, + }; + + if ((int) format < 0 || (int) format >= ARRAY_SIZE(keymap_format_ops)) + return NULL; + + return keymap_format_ops[format]; +} + +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_names(struct xkb_context *ctx, + const struct xkb_rule_names *rmlvo_in, + enum xkb_keymap_compile_flags flags) +{ + struct xkb_keymap *keymap; + struct xkb_rule_names rmlvo; + const enum xkb_keymap_format format = XKB_KEYMAP_FORMAT_TEXT_V1; + const struct xkb_keymap_format_ops *ops; + + ops = get_keymap_format_ops(format); + if (!ops || !ops->keymap_new_from_names) { + log_err_func(ctx, "unsupported keymap format: %d\n", format); + return NULL; + } + + if (flags & ~(XKB_MAP_COMPILE_PLACEHOLDER)) { + log_err_func(ctx, "unrecognized flags: %#x\n", flags); + return NULL; + } + + if (rmlvo_in) + rmlvo = *rmlvo_in; + else + memset(&rmlvo, 0, sizeof(rmlvo)); + + if (isempty(rmlvo.rules)) + rmlvo.rules = xkb_context_get_default_rules(ctx); + if (isempty(rmlvo.model)) + rmlvo.model = xkb_context_get_default_model(ctx); + /* Layout and variant are tied together, so don't try to use one from + * the caller and one from the environment. */ + if (isempty(rmlvo.layout)) { + rmlvo.layout = xkb_context_get_default_layout(ctx); + rmlvo.variant = xkb_context_get_default_variant(ctx); + } + /* Options can be empty, so respect that if passed in. */ + if (rmlvo.options == NULL) + rmlvo.options = xkb_context_get_default_options(ctx); + + keymap = xkb_keymap_new(ctx, format, flags); + if (!keymap) + return NULL; + + if (!ops->keymap_new_from_names(keymap, &rmlvo)) { + xkb_keymap_unref(keymap); + return NULL; + } + + return keymap; +} + +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_string(struct xkb_context *ctx, + const char *string, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags) +{ + struct xkb_keymap *keymap; + const struct xkb_keymap_format_ops *ops; + + ops = get_keymap_format_ops(format); + if (!ops || !ops->keymap_new_from_string) { + log_err_func(ctx, "unsupported keymap format: %d\n", format); + return NULL; + } + + if (flags & ~(XKB_MAP_COMPILE_PLACEHOLDER)) { + log_err_func(ctx, "unrecognized flags: %#x\n", flags); + return NULL; + } + + if (!string) { + log_err_func1(ctx, "no string specified\n"); + return NULL; + } + + keymap = xkb_keymap_new(ctx, format, flags); + if (!keymap) + return NULL; + + if (!ops->keymap_new_from_string(keymap, string)) { + xkb_keymap_unref(keymap); + return NULL; + } + + return keymap; +} + +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_buffer(struct xkb_context *ctx, + const char *buffer, size_t length, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags) +{ + struct xkb_keymap *keymap; + const struct xkb_keymap_format_ops *ops; + + ops = get_keymap_format_ops(format); + if (!ops || !ops->keymap_new_from_string) { + log_err_func(ctx, "unsupported keymap format: %d\n", format); + return NULL; + } + + if (flags & ~(XKB_MAP_COMPILE_PLACEHOLDER)) { + log_err_func(ctx, "unrecognized flags: %#x\n", flags); + return NULL; + } + + if (!buffer) { + log_err_func1(ctx, "no buffer specified\n"); + return NULL; + } + + keymap = xkb_keymap_new(ctx, format, flags); + if (!keymap) + return NULL; + + if (!ops->keymap_new_from_buffer(keymap, buffer, length)) { + xkb_keymap_unref(keymap); + return NULL; + } + + return keymap; +} + +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_file(struct xkb_context *ctx, + FILE *file, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags) +{ + struct xkb_keymap *keymap; + const struct xkb_keymap_format_ops *ops; + + ops = get_keymap_format_ops(format); + if (!ops || !ops->keymap_new_from_file) { + log_err_func(ctx, "unsupported keymap format: %d\n", format); + return NULL; + } + + if (flags & ~(XKB_MAP_COMPILE_PLACEHOLDER)) { + log_err_func(ctx, "unrecognized flags: %#x\n", flags); + return NULL; + } + + if (!file) { + log_err_func1(ctx, "no file specified\n"); + return NULL; + } + + keymap = xkb_keymap_new(ctx, format, flags); + if (!keymap) + return NULL; + + if (!ops->keymap_new_from_file(keymap, file)) { + xkb_keymap_unref(keymap); + return NULL; + } + + return keymap; +} + +XKB_EXPORT char * +xkb_keymap_get_as_string(struct xkb_keymap *keymap, + enum xkb_keymap_format format) +{ + const struct xkb_keymap_format_ops *ops; + + if (format == XKB_KEYMAP_USE_ORIGINAL_FORMAT) + format = keymap->format; + + ops = get_keymap_format_ops(format); + if (!ops || !ops->keymap_get_as_string) { + log_err_func(keymap->ctx, "unsupported keymap format: %d\n", format); + return NULL; + } + + return ops->keymap_get_as_string(keymap); +} + +/** + * Returns the total number of modifiers active in the keymap. + */ +XKB_EXPORT xkb_mod_index_t +xkb_keymap_num_mods(struct xkb_keymap *keymap) +{ + return darray_size(keymap->mods); +} + +/** + * Return the name for a given modifier. + */ +XKB_EXPORT const char * +xkb_keymap_mod_get_name(struct xkb_keymap *keymap, xkb_mod_index_t idx) +{ + if (idx >= darray_size(keymap->mods)) + return NULL; + + return xkb_atom_text(keymap->ctx, darray_item(keymap->mods, idx).name); +} + +/** + * Returns the index for a named modifier. + */ +XKB_EXPORT xkb_mod_index_t +xkb_keymap_mod_get_index(struct xkb_keymap *keymap, const char *name) +{ + xkb_mod_index_t i; + xkb_atom_t atom; + const struct xkb_mod *mod; + + atom = xkb_atom_lookup(keymap->ctx, name); + if (atom == XKB_ATOM_NONE) + return XKB_MOD_INVALID; + + darray_enumerate(i, mod, keymap->mods) + if (mod->name == atom) + return i; + + return XKB_MOD_INVALID; +} + +/** + * Return the total number of active groups in the keymap. + */ +XKB_EXPORT xkb_layout_index_t +xkb_keymap_num_layouts(struct xkb_keymap *keymap) +{ + return keymap->num_groups; +} + +/** + * Returns the name for a given group. + */ +XKB_EXPORT const char * +xkb_keymap_layout_get_name(struct xkb_keymap *keymap, xkb_layout_index_t idx) +{ + if (idx >= keymap->num_group_names) + return NULL; + + return xkb_atom_text(keymap->ctx, keymap->group_names[idx]); +} + +/** + * Returns the index for a named layout. + */ +XKB_EXPORT xkb_layout_index_t +xkb_keymap_layout_get_index(struct xkb_keymap *keymap, const char *name) +{ + xkb_atom_t atom = xkb_atom_lookup(keymap->ctx, name); + xkb_layout_index_t i; + + if (atom == XKB_ATOM_NONE) + return XKB_LAYOUT_INVALID; + + for (i = 0; i < keymap->num_group_names; i++) + if (keymap->group_names[i] == atom) + return i; + + return XKB_LAYOUT_INVALID; +} + +/** + * Returns the number of layouts active for a particular key. + */ +XKB_EXPORT xkb_layout_index_t +xkb_keymap_num_layouts_for_key(struct xkb_keymap *keymap, xkb_keycode_t kc) +{ + const struct xkb_key *key = XkbKey(keymap, kc); + + if (!key) + return 0; + + return key->num_groups; +} + +/** + * Returns the number of levels active for a particular key and layout. + */ +XKB_EXPORT xkb_level_index_t +xkb_keymap_num_levels_for_key(struct xkb_keymap *keymap, xkb_keycode_t kc, + xkb_layout_index_t layout) +{ + const struct xkb_key *key = XkbKey(keymap, kc); + + if (!key) + return 0; + + layout = wrap_group_into_range(layout, key->num_groups, + key->out_of_range_group_action, + key->out_of_range_group_number); + if (layout == XKB_LAYOUT_INVALID) + return 0; + + return XkbKeyGroupWidth(key, layout); +} + +/** + * Return the total number of LEDs in the keymap. + */ +XKB_EXPORT xkb_led_index_t +xkb_keymap_num_leds(struct xkb_keymap *keymap) +{ + return darray_size(keymap->leds); +} + +/** + * Returns the name for a given LED. + */ +XKB_EXPORT const char * +xkb_keymap_led_get_name(struct xkb_keymap *keymap, xkb_led_index_t idx) +{ + if (idx >= darray_size(keymap->leds)) + return NULL; + + return xkb_atom_text(keymap->ctx, darray_item(keymap->leds, idx).name); +} + +/** + * Returns the index for a named LED. + */ +XKB_EXPORT xkb_led_index_t +xkb_keymap_led_get_index(struct xkb_keymap *keymap, const char *name) +{ + xkb_atom_t atom = xkb_atom_lookup(keymap->ctx, name); + xkb_led_index_t i; + const struct xkb_led *led; + + if (atom == XKB_ATOM_NONE) + return XKB_LED_INVALID; + + darray_enumerate(i, led, keymap->leds) + if (led->name == atom) + return i; + + return XKB_LED_INVALID; +} + +/** + * As below, but takes an explicit layout/level rather than state. + */ +XKB_EXPORT int +xkb_keymap_key_get_syms_by_level(struct xkb_keymap *keymap, + xkb_keycode_t kc, + xkb_layout_index_t layout, + xkb_level_index_t level, + const xkb_keysym_t **syms_out) +{ + const struct xkb_key *key = XkbKey(keymap, kc); + int num_syms; + + if (!key) + goto err; + + layout = wrap_group_into_range(layout, key->num_groups, + key->out_of_range_group_action, + key->out_of_range_group_number); + if (layout == XKB_LAYOUT_INVALID) + goto err; + + if (level >= XkbKeyGroupWidth(key, layout)) + goto err; + + num_syms = key->groups[layout].levels[level].num_syms; + if (num_syms == 0) + goto err; + + if (num_syms == 1) + *syms_out = &key->groups[layout].levels[level].u.sym; + else + *syms_out = key->groups[layout].levels[level].u.syms; + + return num_syms; + +err: + *syms_out = NULL; + return 0; +} + +/** + * Simple boolean specifying whether or not the key should repeat. + */ +XKB_EXPORT int +xkb_keymap_key_repeats(struct xkb_keymap *keymap, xkb_keycode_t kc) +{ + const struct xkb_key *key = XkbKey(keymap, kc); + + if (!key) + return 0; + + return key->repeats; +} + +struct xkb_key * +XkbKeyByName(struct xkb_keymap *keymap, xkb_atom_t name, bool use_aliases) +{ + struct xkb_key *key; + + xkb_foreach_key(key, keymap) + if (key->name == name) + return key; + + if (use_aliases) { + xkb_atom_t new_name = XkbResolveKeyAlias(keymap, name); + if (new_name != XKB_ATOM_NONE) + return XkbKeyByName(keymap, new_name, false); + } + + return NULL; +} + +xkb_atom_t +XkbResolveKeyAlias(struct xkb_keymap *keymap, xkb_atom_t name) +{ + for (unsigned i = 0; i < keymap->num_key_aliases; i++) + if (keymap->key_aliases[i].alias == name) + return keymap->key_aliases[i].real; + + return XKB_ATOM_NONE; +} diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/action.c b/src/3rdparty/xkbcommon/src/xkbcomp/action.c new file mode 100644 index 0000000000..88323f9952 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/action.c @@ -0,0 +1,951 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +/* + * Copyright © 2012 Intel Corporation + * Copyright © 2012 Ran Benita <ran234@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + * Ran Benita <ran234@gmail.com> + */ + +#include "xkbcomp-priv.h" +#include "text.h" +#include "expr.h" +#include "action.h" + +static const ExprDef constTrue = { + .common = { .type = STMT_EXPR, .next = NULL }, + .op = EXPR_VALUE, + .value_type = EXPR_TYPE_BOOLEAN, + .value = { .ival = 1 }, +}; + +static const ExprDef constFalse = { + .common = { .type = STMT_EXPR, .next = NULL }, + .op = EXPR_VALUE, + .value_type = EXPR_TYPE_BOOLEAN, + .value = { .ival = 0 }, +}; + +enum action_field { + ACTION_FIELD_CLEAR_LOCKS, + ACTION_FIELD_LATCH_TO_LOCK, + ACTION_FIELD_GEN_KEY_EVENT, + ACTION_FIELD_REPORT, + ACTION_FIELD_DEFAULT, + ACTION_FIELD_AFFECT, + ACTION_FIELD_INCREMENT, + ACTION_FIELD_MODIFIERS, + ACTION_FIELD_GROUP, + ACTION_FIELD_X, + ACTION_FIELD_Y, + ACTION_FIELD_ACCEL, + ACTION_FIELD_BUTTON, + ACTION_FIELD_VALUE, + ACTION_FIELD_CONTROLS, + ACTION_FIELD_TYPE, + ACTION_FIELD_COUNT, + ACTION_FIELD_SCREEN, + ACTION_FIELD_SAME, + ACTION_FIELD_DATA, + ACTION_FIELD_DEVICE, + ACTION_FIELD_KEYCODE, + ACTION_FIELD_MODS_TO_CLEAR, +}; + +ActionsInfo * +NewActionsInfo(void) +{ + unsigned type; + ActionsInfo *info; + + info = calloc(1, sizeof(*info)); + if (!info) + return NULL; + + for (type = 0; type < _ACTION_TYPE_NUM_ENTRIES; type++) + info->actions[type].type = type; + + /* Apply some "factory defaults". */ + + /* Increment default button. */ + info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.flags = 0; + info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.value = 1; + + return info; +} + +void +FreeActionsInfo(ActionsInfo *info) +{ + free(info); +} + +static const LookupEntry fieldStrings[] = { + { "clearLocks", ACTION_FIELD_CLEAR_LOCKS }, + { "latchToLock", ACTION_FIELD_LATCH_TO_LOCK }, + { "genKeyEvent", ACTION_FIELD_GEN_KEY_EVENT }, + { "generateKeyEvent", ACTION_FIELD_GEN_KEY_EVENT }, + { "report", ACTION_FIELD_REPORT }, + { "default", ACTION_FIELD_DEFAULT }, + { "affect", ACTION_FIELD_AFFECT }, + { "increment", ACTION_FIELD_INCREMENT }, + { "modifiers", ACTION_FIELD_MODIFIERS }, + { "mods", ACTION_FIELD_MODIFIERS }, + { "group", ACTION_FIELD_GROUP }, + { "x", ACTION_FIELD_X }, + { "y", ACTION_FIELD_Y }, + { "accel", ACTION_FIELD_ACCEL }, + { "accelerate", ACTION_FIELD_ACCEL }, + { "repeat", ACTION_FIELD_ACCEL }, + { "button", ACTION_FIELD_BUTTON }, + { "value", ACTION_FIELD_VALUE }, + { "controls", ACTION_FIELD_CONTROLS }, + { "ctrls", ACTION_FIELD_CONTROLS }, + { "type", ACTION_FIELD_TYPE }, + { "count", ACTION_FIELD_COUNT }, + { "screen", ACTION_FIELD_SCREEN }, + { "same", ACTION_FIELD_SAME }, + { "sameServer", ACTION_FIELD_SAME }, + { "data", ACTION_FIELD_DATA }, + { "device", ACTION_FIELD_DEVICE }, + { "dev", ACTION_FIELD_DEVICE }, + { "key", ACTION_FIELD_KEYCODE }, + { "keycode", ACTION_FIELD_KEYCODE }, + { "kc", ACTION_FIELD_KEYCODE }, + { "clearmods", ACTION_FIELD_MODS_TO_CLEAR }, + { "clearmodifiers", ACTION_FIELD_MODS_TO_CLEAR }, + { NULL, 0 } +}; + +static bool +stringToAction(const char *str, unsigned *type_rtrn) +{ + return LookupString(actionTypeNames, str, type_rtrn); +} + +static bool +stringToField(const char *str, enum action_field *field_rtrn) +{ + return LookupString(fieldStrings, str, field_rtrn); +} + +static const char * +fieldText(enum action_field field) +{ + return LookupValue(fieldStrings, field); +} + +/***====================================================================***/ + +static inline bool +ReportMismatch(struct xkb_keymap *keymap, enum xkb_action_type action, + enum action_field field, const char *type) +{ + log_err(keymap->ctx, + "Value of %s field must be of type %s; " + "Action %s definition ignored\n", + fieldText(field), type, ActionTypeText(action)); + return false; +} + +static inline bool +ReportIllegal(struct xkb_keymap *keymap, enum xkb_action_type action, + enum action_field field) +{ + log_err(keymap->ctx, + "Field %s is not defined for an action of type %s; " + "Action definition ignored\n", + fieldText(field), ActionTypeText(action)); + return false; +} + +static inline bool +ReportActionNotArray(struct xkb_keymap *keymap, enum xkb_action_type action, + enum action_field field) +{ + log_err(keymap->ctx, + "The %s field in the %s action is not an array; " + "Action definition ignored\n", + fieldText(field), ActionTypeText(action)); + return false; +} + +static inline bool +ReportNotFound(struct xkb_keymap *keymap, enum xkb_action_type action, + enum action_field field, const char *what, const char *bad) +{ + log_err(keymap->ctx, + "%s named %s not found; " + "Ignoring the %s field of an %s action\n", + what, bad, fieldText(field), ActionTypeText(action)); + return false; +} + +static bool +HandleNoAction(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) + +{ + return true; +} + +static bool +CheckLatchLockFlags(struct xkb_keymap *keymap, enum xkb_action_type action, + enum action_field field, const ExprDef *value, + enum xkb_action_flags *flags_inout) +{ + enum xkb_action_flags tmp; + bool result; + + if (field == ACTION_FIELD_CLEAR_LOCKS) + tmp = ACTION_LOCK_CLEAR; + else if (field == ACTION_FIELD_LATCH_TO_LOCK) + tmp = ACTION_LATCH_TO_LOCK; + else + return false; /* WSGO! */ + + if (!ExprResolveBoolean(keymap->ctx, value, &result)) + return ReportMismatch(keymap, action, field, "boolean"); + + if (result) + *flags_inout |= tmp; + else + *flags_inout &= ~tmp; + + return true; +} + +static bool +CheckModifierField(struct xkb_keymap *keymap, enum xkb_action_type action, + const ExprDef *value, enum xkb_action_flags *flags_inout, + xkb_mod_mask_t *mods_rtrn) +{ + if (value->op == EXPR_IDENT) { + const char *valStr; + valStr = xkb_atom_text(keymap->ctx, value->value.str); + if (valStr && (istreq(valStr, "usemodmapmods") || + istreq(valStr, "modmapmods"))) { + + *mods_rtrn = 0; + *flags_inout |= ACTION_MODS_LOOKUP_MODMAP; + return true; + } + } + + if (!ExprResolveModMask(keymap, value, MOD_BOTH, mods_rtrn)) + return ReportMismatch(keymap, action, + ACTION_FIELD_MODIFIERS, "modifier mask"); + + *flags_inout &= ~ACTION_MODS_LOOKUP_MODMAP; + return true; +} + +static bool +HandleSetLatchMods(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_mod_action *act = &action->mods; + enum xkb_action_flags rtrn, t1; + xkb_mod_mask_t t2; + + if (array_ndx != NULL) { + switch (field) { + case ACTION_FIELD_CLEAR_LOCKS: + case ACTION_FIELD_LATCH_TO_LOCK: + case ACTION_FIELD_MODIFIERS: + return ReportActionNotArray(keymap, action->type, field); + default: + break; + } + } + + switch (field) { + case ACTION_FIELD_CLEAR_LOCKS: + case ACTION_FIELD_LATCH_TO_LOCK: + rtrn = act->flags; + if (CheckLatchLockFlags(keymap, action->type, field, value, &rtrn)) { + act->flags = rtrn; + return true; + } + return false; + + case ACTION_FIELD_MODIFIERS: + t1 = act->flags; + if (CheckModifierField(keymap, action->type, value, &t1, &t2)) { + act->flags = t1; + act->mods.mods = t2; + return true; + } + return false; + + default: + break; + } + + return ReportIllegal(keymap, action->type, field); +} + +static bool +HandleLockMods(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_mod_action *act = &action->mods; + enum xkb_action_flags t1; + xkb_mod_mask_t t2; + + if (array_ndx && field == ACTION_FIELD_MODIFIERS) + return ReportActionNotArray(keymap, action->type, field); + + switch (field) { + case ACTION_FIELD_MODIFIERS: + t1 = act->flags; + if (CheckModifierField(keymap, action->type, value, &t1, &t2)) { + act->flags = t1; + act->mods.mods = t2; + return true; + } + return false; + + default: + break; + } + + return ReportIllegal(keymap, action->type, field); +} + +static bool +CheckGroupField(struct xkb_keymap *keymap, unsigned action, + const ExprDef *value, enum xkb_action_flags *flags_inout, + xkb_layout_index_t *grp_rtrn) +{ + const ExprDef *spec; + + if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) { + *flags_inout &= ~ACTION_ABSOLUTE_SWITCH; + spec = value->value.child; + } + else { + *flags_inout |= ACTION_ABSOLUTE_SWITCH; + spec = value; + } + + if (!ExprResolveGroup(keymap->ctx, spec, grp_rtrn)) + return ReportMismatch(keymap, action, ACTION_FIELD_GROUP, + "integer (range 1..8)"); + + if (value->op == EXPR_NEGATE) + *grp_rtrn = -*grp_rtrn; + else if (value->op != EXPR_UNARY_PLUS) + (*grp_rtrn)--; + + return true; +} + +static bool +HandleSetLatchGroup(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_group_action *act = &action->group; + enum xkb_action_flags rtrn, t1; + xkb_layout_index_t t2; + + if (array_ndx != NULL) { + switch (field) { + case ACTION_FIELD_CLEAR_LOCKS: + case ACTION_FIELD_LATCH_TO_LOCK: + case ACTION_FIELD_GROUP: + return ReportActionNotArray(keymap, action->type, field); + + default: + break; + } + } + + switch (field) { + case ACTION_FIELD_CLEAR_LOCKS: + case ACTION_FIELD_LATCH_TO_LOCK: + rtrn = act->flags; + if (CheckLatchLockFlags(keymap, action->type, field, value, &rtrn)) { + act->flags = rtrn; + return true; + } + return false; + + case ACTION_FIELD_GROUP: + t1 = act->flags; + if (CheckGroupField(keymap, action->type, value, &t1, &t2)) { + act->flags = t1; + act->group = t2; + return true; + } + return false; + + default: + break; + } + + return ReportIllegal(keymap, action->type, field); +} + +static bool +HandleLockGroup(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_group_action *act = &action->group; + enum xkb_action_flags t1; + xkb_layout_index_t t2; + + if ((array_ndx != NULL) && (field == ACTION_FIELD_GROUP)) + return ReportActionNotArray(keymap, action->type, field); + if (field == ACTION_FIELD_GROUP) { + t1 = act->flags; + if (CheckGroupField(keymap, action->type, value, &t1, &t2)) { + act->flags = t1; + act->group = t2; + return true; + } + return false; + } + return ReportIllegal(keymap, action->type, field); +} + +static bool +HandleMovePtr(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_pointer_action *act = &action->ptr; + bool absolute; + + if (array_ndx && (field == ACTION_FIELD_X || field == ACTION_FIELD_Y)) + return ReportActionNotArray(keymap, action->type, field); + + if (field == ACTION_FIELD_X || field == ACTION_FIELD_Y) { + int val; + + if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) + absolute = false; + else + absolute = true; + + if (!ExprResolveInteger(keymap->ctx, value, &val)) + return ReportMismatch(keymap, action->type, field, "integer"); + + if (field == ACTION_FIELD_X) { + if (absolute) + act->flags |= ACTION_ABSOLUTE_X; + act->x = val; + } + else { + if (absolute) + act->flags |= ACTION_ABSOLUTE_Y; + act->y = val; + } + + return true; + } + else if (field == ACTION_FIELD_ACCEL) { + bool set; + + if (!ExprResolveBoolean(keymap->ctx, value, &set)) + return ReportMismatch(keymap, action->type, field, "boolean"); + + if (set) + act->flags &= ~ACTION_NO_ACCEL; + else + act->flags |= ACTION_NO_ACCEL; + } + + return ReportIllegal(keymap, action->type, field); +} + +static const LookupEntry lockWhich[] = { + { "both", 0 }, + { "lock", ACTION_LOCK_NO_UNLOCK }, + { "neither", (ACTION_LOCK_NO_LOCK | ACTION_LOCK_NO_UNLOCK) }, + { "unlock", ACTION_LOCK_NO_LOCK }, + { NULL, 0 } +}; + +static bool +HandlePtrBtn(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_pointer_button_action *act = &action->btn; + + if (field == ACTION_FIELD_BUTTON) { + int btn; + + if (array_ndx) + return ReportActionNotArray(keymap, action->type, field); + + if (!ExprResolveButton(keymap->ctx, value, &btn)) + return ReportMismatch(keymap, action->type, field, + "integer (range 1..5)"); + + if (btn < 0 || btn > 5) { + log_err(keymap->ctx, + "Button must specify default or be in the range 1..5; " + "Illegal button value %d ignored\n", btn); + return false; + } + + act->button = btn; + return true; + } + else if (action->type == ACTION_TYPE_PTR_LOCK && + field == ACTION_FIELD_AFFECT) { + enum xkb_action_flags val; + + if (array_ndx) + return ReportActionNotArray(keymap, action->type, field); + + if (!ExprResolveEnum(keymap->ctx, value, &val, lockWhich)) + return ReportMismatch(keymap, action->type, field, + "lock or unlock"); + + act->flags &= ~(ACTION_LOCK_NO_LOCK | ACTION_LOCK_NO_UNLOCK); + act->flags |= val; + return true; + } + else if (field == ACTION_FIELD_COUNT) { + int btn; + + if (array_ndx) + return ReportActionNotArray(keymap, action->type, field); + + /* XXX: Should this actually be ResolveButton? */ + if (!ExprResolveButton(keymap->ctx, value, &btn)) + return ReportMismatch(keymap, action->type, field, "integer"); + + if (btn < 0 || btn > 255) { + log_err(keymap->ctx, + "The count field must have a value in the range 0..255; " + "Illegal count %d ignored\n", btn); + return false; + } + + act->count = btn; + return true; + } + return ReportIllegal(keymap, action->type, field); +} + +static const LookupEntry ptrDflts[] = { + { "dfltbtn", 1 }, + { "defaultbutton", 1 }, + { "button", 1 }, + { NULL, 0 } +}; + +static bool +HandleSetPtrDflt(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_pointer_default_action *act = &action->dflt; + + if (field == ACTION_FIELD_AFFECT) { + unsigned int val; + + if (array_ndx) + return ReportActionNotArray(keymap, action->type, field); + + if (!ExprResolveEnum(keymap->ctx, value, &val, ptrDflts)) + return ReportMismatch(keymap, action->type, field, + "pointer component"); + return true; + } + else if (field == ACTION_FIELD_BUTTON || field == ACTION_FIELD_VALUE) { + const ExprDef *button; + int btn; + + if (array_ndx) + return ReportActionNotArray(keymap, action->type, field); + + if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) { + act->flags &= ~ACTION_ABSOLUTE_SWITCH; + button = value->value.child; + } + else { + act->flags |= ACTION_ABSOLUTE_SWITCH; + button = value; + } + + if (!ExprResolveButton(keymap->ctx, button, &btn)) + return ReportMismatch(keymap, action->type, field, + "integer (range 1..5)"); + + if (btn < 0 || btn > 5) { + log_err(keymap->ctx, + "New default button value must be in the range 1..5; " + "Illegal default button value %d ignored\n", btn); + return false; + } + if (btn == 0) { + log_err(keymap->ctx, + "Cannot set default pointer button to \"default\"; " + "Illegal default button setting ignored\n"); + return false; + } + + act->value = (value->op == EXPR_NEGATE ? -btn: btn); + return true; + } + + return ReportIllegal(keymap, action->type, field); +} + +static bool +HandleSwitchScreen(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_switch_screen_action *act = &action->screen; + + if (field == ACTION_FIELD_SCREEN) { + const ExprDef *scrn; + int val; + + if (array_ndx) + return ReportActionNotArray(keymap, action->type, field); + + if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) { + act->flags &= ~ACTION_ABSOLUTE_SWITCH; + scrn = value->value.child; + } + else { + act->flags |= ACTION_ABSOLUTE_SWITCH; + scrn = value; + } + + if (!ExprResolveInteger(keymap->ctx, scrn, &val)) + return ReportMismatch(keymap, action->type, field, + "integer (0..255)"); + + if (val < 0 || val > 255) { + log_err(keymap->ctx, + "Screen index must be in the range 1..255; " + "Illegal screen value %d ignored\n", val); + return false; + } + + act->screen = (value->op == EXPR_NEGATE ? -val : val); + return true; + } + else if (field == ACTION_FIELD_SAME) { + bool set; + + if (array_ndx) + return ReportActionNotArray(keymap, action->type, field); + + if (!ExprResolveBoolean(keymap->ctx, value, &set)) + return ReportMismatch(keymap, action->type, field, "boolean"); + + if (set) + act->flags &= ~ACTION_SAME_SCREEN; + else + act->flags |= ACTION_SAME_SCREEN; + + return true; + } + + return ReportIllegal(keymap, action->type, field); +} + +static bool +HandleSetLockControls(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_controls_action *act = &action->ctrls; + + if (field == ACTION_FIELD_CONTROLS) { + unsigned int mask; + + if (array_ndx) + return ReportActionNotArray(keymap, action->type, field); + + if (!ExprResolveMask(keymap->ctx, value, &mask, ctrlMaskNames)) + return ReportMismatch(keymap, action->type, field, + "controls mask"); + + act->ctrls = mask; + return true; + } + + return ReportIllegal(keymap, action->type, field); +} + +static bool +HandlePrivate(struct xkb_keymap *keymap, union xkb_action *action, + enum action_field field, const ExprDef *array_ndx, + const ExprDef *value) +{ + struct xkb_private_action *act = &action->priv; + + if (field == ACTION_FIELD_TYPE) { + int type; + + if (!ExprResolveInteger(keymap->ctx, value, &type)) + return ReportMismatch(keymap, ACTION_TYPE_PRIVATE, field, "integer"); + + if (type < 0 || type > 255) { + log_err(keymap->ctx, + "Private action type must be in the range 0..255; " + "Illegal type %d ignored\n", type); + return false; + } + + /* + * It's possible for someone to write something like this: + * actions = [ Private(type=3,data[0]=1,data[1]=3,data[2]=3) ] + * where the type refers to some existing action type, e.g. LockMods. + * This assumes that this action's struct is laid out in memory + * exactly as described in the XKB specification and libraries. + * We, however, have changed these structs in various ways, so this + * assumption is no longer true. Since this is a lousy "feature", we + * make actions like these no-ops for now. + */ + if (type < ACTION_TYPE_PRIVATE) { + log_info(keymap->ctx, + "Private actions of type %s are not supported; Ignored\n", + ActionTypeText(type)); + act->type = ACTION_TYPE_NONE; + } + else { + act->type = (enum xkb_action_type) type; + } + + return true; + } + else if (field == ACTION_FIELD_DATA) { + if (array_ndx == NULL) { + xkb_atom_t val; + const char *str; + int len; + + if (!ExprResolveString(keymap->ctx, value, &val)) + return ReportMismatch(keymap, action->type, field, "string"); + + str = xkb_atom_text(keymap->ctx, val); + len = strlen(str); + if (len < 1 || len > 7) { + log_warn(keymap->ctx, + "A private action has 7 data bytes; " + "Extra %d bytes ignored\n", len - 6); + return false; + } + + strncpy((char *) act->data, str, sizeof(act->data)); + return true; + } + else { + int ndx, datum; + + if (!ExprResolveInteger(keymap->ctx, array_ndx, &ndx)) { + log_err(keymap->ctx, + "Array subscript must be integer; " + "Illegal subscript ignored\n"); + return false; + } + + if (ndx < 0 || ndx >= sizeof(act->data)) { + log_err(keymap->ctx, + "The data for a private action is %lu bytes long; " + "Attempt to use data[%d] ignored\n", + (unsigned long) sizeof(act->data), ndx); + return false; + } + + if (!ExprResolveInteger(keymap->ctx, value, &datum)) + return ReportMismatch(keymap, act->type, field, "integer"); + + if (datum < 0 || datum > 255) { + log_err(keymap->ctx, + "All data for a private action must be 0..255; " + "Illegal datum %d ignored\n", datum); + return false; + } + + act->data[ndx] = (uint8_t) datum; + return true; + } + } + + return ReportIllegal(keymap, ACTION_TYPE_NONE, field); +} + +typedef bool (*actionHandler)(struct xkb_keymap *keymap, + union xkb_action *action, + enum action_field field, + const ExprDef *array_ndx, + const ExprDef *value); + +static const actionHandler handleAction[_ACTION_TYPE_NUM_ENTRIES] = { + [ACTION_TYPE_NONE] = HandleNoAction, + [ACTION_TYPE_MOD_SET] = HandleSetLatchMods, + [ACTION_TYPE_MOD_LATCH] = HandleSetLatchMods, + [ACTION_TYPE_MOD_LOCK] = HandleLockMods, + [ACTION_TYPE_GROUP_SET] = HandleSetLatchGroup, + [ACTION_TYPE_GROUP_LATCH] = HandleSetLatchGroup, + [ACTION_TYPE_GROUP_LOCK] = HandleLockGroup, + [ACTION_TYPE_PTR_MOVE] = HandleMovePtr, + [ACTION_TYPE_PTR_BUTTON] = HandlePtrBtn, + [ACTION_TYPE_PTR_LOCK] = HandlePtrBtn, + [ACTION_TYPE_PTR_DEFAULT] = HandleSetPtrDflt, + [ACTION_TYPE_TERMINATE] = HandleNoAction, + [ACTION_TYPE_SWITCH_VT] = HandleSwitchScreen, + [ACTION_TYPE_CTRL_SET] = HandleSetLockControls, + [ACTION_TYPE_CTRL_LOCK] = HandleSetLockControls, + [ACTION_TYPE_PRIVATE] = HandlePrivate, +}; + +/***====================================================================***/ + +bool +HandleActionDef(ExprDef *def, struct xkb_keymap *keymap, + union xkb_action *action, ActionsInfo *info) +{ + ExprDef *arg; + const char *str; + unsigned handler_type; + + if (def->op != EXPR_ACTION_DECL) { + log_err(keymap->ctx, "Expected an action definition, found %s\n", + expr_op_type_to_string(def->op)); + return false; + } + + str = xkb_atom_text(keymap->ctx, def->value.action.name); + if (!stringToAction(str, &handler_type)) { + log_err(keymap->ctx, "Unknown action %s\n", str); + return false; + } + + /* + * Get the default values for this action type, as modified by + * statements such as: + * latchMods.clearLocks = True; + */ + *action = info->actions[handler_type]; + + /* + * Now change the action properties as specified for this + * particular instance, e.g. "modifiers" and "clearLocks" in: + * SetMods(modifiers=Alt,clearLocks); + */ + for (arg = def->value.action.args; arg != NULL; + arg = (ExprDef *) arg->common.next) { + const ExprDef *value; + ExprDef *field, *arrayRtrn; + const char *elemRtrn, *fieldRtrn; + enum action_field fieldNdx; + + if (arg->op == EXPR_ASSIGN) { + field = arg->value.binary.left; + value = arg->value.binary.right; + } + else if (arg->op == EXPR_NOT || arg->op == EXPR_INVERT) { + field = arg->value.child; + value = &constFalse; + } + else { + field = arg; + value = &constTrue; + } + + if (!ExprResolveLhs(keymap->ctx, field, &elemRtrn, &fieldRtrn, + &arrayRtrn)) + return false; + + if (elemRtrn) { + log_err(keymap->ctx, + "Cannot change defaults in an action definition; " + "Ignoring attempt to change %s.%s\n", + elemRtrn, fieldRtrn); + return false; + } + + if (!stringToField(fieldRtrn, &fieldNdx)) { + log_err(keymap->ctx, "Unknown field name %s\n", fieldRtrn); + return false; + } + + if (!handleAction[handler_type](keymap, action, fieldNdx, arrayRtrn, + value)) + return false; + } + + return true; +} + + +bool +SetActionField(struct xkb_keymap *keymap, const char *elem, const char *field, + ExprDef *array_ndx, ExprDef *value, ActionsInfo *info) +{ + unsigned action; + enum action_field action_field; + + if (!stringToAction(elem, &action)) + return false; + + if (!stringToField(field, &action_field)) { + log_err(keymap->ctx, "\"%s\" is not a legal field name\n", field); + return false; + } + + return handleAction[action](keymap, &info->actions[action], + action_field, array_ndx, value); +} diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/action.h b/src/3rdparty/xkbcommon/src/xkbcomp/action.h new file mode 100644 index 0000000000..82915ef57d --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/action.h @@ -0,0 +1,53 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +#ifndef XKBCOMP_ACTION_H +#define XKBCOMP_ACTION_H + +/* + * This struct contains the default values which every new action + * (e.g. in an interpret statement) starts off with. It can be + * modified within the files (see calls to SetActionField). + */ +typedef struct { + union xkb_action actions[_ACTION_TYPE_NUM_ENTRIES]; +} ActionsInfo; + +ActionsInfo * +NewActionsInfo(void); + +void +FreeActionsInfo(ActionsInfo *info); + +bool +HandleActionDef(ExprDef *def, struct xkb_keymap *keymap, + union xkb_action *action, ActionsInfo *info); + +bool +SetActionField(struct xkb_keymap *keymap, const char *elem, const char *field, + ExprDef *array_ndx, ExprDef *value, ActionsInfo *info); + +#endif diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/ast-build.c b/src/3rdparty/xkbcommon/src/xkbcomp/ast-build.c new file mode 100644 index 0000000000..c9b7cb0a3e --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/ast-build.c @@ -0,0 +1,793 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +/* + * Copyright © 2012 Intel Corporation + * Copyright © 2012 Ran Benita <ran234@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + * Ran Benita <ran234@gmail.com> + */ + +#include "xkbcomp-priv.h" +#include "ast-build.h" +#include "parser-priv.h" +#include "include.h" + +ParseCommon * +AppendStmt(ParseCommon *to, ParseCommon *append) +{ + ParseCommon *iter; + + if (!to) + return append; + + for (iter = to; iter->next; iter = iter->next); + + iter->next = append; + return to; +} + +ExprDef * +ExprCreate(enum expr_op_type op, enum expr_value_type type) +{ + ExprDef *expr = malloc(sizeof(*expr)); + if (!expr) + return NULL; + + expr->common.type = STMT_EXPR; + expr->common.next = NULL; + expr->op = op; + expr->value_type = type; + + return expr; +} + +ExprDef * +ExprCreateUnary(enum expr_op_type op, enum expr_value_type type, + ExprDef *child) +{ + ExprDef *expr = malloc(sizeof(*expr)); + if (!expr) + return NULL; + + expr->common.type = STMT_EXPR; + expr->common.next = NULL; + expr->op = op; + expr->value_type = type; + expr->value.child = child; + + return expr; +} + +ExprDef * +ExprCreateBinary(enum expr_op_type op, ExprDef *left, ExprDef *right) +{ + ExprDef *expr = malloc(sizeof(*expr)); + if (!expr) + return NULL; + + expr->common.type = STMT_EXPR; + expr->common.next = NULL; + expr->op = op; + if (op == EXPR_ASSIGN || left->value_type == EXPR_TYPE_UNKNOWN) + expr->value_type = right->value_type; + else if (left->value_type == right->value_type || + right->value_type == EXPR_TYPE_UNKNOWN) + expr->value_type = left->value_type; + else + expr->value_type = EXPR_TYPE_UNKNOWN; + expr->value.binary.left = left; + expr->value.binary.right = right; + + return expr; +} + +KeycodeDef * +KeycodeCreate(xkb_atom_t name, int64_t value) +{ + KeycodeDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_KEYCODE; + def->common.next = NULL; + def->name = name; + def->value = value; + + return def; +} + +KeyAliasDef * +KeyAliasCreate(xkb_atom_t alias, xkb_atom_t real) +{ + KeyAliasDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_ALIAS; + def->common.next = NULL; + def->alias = alias; + def->real = real; + + return def; +} + +VModDef * +VModCreate(xkb_atom_t name, ExprDef *value) +{ + VModDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_VMOD; + def->common.next = NULL; + def->name = name; + def->value = value; + + return def; +} + +VarDef * +VarCreate(ExprDef *name, ExprDef *value) +{ + VarDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_VAR; + def->common.next = NULL; + def->name = name; + def->value = value; + + return def; +} + +VarDef * +BoolVarCreate(xkb_atom_t nameToken, unsigned set) +{ + ExprDef *name, *value; + VarDef *def; + + name = ExprCreate(EXPR_IDENT, EXPR_TYPE_UNKNOWN); + name->value.str = nameToken; + value = ExprCreate(EXPR_VALUE, EXPR_TYPE_BOOLEAN); + value->value.uval = set; + def = VarCreate(name, value); + + return def; +} + +InterpDef * +InterpCreate(char *sym, ExprDef *match) +{ + InterpDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_INTERP; + def->common.next = NULL; + def->sym = sym; + def->match = match; + + return def; +} + +KeyTypeDef * +KeyTypeCreate(xkb_atom_t name, VarDef *body) +{ + KeyTypeDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_TYPE; + def->common.next = NULL; + def->merge = MERGE_DEFAULT; + def->name = name; + def->body = body; + + return def; +} + +SymbolsDef * +SymbolsCreate(xkb_atom_t keyName, ExprDef *symbols) +{ + SymbolsDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_SYMBOLS; + def->common.next = NULL; + def->merge = MERGE_DEFAULT; + def->keyName = keyName; + def->symbols = symbols; + + return def; +} + +GroupCompatDef * +GroupCompatCreate(int group, ExprDef *val) +{ + GroupCompatDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_GROUP_COMPAT; + def->common.next = NULL; + def->merge = MERGE_DEFAULT; + def->group = group; + def->def = val; + + return def; +} + +ModMapDef * +ModMapCreate(uint32_t modifier, ExprDef *keys) +{ + ModMapDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_MODMAP; + def->common.next = NULL; + def->merge = MERGE_DEFAULT; + def->modifier = modifier; + def->keys = keys; + + return def; +} + +LedMapDef * +LedMapCreate(xkb_atom_t name, VarDef *body) +{ + LedMapDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_LED_MAP; + def->common.next = NULL; + def->merge = MERGE_DEFAULT; + def->name = name; + def->body = body; + + return def; +} + +LedNameDef * +LedNameCreate(int ndx, ExprDef *name, bool virtual) +{ + LedNameDef *def = malloc(sizeof(*def)); + if (!def) + return NULL; + + def->common.type = STMT_LED_NAME; + def->common.next = NULL; + def->merge = MERGE_DEFAULT; + def->ndx = ndx; + def->name = name; + def->virtual = virtual; + + return def; +} + +ExprDef * +ActionCreate(xkb_atom_t name, ExprDef *args) +{ + ExprDef *act = malloc(sizeof(*act)); + if (!act) + return NULL; + + act->common.type = STMT_EXPR; + act->common.next = NULL; + act->op = EXPR_ACTION_DECL; + act->value.action.name = name; + act->value.action.args = args; + + return act; +} + +ExprDef * +CreateKeysymList(char *sym) +{ + ExprDef *def; + + def = ExprCreate(EXPR_KEYSYM_LIST, EXPR_TYPE_SYMBOLS); + + darray_init(def->value.list.syms); + darray_init(def->value.list.symsMapIndex); + darray_init(def->value.list.symsNumEntries); + + darray_append(def->value.list.syms, sym); + darray_append(def->value.list.symsMapIndex, 0); + darray_append(def->value.list.symsNumEntries, 1); + + return def; +} + +ExprDef * +CreateMultiKeysymList(ExprDef *list) +{ + size_t nLevels = darray_size(list->value.list.symsMapIndex); + + darray_resize(list->value.list.symsMapIndex, 1); + darray_resize(list->value.list.symsNumEntries, 1); + darray_item(list->value.list.symsMapIndex, 0) = 0; + darray_item(list->value.list.symsNumEntries, 0) = nLevels; + + return list; +} + +ExprDef * +AppendKeysymList(ExprDef *list, char *sym) +{ + size_t nSyms = darray_size(list->value.list.syms); + + darray_append(list->value.list.symsMapIndex, nSyms); + darray_append(list->value.list.symsNumEntries, 1); + darray_append(list->value.list.syms, sym); + + return list; +} + +ExprDef * +AppendMultiKeysymList(ExprDef *list, ExprDef *append) +{ + size_t nSyms = darray_size(list->value.list.syms); + size_t numEntries = darray_size(append->value.list.syms); + + darray_append(list->value.list.symsMapIndex, nSyms); + darray_append(list->value.list.symsNumEntries, numEntries); + darray_append_items(list->value.list.syms, + darray_mem(append->value.list.syms, 0), + numEntries); + + darray_resize(append->value.list.syms, 0); + FreeStmt(&append->common); + + return list; +} + +static void +FreeInclude(IncludeStmt *incl); + +IncludeStmt * +IncludeCreate(struct xkb_context *ctx, char *str, enum merge_mode merge) +{ + IncludeStmt *incl, *first; + char *file, *map, *stmt, *tmp, *extra_data; + char nextop; + + incl = first = NULL; + file = map = NULL; + tmp = str; + stmt = strdup_safe(str); + while (tmp && *tmp) + { + if (!ParseIncludeMap(&tmp, &file, &map, &nextop, &extra_data)) + goto err; + + /* + * Given an RMLVO (here layout) like 'us,,fr', the rules parser + * will give out something like 'pc+us+:2+fr:3+inet(evdev)'. + * We should just skip the ':2' in this case and leave it to the + * appropriate section to deal with the empty group. + */ + if (isempty(file)) { + free(file); + free(map); + free(extra_data); + continue; + } + + if (first == NULL) { + first = incl = malloc(sizeof(*first)); + } else { + incl->next_incl = malloc(sizeof(*first)); + incl = incl->next_incl; + } + + if (!incl) { + log_wsgo(ctx, + "Allocation failure in IncludeCreate; " + "Using only part of the include\n"); + break; + } + + incl->common.type = STMT_INCLUDE; + incl->common.next = NULL; + incl->merge = merge; + incl->stmt = NULL; + incl->file = file; + incl->map = map; + incl->modifier = extra_data; + incl->next_incl = NULL; + + if (nextop == '|') + merge = MERGE_AUGMENT; + else + merge = MERGE_OVERRIDE; + } + + if (first) + first->stmt = stmt; + else + free(stmt); + + return first; + +err: + log_err(ctx, "Illegal include statement \"%s\"; Ignored\n", stmt); + FreeInclude(first); + free(stmt); + return NULL; +} + +static void +EscapeMapName(char *name) +{ + /* + * All latin-1 alphanumerics, plus parens, slash, minus, underscore and + * wildcards. + */ + static const unsigned char legal[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x83, + 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff + }; + + if (!name) + return; + + while (*name) { + if (!(legal[*name / 8] & (1 << (*name % 8)))) + *name = '_'; + name++; + } +} + +XkbFile * +XkbFileCreate(struct xkb_context *ctx, enum xkb_file_type type, char *name, + ParseCommon *defs, enum xkb_map_flags flags) +{ + XkbFile *file; + + file = calloc(1, sizeof(*file)); + if (!file) + return NULL; + + EscapeMapName(name); + file->file_type = type; + file->topName = strdup_safe(name); + file->name = name; + file->defs = defs; + file->flags = flags; + + return file; +} + +XkbFile * +XkbFileFromComponents(struct xkb_context *ctx, + const struct xkb_component_names *kkctgs) +{ + char *const components[] = { + kkctgs->keycodes, kkctgs->types, + kkctgs->compat, kkctgs->symbols, + }; + enum xkb_file_type type; + IncludeStmt *include = NULL; + XkbFile *file = NULL; + ParseCommon *defs = NULL; + + for (type = FIRST_KEYMAP_FILE_TYPE; type <= LAST_KEYMAP_FILE_TYPE; type++) { + include = IncludeCreate(ctx, components[type], MERGE_DEFAULT); + if (!include) + goto err; + + file = XkbFileCreate(ctx, type, NULL, &include->common, 0); + if (!file) { + FreeInclude(include); + goto err; + } + + defs = AppendStmt(defs, &file->common); + } + + file = XkbFileCreate(ctx, FILE_TYPE_KEYMAP, NULL, defs, 0); + if (!file) + goto err; + + return file; + +err: + FreeXkbFile((XkbFile *) defs); + return NULL; +} + +static void +FreeExpr(ExprDef *expr) +{ + char **sym; + + if (!expr) + return; + + switch (expr->op) { + case EXPR_ACTION_LIST: + case EXPR_NEGATE: + case EXPR_UNARY_PLUS: + case EXPR_NOT: + case EXPR_INVERT: + FreeStmt(&expr->value.child->common); + break; + + case EXPR_DIVIDE: + case EXPR_ADD: + case EXPR_SUBTRACT: + case EXPR_MULTIPLY: + case EXPR_ASSIGN: + FreeStmt(&expr->value.binary.left->common); + FreeStmt(&expr->value.binary.right->common); + break; + + case EXPR_ACTION_DECL: + FreeStmt(&expr->value.action.args->common); + break; + + case EXPR_ARRAY_REF: + FreeStmt(&expr->value.array.entry->common); + break; + + case EXPR_KEYSYM_LIST: + darray_foreach(sym, expr->value.list.syms) + free(*sym); + darray_free(expr->value.list.syms); + darray_free(expr->value.list.symsMapIndex); + darray_free(expr->value.list.symsNumEntries); + break; + + default: + break; + } +} + +static void +FreeInclude(IncludeStmt *incl) +{ + IncludeStmt *next; + + while (incl) + { + next = incl->next_incl; + + free(incl->file); + free(incl->map); + free(incl->modifier); + free(incl->stmt); + + free(incl); + incl = next; + } +} + +void +FreeStmt(ParseCommon *stmt) +{ + ParseCommon *next; + YYSTYPE u; + + while (stmt) + { + next = stmt->next; + u.any = stmt; + + switch (stmt->type) { + case STMT_INCLUDE: + FreeInclude((IncludeStmt *) stmt); + /* stmt is already free'd here. */ + stmt = NULL; + break; + case STMT_EXPR: + FreeExpr(u.expr); + break; + case STMT_VAR: + FreeStmt(&u.var->name->common); + FreeStmt(&u.var->value->common); + break; + case STMT_TYPE: + FreeStmt(&u.keyType->body->common); + break; + case STMT_INTERP: + free(u.interp->sym); + FreeStmt(&u.interp->match->common); + FreeStmt(&u.interp->def->common); + break; + case STMT_VMOD: + FreeStmt(&u.vmod->value->common); + break; + case STMT_SYMBOLS: + FreeStmt(&u.syms->symbols->common); + break; + case STMT_MODMAP: + FreeStmt(&u.modMask->keys->common); + break; + case STMT_GROUP_COMPAT: + FreeStmt(&u.groupCompat->def->common); + break; + case STMT_LED_MAP: + FreeStmt(&u.ledMap->body->common); + break; + case STMT_LED_NAME: + FreeStmt(&u.ledName->name->common); + break; + default: + break; + } + + free(stmt); + stmt = next; + } +} + +void +FreeXkbFile(XkbFile *file) +{ + XkbFile *next; + + while (file) + { + next = (XkbFile *) file->common.next; + + switch (file->file_type) { + case FILE_TYPE_KEYMAP: + FreeXkbFile((XkbFile *) file->defs); + break; + + case FILE_TYPE_TYPES: + case FILE_TYPE_COMPAT: + case FILE_TYPE_SYMBOLS: + case FILE_TYPE_KEYCODES: + case FILE_TYPE_GEOMETRY: + FreeStmt(file->defs); + break; + + default: + break; + } + + free(file->name); + free(file->topName); + free(file); + file = next; + } +} + +static const char *xkb_file_type_strings[_FILE_TYPE_NUM_ENTRIES] = { + [FILE_TYPE_KEYCODES] = "xkb_keycodes", + [FILE_TYPE_TYPES] = "xkb_types", + [FILE_TYPE_COMPAT] = "xkb_compatibility", + [FILE_TYPE_SYMBOLS] = "xkb_symbols", + [FILE_TYPE_GEOMETRY] = "xkb_geometry", + [FILE_TYPE_KEYMAP] = "xkb_keymap", + [FILE_TYPE_RULES] = "rules", +}; + +const char * +xkb_file_type_to_string(enum xkb_file_type type) +{ + if (type > _FILE_TYPE_NUM_ENTRIES) + return "unknown"; + return xkb_file_type_strings[type]; +} + +static const char *stmt_type_strings[_STMT_NUM_VALUES] = { + [STMT_UNKNOWN] = "unknown statement", + [STMT_INCLUDE] = "include statement", + [STMT_KEYCODE] = "key name definition", + [STMT_ALIAS] = "key alias definition", + [STMT_EXPR] = "expression", + [STMT_VAR] = "variable definition", + [STMT_TYPE] = "key type definition", + [STMT_INTERP] = "symbol interpretation definition", + [STMT_VMOD] = "virtual modifiers definition", + [STMT_SYMBOLS] = "key symbols definition", + [STMT_MODMAP] = "modifier map declaration", + [STMT_GROUP_COMPAT] = "group declaration", + [STMT_LED_MAP] = "indicator map declaration", + [STMT_LED_NAME] = "indicator name declaration", +}; + +const char * +stmt_type_to_string(enum stmt_type type) +{ + if (type >= _STMT_NUM_VALUES) + return NULL; + return stmt_type_strings[type]; +} + +static const char *expr_op_type_strings[_EXPR_NUM_VALUES] = { + [EXPR_VALUE] = "literal", + [EXPR_IDENT] = "identifier", + [EXPR_ACTION_DECL] = "action declaration", + [EXPR_FIELD_REF] = "field reference", + [EXPR_ARRAY_REF] = "array reference", + [EXPR_KEYSYM_LIST] = "list of keysyms", + [EXPR_ACTION_LIST] = "list of actions", + [EXPR_ADD] = "addition", + [EXPR_SUBTRACT] = "subtraction", + [EXPR_MULTIPLY] = "multiplication", + [EXPR_DIVIDE] = "division", + [EXPR_ASSIGN] = "assignment", + [EXPR_NOT] = "logical negation", + [EXPR_NEGATE] = "arithmetic negation", + [EXPR_INVERT] = "bitwise inversion", + [EXPR_UNARY_PLUS] = "unary plus", +}; + +const char * +expr_op_type_to_string(enum expr_op_type type) +{ + if (type >= _EXPR_NUM_VALUES) + return NULL; + return expr_op_type_strings[type]; +} + +static const char *expr_value_type_strings[_EXPR_TYPE_NUM_VALUES] = { + [EXPR_TYPE_UNKNOWN] = "unknown", + [EXPR_TYPE_BOOLEAN] = "boolean", + [EXPR_TYPE_INT] = "int", + [EXPR_TYPE_STRING] = "string", + [EXPR_TYPE_ACTION] = "action", + [EXPR_TYPE_KEYNAME] = "keyname", + [EXPR_TYPE_SYMBOLS] = "symbols", +}; + +const char * +expr_value_type_to_string(enum expr_value_type type) +{ + if (type >= _EXPR_TYPE_NUM_VALUES) + return NULL; + return expr_value_type_strings[type]; +} diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/ast-build.h b/src/3rdparty/xkbcommon/src/xkbcomp/ast-build.h new file mode 100644 index 0000000000..0ecd124145 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/ast-build.h @@ -0,0 +1,104 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +#ifndef XKBCOMP_AST_BUILD_H +#define XKBCOMP_AST_BUILD_H + +ParseCommon * +AppendStmt(ParseCommon *to, ParseCommon *append); + +ExprDef * +ExprCreate(enum expr_op_type op, enum expr_value_type type); + +ExprDef * +ExprCreateUnary(enum expr_op_type op, enum expr_value_type type, + ExprDef *child); + +ExprDef * +ExprCreateBinary(enum expr_op_type op, ExprDef *left, ExprDef *right); + +KeycodeDef * +KeycodeCreate(xkb_atom_t name, int64_t value); + +KeyAliasDef * +KeyAliasCreate(xkb_atom_t alias, xkb_atom_t real); + +VModDef * +VModCreate(xkb_atom_t name, ExprDef *value); + +VarDef * +VarCreate(ExprDef *name, ExprDef *value); + +VarDef * +BoolVarCreate(xkb_atom_t nameToken, unsigned set); + +InterpDef * +InterpCreate(char *sym, ExprDef *match); + +KeyTypeDef * +KeyTypeCreate(xkb_atom_t name, VarDef *body); + +SymbolsDef * +SymbolsCreate(xkb_atom_t keyName, ExprDef *symbols); + +GroupCompatDef * +GroupCompatCreate(int group, ExprDef *def); + +ModMapDef * +ModMapCreate(uint32_t modifier, ExprDef *keys); + +LedMapDef * +LedMapCreate(xkb_atom_t name, VarDef *body); + +LedNameDef * +LedNameCreate(int ndx, ExprDef *name, bool virtual); + +ExprDef * +ActionCreate(xkb_atom_t name, ExprDef *args); + +ExprDef * +CreateMultiKeysymList(ExprDef *list); + +ExprDef * +CreateKeysymList(char *sym); + +ExprDef * +AppendMultiKeysymList(ExprDef *list, ExprDef *append); + +ExprDef * +AppendKeysymList(ExprDef *list, char *sym); + +IncludeStmt * +IncludeCreate(struct xkb_context *ctx, char *str, enum merge_mode merge); + +XkbFile * +XkbFileCreate(struct xkb_context *ctx, enum xkb_file_type type, char *name, + ParseCommon *defs, unsigned flags); + +void +FreeStmt(ParseCommon *stmt); + +#endif diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/ast.h b/src/3rdparty/xkbcommon/src/xkbcomp/ast.h new file mode 100644 index 0000000000..c430a772ae --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/ast.h @@ -0,0 +1,295 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +/* + * Copyright © 2012 Ran Benita <ran234@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef XKBCOMP_AST_H +#define XKBCOMP_AST_H + +enum xkb_file_type { + /* Component files, by order of compilation. */ + FILE_TYPE_KEYCODES = 0, + FILE_TYPE_TYPES = 1, + FILE_TYPE_COMPAT = 2, + FILE_TYPE_SYMBOLS = 3, + /* Geometry is not compiled any more. */ + FILE_TYPE_GEOMETRY = 4, + + /* A top level file which includes the above files. */ + FILE_TYPE_KEYMAP, + +/* File types which must be found in a keymap file. */ +#define FIRST_KEYMAP_FILE_TYPE FILE_TYPE_KEYCODES +#define LAST_KEYMAP_FILE_TYPE FILE_TYPE_SYMBOLS + + /* This one doesn't mix with the others, but useful here as well. */ + FILE_TYPE_RULES, + + _FILE_TYPE_NUM_ENTRIES +}; + +enum stmt_type { + STMT_UNKNOWN = 0, + STMT_INCLUDE, + STMT_KEYCODE, + STMT_ALIAS, + STMT_EXPR, + STMT_VAR, + STMT_TYPE, + STMT_INTERP, + STMT_VMOD, + STMT_SYMBOLS, + STMT_MODMAP, + STMT_GROUP_COMPAT, + STMT_LED_MAP, + STMT_LED_NAME, + + _STMT_NUM_VALUES +}; + +enum expr_value_type { + EXPR_TYPE_UNKNOWN = 0, + EXPR_TYPE_BOOLEAN, + EXPR_TYPE_INT, + EXPR_TYPE_STRING, + EXPR_TYPE_ACTION, + EXPR_TYPE_KEYNAME, + EXPR_TYPE_SYMBOLS, + + _EXPR_TYPE_NUM_VALUES +}; + +enum expr_op_type { + EXPR_VALUE, + EXPR_IDENT, + EXPR_ACTION_DECL, + EXPR_FIELD_REF, + EXPR_ARRAY_REF, + EXPR_KEYSYM_LIST, + EXPR_ACTION_LIST, + EXPR_ADD, + EXPR_SUBTRACT, + EXPR_MULTIPLY, + EXPR_DIVIDE, + EXPR_ASSIGN, + EXPR_NOT, + EXPR_NEGATE, + EXPR_INVERT, + EXPR_UNARY_PLUS, + + _EXPR_NUM_VALUES +}; + +enum merge_mode { + MERGE_DEFAULT, + MERGE_AUGMENT, + MERGE_OVERRIDE, + MERGE_REPLACE, +}; + +const char * +xkb_file_type_to_string(enum xkb_file_type type); + +const char * +stmt_type_to_string(enum stmt_type type); + +const char * +expr_op_type_to_string(enum expr_op_type type); + +const char * +expr_value_type_to_string(enum expr_value_type type); + +typedef struct _ParseCommon { + enum stmt_type type; + struct _ParseCommon *next; +} ParseCommon; + +typedef struct _IncludeStmt { + ParseCommon common; + enum merge_mode merge; + char *stmt; + char *file; + char *map; + char *modifier; + struct _IncludeStmt *next_incl; +} IncludeStmt; + +typedef struct _Expr { + ParseCommon common; + enum expr_op_type op; + enum expr_value_type value_type; + union { + struct { + struct _Expr *left; + struct _Expr *right; + } binary; + struct { + xkb_atom_t element; + xkb_atom_t field; + } field; + struct { + xkb_atom_t element; + xkb_atom_t field; + struct _Expr *entry; + } array; + struct { + xkb_atom_t name; + struct _Expr *args; + } action; + struct { + darray(char *) syms; + darray(int) symsMapIndex; + darray(unsigned int) symsNumEntries; + } list; + struct _Expr *child; + xkb_atom_t str; + unsigned uval; + int ival; + xkb_atom_t keyName; + } value; +} ExprDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + ExprDef *name; + ExprDef *value; +} VarDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + xkb_atom_t name; + ExprDef *value; +} VModDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + xkb_atom_t name; + int64_t value; +} KeycodeDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + xkb_atom_t alias; + xkb_atom_t real; +} KeyAliasDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + xkb_atom_t name; + VarDef *body; +} KeyTypeDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + xkb_atom_t keyName; + ExprDef *symbols; +} SymbolsDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + xkb_atom_t modifier; + ExprDef *keys; +} ModMapDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + int group; + ExprDef *def; +} GroupCompatDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + char *sym; + ExprDef *match; + VarDef *def; +} InterpDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + int ndx; + ExprDef *name; + bool virtual; +} LedNameDef; + +typedef struct { + ParseCommon common; + enum merge_mode merge; + xkb_atom_t name; + VarDef *body; +} LedMapDef; + +enum xkb_map_flags { + MAP_IS_DEFAULT = (1 << 0), + MAP_IS_PARTIAL = (1 << 1), + MAP_IS_HIDDEN = (1 << 2), + MAP_HAS_ALPHANUMERIC = (1 << 3), + MAP_HAS_MODIFIER = (1 << 4), + MAP_HAS_KEYPAD = (1 << 5), + MAP_HAS_FN = (1 << 6), + MAP_IS_ALTGR = (1 << 7), +}; + +typedef struct { + ParseCommon common; + enum xkb_file_type file_type; + char *topName; + char *name; + ParseCommon *defs; + enum xkb_map_flags flags; +} XkbFile; + +#endif diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/compat.c b/src/3rdparty/xkbcommon/src/xkbcomp/compat.c new file mode 100644 index 0000000000..5682895430 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/compat.c @@ -0,0 +1,1078 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +/* + * Copyright © 2012 Ran Benita <ran234@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "xkbcomp-priv.h" +#include "text.h" +#include "expr.h" +#include "action.h" +#include "vmod.h" +#include "include.h" + +/* + * The xkb_compat section + * ===================== + * This section is the third to be processed, after xkb_keycodes and + * xkb_types. + * + * Interpret statements + * -------------------- + * Statements of the form: + * interpret Num_Lock+Any { ... } + * interpret Shift_Lock+AnyOf(Shift+Lock) { ... } + * + * The xkb_symbols section (see symbols.c) allows the keymap author to do, + * among other things, the following for each key: + * - Bind an action, like SetMods or LockGroup, to the key. Actions, like + * symbols, are specified for each level of each group in the key + * separately. + * - Add a virtual modifier to the key's virtual modifier mapping (vmodmap). + * - Specify whether the key should repeat or not. + * + * However, doing this for each key (or level) is tedious and inflexible. + * Interpret's are a mechanism to apply these settings to a bunch of + * keys/levels at once. + * + * Each interpret specifies a condition by which it attaches to certain + * levels. The condition consists of two parts: + * - A keysym. If the level has a different (or more than one) keysym, the + * match failes. Leaving out the keysym is equivalent to using the + * NoSymbol keysym, which always matches successfully. + * - A modifier predicate. The predicate consists of a matching operation + * and a mask of (real) modifiers. The modifers are matched against the + * key's modifier map (modmap). The matching operation can be one of the + * following: + * + AnyOfOrNone - The modmap must either be empty or include at least + * one of the specified modifiers. + * + AnyOf - The modmap must include at least one of the specified + * modifiers. + * + NoneOf - The modmap must not include any of the specified modifiers. + * + AllOf - The modmap must include all of the specified modifiers (but + * may include others as well). + * + Exactly - The modmap must be exactly the same as the specified + * modifiers. + * Leaving out the predicate is equivalent to usign AnyOfOrNone while + * specifying all modifiers. Leaving out just the matching condtition + * is equivalent to using Exactly. + * An interpret may also include "useModMapMods = level1;" - see below. + * + * If a level fulfils the conditions of several interpret's, only the + * most specific one is used: + * - A specific keysym will always match before a generic NoSymbol + * condition. + * - If the keysyms are the same, the interpret with the more specific + * matching operation is used. The above list is sorted from least to + * most specific. + * - If both the keysyms and the matching operations are the same (but the + * modifiers are different), the first interpret is used. + * + * As described above, once an interpret "attaches" to a level, it can bind + * an action to that level, add one virtual modifier to the key's vmodmap, + * or set the key's repeat setting. You should note the following: + * - The key repeat is a property of the entire key; it is not level-specific. + * In order to avoid confusion, it is only inspected for the first level of + * the first group; the interpret's repeat setting is ignored when applied + * to other levels. + * - If one of the above fields was set directly for a key in xkb_symbols, + * the explicit setting takes precedence over the interpret. + * + * The body of the statment may include statements of the following + * forms (all of which are optional): + * + * - useModMapMods statement: + * useModMapMods = level1; + * + * When set to 'level1', the interpret will only match levels which are + * the first level of the first group of the keys. This can be useful in + * conjunction with e.g. a virtualModifier statement. + * + * - action statement: + * action = LockMods(modifiers=NumLock); + * + * Bind this action to the matching levels. + * + * - virtual modifier statement: + * virtualModifier = NumLock; + * + * Add this virtual modifier to the key's vmodmap. The given virtual + * modifier must be declared at the top level of the file with a + * virtual_modifiers statement, e.g.: + * virtual_modifiers NumLock; + * + * - repeat statement: + * repeat = True; + * + * Set whether the key should repeat or not. Must be a boolean value. + * + * Led map statements + * ------------------------ + * Statements of the form: + * indicator "Shift Lock" { ... } + * + * This statement specifies the behavior and binding of the LED (a.k.a + * indicator) with the given name ("Shift Lock" above). The name should + * have been declared previously in the xkb_keycodes section (see Led + * name statement), and given an index there. If it wasn't, it is created + * with the next free index. + * The body of the statement describes the conditions of the keyboard + * state which will cause the LED to be lit. It may include the following + * statements: + * + * - modifiers statment: + * modifiers = ScrollLock; + * + * If the given modifiers are in the required state (see below), the + * led is lit. + * + * - whichModifierState statment: + * whichModState = Latched + Locked; + * + * Can be any combination of: + * base, latched, locked, effective + * any (i.e. all of the above) + * none (i.e. none of the above) + * compat (legacy value, treated as effective) + * This will cause the respective portion of the modifer state (see + * struct xkb_state) to be matched against the modifiers given in the + * "modifiers" statement. + * + * Here's a simple example: + * indicator "Num Lock" { + * modifiers = NumLock; + * whichModState = Locked; + * }; + * Whenever the NumLock modifier is locked, the Num Lock LED will light + * up. + * + * - groups statment: + * groups = All - group1; + * + * If the given groups are in the required state (see below), the led + * is lit. + * + * - whichGroupState statment: + * whichGroupState = Effective; + * + * Can be any combination of: + * base, latched, locked, effective + * any (i.e. all of the above) + * none (i.e. none of the above) + * This will cause the respective portion of the group state (see + * struct xkb_state) to be matched against the groups given in the + * "groups" statement. + * + * Note: the above conditions are disjunctive, i.e. if any of them are + * satisfied the led is lit. + * + * Virtual modifier statements + * --------------------------- + * Statements of the form: + * virtual_modifiers LControl; + * + * Can appear in the xkb_types, xkb_compat, xkb_symbols sections. + * TODO + * + * Effect on keymap + * ---------------- + * After all of the xkb_compat sections have been compiled, the following + * members of struct xkb_keymap are finalized: + * darray(struct xkb_sym_interpret) sym_interprets; + * darray(struct xkb_led) leds; + * char *compat_section_name; + * TODO: virtual modifiers. + */ + +enum si_field { + SI_FIELD_VIRTUAL_MOD = (1 << 0), + SI_FIELD_ACTION = (1 << 1), + SI_FIELD_AUTO_REPEAT = (1 << 2), + SI_FIELD_LEVEL_ONE_ONLY = (1 << 3), +}; + +typedef struct { + enum si_field defined; + enum merge_mode merge; + + struct xkb_sym_interpret interp; +} SymInterpInfo; + +enum led_field { + LED_FIELD_MODS = (1 << 0), + LED_FIELD_GROUPS = (1 << 1), + LED_FIELD_CTRLS = (1 << 2), +}; + +typedef struct { + enum led_field defined; + enum merge_mode merge; + + struct xkb_led led; +} LedInfo; + +typedef struct { + char *name; + int errorCount; + SymInterpInfo default_interp; + darray(SymInterpInfo) interps; + LedInfo default_led; + darray(LedInfo) leds; + ActionsInfo *actions; + struct xkb_keymap *keymap; +} CompatInfo; + +static const char * +siText(SymInterpInfo *si, CompatInfo *info) +{ + char *buf = xkb_context_get_buffer(info->keymap->ctx, 128); + + if (si == &info->default_interp) + return "default"; + + snprintf(buf, 128, "%s+%s(%s)", + KeysymText(info->keymap->ctx, si->interp.sym), + SIMatchText(si->interp.match), + ModMaskText(info->keymap, si->interp.mods)); + + return buf; +} + +static inline bool +ReportSINotArray(CompatInfo *info, SymInterpInfo *si, const char *field) +{ + return ReportNotArray(info->keymap->ctx, "symbol interpretation", field, + siText(si, info)); +} + +static inline bool +ReportSIBadType(CompatInfo *info, SymInterpInfo *si, const char *field, + const char *wanted) +{ + return ReportBadType(info->keymap->ctx, "symbol interpretation", field, + siText(si, info), wanted); +} + +static inline bool +ReportLedBadType(CompatInfo *info, LedInfo *ledi, const char *field, + const char *wanted) +{ + return ReportBadType(info->keymap->ctx, "indicator map", field, + xkb_atom_text(info->keymap->ctx, ledi->led.name), + wanted); +} + +static inline bool +ReportLedNotArray(CompatInfo *info, LedInfo *ledi, const char *field) +{ + return ReportNotArray(info->keymap->ctx, "indicator map", field, + xkb_atom_text(info->keymap->ctx, ledi->led.name)); +} + +static void +InitCompatInfo(CompatInfo *info, struct xkb_keymap *keymap, + ActionsInfo *actions) +{ + memset(info, 0, sizeof(*info)); + info->keymap = keymap; + info->actions = actions; + info->default_interp.merge = MERGE_OVERRIDE; + info->default_interp.interp.virtual_mod = XKB_MOD_INVALID; + info->default_led.merge = MERGE_OVERRIDE; +} + +static void +ClearCompatInfo(CompatInfo *info) +{ + free(info->name); + darray_free(info->interps); + darray_free(info->leds); +} + +static SymInterpInfo * +FindMatchingInterp(CompatInfo *info, SymInterpInfo *new) +{ + SymInterpInfo *old; + + darray_foreach(old, info->interps) + if (old->interp.sym == new->interp.sym && + old->interp.mods == new->interp.mods && + old->interp.match == new->interp.match) + return old; + + return NULL; +} + +static bool +UseNewInterpField(enum si_field field, SymInterpInfo *old, SymInterpInfo *new, + bool report, enum si_field *collide) +{ + if (!(old->defined & field)) + return true; + + if (new->defined & field) { + if (report) + *collide |= field; + + if (new->merge != MERGE_AUGMENT) + return true; + } + + return false; +} + +static bool +AddInterp(CompatInfo *info, SymInterpInfo *new, bool same_file) +{ + SymInterpInfo *old = FindMatchingInterp(info, new); + if (old) { + const int verbosity = xkb_context_get_log_verbosity(info->keymap->ctx); + const bool report = (same_file && verbosity > 0) || verbosity > 9; + enum si_field collide = 0; + + if (new->merge == MERGE_REPLACE) { + if (report) + log_warn(info->keymap->ctx, + "Multiple definitions for \"%s\"; " + "Earlier interpretation ignored\n", + siText(new, info)); + *old = *new; + return true; + } + + if (UseNewInterpField(SI_FIELD_VIRTUAL_MOD, old, new, report, + &collide)) { + old->interp.virtual_mod = new->interp.virtual_mod; + old->defined |= SI_FIELD_VIRTUAL_MOD; + } + if (UseNewInterpField(SI_FIELD_ACTION, old, new, report, + &collide)) { + old->interp.action = new->interp.action; + old->defined |= SI_FIELD_ACTION; + } + if (UseNewInterpField(SI_FIELD_AUTO_REPEAT, old, new, report, + &collide)) { + old->interp.repeat = new->interp.repeat; + old->defined |= SI_FIELD_AUTO_REPEAT; + } + if (UseNewInterpField(SI_FIELD_LEVEL_ONE_ONLY, old, new, report, + &collide)) { + old->interp.level_one_only = new->interp.level_one_only; + old->defined |= SI_FIELD_LEVEL_ONE_ONLY; + } + + if (collide) { + log_warn(info->keymap->ctx, + "Multiple interpretations of \"%s\"; " + "Using %s definition for duplicate fields\n", + siText(new, info), + (new->merge != MERGE_AUGMENT ? "last" : "first")); + } + + return true; + } + + darray_append(info->interps, *new); + return true; +} + +/***====================================================================***/ + +static bool +ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn, + xkb_mod_mask_t *mods_rtrn, CompatInfo *info) +{ + if (expr == NULL) { + *pred_rtrn = MATCH_ANY_OR_NONE; + *mods_rtrn = MOD_REAL_MASK_ALL; + return true; + } + + *pred_rtrn = MATCH_EXACTLY; + if (expr->op == EXPR_ACTION_DECL) { + const char *pred_txt = xkb_atom_text(info->keymap->ctx, + expr->value.action.name); + if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn)) { + log_err(info->keymap->ctx, + "Illegal modifier predicate \"%s\"; Ignored\n", pred_txt); + return false; + } + expr = expr->value.action.args; + } + else if (expr->op == EXPR_IDENT) { + const char *pred_txt = xkb_atom_text(info->keymap->ctx, + expr->value.str); + if (pred_txt && istreq(pred_txt, "any")) { + *pred_rtrn = MATCH_ANY; + *mods_rtrn = MOD_REAL_MASK_ALL; + return true; + } + } + + return ExprResolveModMask(info->keymap, expr, MOD_REAL, mods_rtrn); +} + +/***====================================================================***/ + +static bool +UseNewLEDField(enum led_field field, LedInfo *old, LedInfo *new, + bool report, enum led_field *collide) +{ + if (!(old->defined & field)) + return true; + + if (new->defined & field) { + if (report) + *collide |= field; + + if (new->merge != MERGE_AUGMENT) + return true; + } + + return false; +} + +static bool +AddLedMap(CompatInfo *info, LedInfo *new, bool same_file) +{ + LedInfo *old; + enum led_field collide; + struct xkb_context *ctx = info->keymap->ctx; + const int verbosity = xkb_context_get_log_verbosity(ctx); + const bool report = (same_file && verbosity > 0) || verbosity > 9; + + darray_foreach(old, info->leds) { + if (old->led.name != new->led.name) + continue; + + if (old->led.mods.mods == new->led.mods.mods && + old->led.groups == new->led.groups && + old->led.ctrls == new->led.ctrls && + old->led.which_mods == new->led.which_mods && + old->led.which_groups == new->led.which_groups) { + old->defined |= new->defined; + return true; + } + + if (new->merge == MERGE_REPLACE) { + if (report) + log_warn(info->keymap->ctx, + "Map for indicator %s redefined; " + "Earlier definition ignored\n", + xkb_atom_text(ctx, old->led.name)); + *old = *new; + return true; + } + + collide = 0; + if (UseNewLEDField(LED_FIELD_MODS, old, new, report, &collide)) { + old->led.which_mods = new->led.which_mods; + old->led.mods = new->led.mods; + old->defined |= LED_FIELD_MODS; + } + if (UseNewLEDField(LED_FIELD_GROUPS, old, new, report, &collide)) { + old->led.which_groups = new->led.which_groups; + old->led.groups = new->led.groups; + old->defined |= LED_FIELD_GROUPS; + } + if (UseNewLEDField(LED_FIELD_CTRLS, old, new, report, &collide)) { + old->led.ctrls = new->led.ctrls; + old->defined |= LED_FIELD_CTRLS; + } + + if (collide) { + log_warn(info->keymap->ctx, + "Map for indicator %s redefined; " + "Using %s definition for duplicate fields\n", + xkb_atom_text(ctx, old->led.name), + (new->merge == MERGE_AUGMENT ? "first" : "last")); + } + + return true; + } + + darray_append(info->leds, *new); + return true; +} + +static void +MergeIncludedCompatMaps(CompatInfo *into, CompatInfo *from, + enum merge_mode merge) +{ + SymInterpInfo *si; + LedInfo *ledi; + + if (from->errorCount > 0) { + into->errorCount += from->errorCount; + return; + } + + if (into->name == NULL) { + into->name = from->name; + from->name = NULL; + } + + darray_foreach(si, from->interps) { + si->merge = (merge == MERGE_DEFAULT ? si->merge : merge); + if (!AddInterp(into, si, false)) + into->errorCount++; + } + + darray_foreach(ledi, from->leds) { + ledi->merge = (merge == MERGE_DEFAULT ? ledi->merge : merge); + if (!AddLedMap(into, ledi, false)) + into->errorCount++; + } +} + +static void +HandleCompatMapFile(CompatInfo *info, XkbFile *file, enum merge_mode merge); + +static bool +HandleIncludeCompatMap(CompatInfo *info, IncludeStmt *include) +{ + CompatInfo included; + + InitCompatInfo(&included, info->keymap, info->actions); + included.name = include->stmt; + include->stmt = NULL; + + for (IncludeStmt *stmt = include; stmt; stmt = stmt->next_incl) { + CompatInfo next_incl; + XkbFile *file; + + file = ProcessIncludeFile(info->keymap->ctx, stmt, FILE_TYPE_COMPAT); + if (!file) { + info->errorCount += 10; + ClearCompatInfo(&included); + return false; + } + + InitCompatInfo(&next_incl, info->keymap, info->actions); + next_incl.default_interp = info->default_interp; + next_incl.default_interp.merge = stmt->merge; + next_incl.default_led = info->default_led; + next_incl.default_led.merge = stmt->merge; + + HandleCompatMapFile(&next_incl, file, MERGE_OVERRIDE); + + MergeIncludedCompatMaps(&included, &next_incl, stmt->merge); + + ClearCompatInfo(&next_incl); + FreeXkbFile(file); + } + + MergeIncludedCompatMaps(info, &included, include->merge); + ClearCompatInfo(&included); + + return (info->errorCount == 0); +} + +static bool +SetInterpField(CompatInfo *info, SymInterpInfo *si, const char *field, + ExprDef *arrayNdx, ExprDef *value) +{ + struct xkb_keymap *keymap = info->keymap; + xkb_mod_index_t ndx; + + if (istreq(field, "action")) { + if (arrayNdx) + return ReportSINotArray(info, si, field); + + if (!HandleActionDef(value, keymap, &si->interp.action, info->actions)) + return false; + + si->defined |= SI_FIELD_ACTION; + } + else if (istreq(field, "virtualmodifier") || + istreq(field, "virtualmod")) { + if (arrayNdx) + return ReportSINotArray(info, si, field); + + if (!ExprResolveMod(keymap, value, MOD_VIRT, &ndx)) + return ReportSIBadType(info, si, field, "virtual modifier"); + + si->interp.virtual_mod = ndx; + si->defined |= SI_FIELD_VIRTUAL_MOD; + } + else if (istreq(field, "repeat")) { + bool set; + + if (arrayNdx) + return ReportSINotArray(info, si, field); + + if (!ExprResolveBoolean(keymap->ctx, value, &set)) + return ReportSIBadType(info, si, field, "boolean"); + + si->interp.repeat = set; + + si->defined |= SI_FIELD_AUTO_REPEAT; + } + else if (istreq(field, "locking")) { + log_dbg(info->keymap->ctx, + "The \"locking\" field in symbol interpretation is unsupported; " + "Ignored\n"); + } + else if (istreq(field, "usemodmap") || + istreq(field, "usemodmapmods")) { + unsigned int val; + + if (arrayNdx) + return ReportSINotArray(info, si, field); + + if (!ExprResolveEnum(keymap->ctx, value, &val, useModMapValueNames)) + return ReportSIBadType(info, si, field, "level specification"); + + si->interp.level_one_only = !!val; + si->defined |= SI_FIELD_LEVEL_ONE_ONLY; + } + else { + return ReportBadField(keymap->ctx, "symbol interpretation", field, + siText(si, info)); + } + + return true; +} + +static bool +SetLedMapField(CompatInfo *info, LedInfo *ledi, const char *field, + ExprDef *arrayNdx, ExprDef *value) +{ + bool ok = true; + struct xkb_keymap *keymap = info->keymap; + + if (istreq(field, "modifiers") || istreq(field, "mods")) { + if (arrayNdx) + return ReportLedNotArray(info, ledi, field); + + if (!ExprResolveModMask(keymap, value, MOD_BOTH, &ledi->led.mods.mods)) + return ReportLedBadType(info, ledi, field, "modifier mask"); + + ledi->defined |= LED_FIELD_MODS; + } + else if (istreq(field, "groups")) { + unsigned int mask; + + if (arrayNdx) + return ReportLedNotArray(info, ledi, field); + + if (!ExprResolveMask(keymap->ctx, value, &mask, groupMaskNames)) + return ReportLedBadType(info, ledi, field, "group mask"); + + ledi->led.groups = mask; + ledi->defined |= LED_FIELD_GROUPS; + } + else if (istreq(field, "controls") || istreq(field, "ctrls")) { + unsigned int mask; + + if (arrayNdx) + return ReportLedNotArray(info, ledi, field); + + if (!ExprResolveMask(keymap->ctx, value, &mask, ctrlMaskNames)) + return ReportLedBadType(info, ledi, field, "controls mask"); + + ledi->led.ctrls = mask; + ledi->defined |= LED_FIELD_CTRLS; + } + else if (istreq(field, "allowexplicit")) { + log_dbg(info->keymap->ctx, + "The \"allowExplicit\" field in indicator statements is unsupported; " + "Ignored\n"); + } + else if (istreq(field, "whichmodstate") || + istreq(field, "whichmodifierstate")) { + unsigned int mask; + + if (arrayNdx) + return ReportLedNotArray(info, ledi, field); + + if (!ExprResolveMask(keymap->ctx, value, &mask, + modComponentMaskNames)) + return ReportLedBadType(info, ledi, field, + "mask of modifier state components"); + + ledi->led.which_mods = mask; + } + else if (istreq(field, "whichgroupstate")) { + unsigned mask; + + if (arrayNdx) + return ReportLedNotArray(info, ledi, field); + + if (!ExprResolveMask(keymap->ctx, value, &mask, + groupComponentMaskNames)) + return ReportLedBadType(info, ledi, field, + "mask of group state components"); + + ledi->led.which_groups = mask; + } + else if (istreq(field, "driveskbd") || + istreq(field, "driveskeyboard") || + istreq(field, "leddriveskbd") || + istreq(field, "leddriveskeyboard") || + istreq(field, "indicatordriveskbd") || + istreq(field, "indicatordriveskeyboard")) { + log_dbg(info->keymap->ctx, + "The \"%s\" field in indicator statements is unsupported; " + "Ignored\n", field); + } + else if (istreq(field, "index")) { + /* Users should see this, it might cause unexpected behavior. */ + log_err(info->keymap->ctx, + "The \"index\" field in indicator statements is unsupported; " + "Ignored\n"); + } + else { + log_err(info->keymap->ctx, + "Unknown field %s in map for %s indicator; " + "Definition ignored\n", + field, xkb_atom_text(keymap->ctx, ledi->led.name)); + ok = false; + } + + return ok; +} + +static bool +HandleGlobalVar(CompatInfo *info, VarDef *stmt) +{ + const char *elem, *field; + ExprDef *ndx; + bool ret; + + if (!ExprResolveLhs(info->keymap->ctx, stmt->name, &elem, &field, &ndx)) + ret = false; + else if (elem && istreq(elem, "interpret")) + ret = SetInterpField(info, &info->default_interp, field, ndx, + stmt->value); + else if (elem && istreq(elem, "indicator")) + ret = SetLedMapField(info, &info->default_led, field, ndx, + stmt->value); + else + ret = SetActionField(info->keymap, elem, field, ndx, stmt->value, + info->actions); + return ret; +} + +static bool +HandleInterpBody(CompatInfo *info, VarDef *def, SymInterpInfo *si) +{ + bool ok = true; + const char *elem, *field; + ExprDef *arrayNdx; + + for (; def; def = (VarDef *) def->common.next) { + if (def->name && def->name->op == EXPR_FIELD_REF) { + log_err(info->keymap->ctx, + "Cannot set a global default value from within an interpret statement; " + "Move statements to the global file scope\n"); + ok = false; + continue; + } + + ok = ExprResolveLhs(info->keymap->ctx, def->name, &elem, &field, + &arrayNdx); + if (!ok) + continue; + + ok = SetInterpField(info, si, field, arrayNdx, def->value); + } + + return ok; +} + +static bool +HandleInterpDef(CompatInfo *info, InterpDef *def, enum merge_mode merge) +{ + enum xkb_match_operation pred; + xkb_mod_mask_t mods; + SymInterpInfo si; + + if (!ResolveStateAndPredicate(def->match, &pred, &mods, info)) { + log_err(info->keymap->ctx, + "Couldn't determine matching modifiers; " + "Symbol interpretation ignored\n"); + return false; + } + + si = info->default_interp; + si.merge = merge = (def->merge == MERGE_DEFAULT ? merge : def->merge); + + if (!LookupKeysym(def->sym, &si.interp.sym)) { + log_err(info->keymap->ctx, + "Could not resolve keysym %s; " + "Symbol interpretation ignored\n", + def->sym); + return false; + } + + si.interp.match = pred; + si.interp.mods = mods; + + if (!HandleInterpBody(info, def->def, &si)) { + info->errorCount++; + return false; + } + + if (!AddInterp(info, &si, true)) { + info->errorCount++; + return false; + } + + return true; +} + +static bool +HandleLedMapDef(CompatInfo *info, LedMapDef *def, enum merge_mode merge) +{ + LedInfo ledi; + VarDef *var; + bool ok; + + if (def->merge != MERGE_DEFAULT) + merge = def->merge; + + ledi = info->default_led; + ledi.merge = merge; + ledi.led.name = def->name; + + ok = true; + for (var = def->body; var != NULL; var = (VarDef *) var->common.next) { + const char *elem, *field; + ExprDef *arrayNdx; + if (!ExprResolveLhs(info->keymap->ctx, var->name, &elem, &field, + &arrayNdx)) { + ok = false; + continue; + } + + if (elem) { + log_err(info->keymap->ctx, + "Cannot set defaults for \"%s\" element in indicator map; " + "Assignment to %s.%s ignored\n", elem, elem, field); + ok = false; + } + else { + ok = SetLedMapField(info, &ledi, field, arrayNdx, var->value) && ok; + } + } + + if (ok) + return AddLedMap(info, &ledi, true); + + return false; +} + +static void +HandleCompatMapFile(CompatInfo *info, XkbFile *file, enum merge_mode merge) +{ + bool ok; + + merge = (merge == MERGE_DEFAULT ? MERGE_AUGMENT : merge); + + free(info->name); + info->name = strdup_safe(file->name); + + for (ParseCommon *stmt = file->defs; stmt; stmt = stmt->next) { + switch (stmt->type) { + case STMT_INCLUDE: + ok = HandleIncludeCompatMap(info, (IncludeStmt *) stmt); + break; + case STMT_INTERP: + ok = HandleInterpDef(info, (InterpDef *) stmt, merge); + break; + case STMT_GROUP_COMPAT: + log_dbg(info->keymap->ctx, + "The \"group\" statement in compat is unsupported; " + "Ignored\n"); + ok = true; + break; + case STMT_LED_MAP: + ok = HandleLedMapDef(info, (LedMapDef *) stmt, merge); + break; + case STMT_VAR: + ok = HandleGlobalVar(info, (VarDef *) stmt); + break; + case STMT_VMOD: + ok = HandleVModDef(info->keymap, (VModDef *) stmt); + break; + default: + log_err(info->keymap->ctx, + "Interpretation files may not include other types; " + "Ignoring %s\n", stmt_type_to_string(stmt->type)); + ok = false; + break; + } + + if (!ok) + info->errorCount++; + + if (info->errorCount > 10) { + log_err(info->keymap->ctx, + "Abandoning compatibility map \"%s\"\n", file->topName); + break; + } + } +} + +static void +CopyInterps(CompatInfo *info, bool needSymbol, enum xkb_match_operation pred) +{ + SymInterpInfo *si; + + darray_foreach(si, info->interps) + if (si->interp.match == pred && + (si->interp.sym != XKB_KEY_NoSymbol) == needSymbol) + darray_append(info->keymap->sym_interprets, si->interp); +} + +static void +CopyLedMapDefs(CompatInfo *info) +{ + LedInfo *ledi; + xkb_led_index_t i; + struct xkb_led *led; + struct xkb_keymap *keymap = info->keymap; + + darray_foreach(ledi, info->leds) { + /* + * Find the LED with the given name, if it was already declared + * in keycodes. + */ + darray_enumerate(i, led, keymap->leds) + if (led->name == ledi->led.name) + break; + + /* Not previously declared; create it with next free index. */ + if (i >= darray_size(keymap->leds)) { + log_dbg(keymap->ctx, + "Indicator name \"%s\" was not declared in the keycodes section; " + "Adding new indicator\n", + xkb_atom_text(keymap->ctx, ledi->led.name)); + + darray_enumerate(i, led, keymap->leds) + if (led->name == XKB_ATOM_NONE) + break; + + if (i >= darray_size(keymap->leds)) { + /* Not place to put it; ignore. */ + if (i >= XKB_MAX_LEDS) { + log_err(keymap->ctx, + "Too many indicators (maximum is %d); " + "Indicator name \"%s\" ignored\n", + XKB_MAX_LEDS, + xkb_atom_text(keymap->ctx, ledi->led.name)); + continue; + } + /* Add a new LED. */ + darray_resize(keymap->leds, i + 1); + led = &darray_item(keymap->leds, i); + } + } + + *led = ledi->led; + if (led->groups != 0 && led->which_groups == 0) + led->which_groups = XKB_STATE_LAYOUT_EFFECTIVE; + if (led->mods.mods != 0 && led->which_mods == 0) + led->which_mods = XKB_STATE_MODS_EFFECTIVE; + } +} + +static bool +CopyCompatToKeymap(struct xkb_keymap *keymap, CompatInfo *info) +{ + keymap->compat_section_name = strdup_safe(info->name); + + if (!darray_empty(info->interps)) { + /* Most specific to least specific. */ + CopyInterps(info, true, MATCH_EXACTLY); + CopyInterps(info, true, MATCH_ALL); + CopyInterps(info, true, MATCH_NONE); + CopyInterps(info, true, MATCH_ANY); + CopyInterps(info, true, MATCH_ANY_OR_NONE); + CopyInterps(info, false, MATCH_EXACTLY); + CopyInterps(info, false, MATCH_ALL); + CopyInterps(info, false, MATCH_NONE); + CopyInterps(info, false, MATCH_ANY); + CopyInterps(info, false, MATCH_ANY_OR_NONE); + } + + CopyLedMapDefs(info); + + return true; +} + +bool +CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, + enum merge_mode merge) +{ + CompatInfo info; + ActionsInfo *actions; + + actions = NewActionsInfo(); + if (!actions) + return false; + + InitCompatInfo(&info, keymap, actions); + info.default_interp.merge = merge; + info.default_led.merge = merge; + + HandleCompatMapFile(&info, file, merge); + if (info.errorCount != 0) + goto err_info; + + if (!CopyCompatToKeymap(keymap, &info)) + goto err_info; + + ClearCompatInfo(&info); + FreeActionsInfo(actions); + return true; + +err_info: + ClearCompatInfo(&info); + FreeActionsInfo(actions); + return false; +} diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/expr.c b/src/3rdparty/xkbcommon/src/xkbcomp/expr.c new file mode 100644 index 0000000000..dc64d7891f --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/expr.c @@ -0,0 +1,685 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +#include "xkbcomp-priv.h" +#include "text.h" +#include "expr.h" + +typedef bool (*IdentLookupFunc)(struct xkb_context *ctx, const void *priv, + xkb_atom_t field, enum expr_value_type type, + unsigned int *val_rtrn); + +bool +ExprResolveLhs(struct xkb_context *ctx, const ExprDef *expr, + const char **elem_rtrn, const char **field_rtrn, + ExprDef **index_rtrn) +{ + switch (expr->op) { + case EXPR_IDENT: + *elem_rtrn = NULL; + *field_rtrn = xkb_atom_text(ctx, expr->value.str); + *index_rtrn = NULL; + return true; + case EXPR_FIELD_REF: + *elem_rtrn = xkb_atom_text(ctx, expr->value.field.element); + *field_rtrn = xkb_atom_text(ctx, expr->value.field.field); + *index_rtrn = NULL; + return true; + case EXPR_ARRAY_REF: + *elem_rtrn = xkb_atom_text(ctx, expr->value.array.element); + *field_rtrn = xkb_atom_text(ctx, expr->value.array.field); + *index_rtrn = expr->value.array.entry; + return true; + default: + break; + } + log_wsgo(ctx, "Unexpected operator %d in ResolveLhs\n", expr->op); + return false; +} + +static bool +SimpleLookup(struct xkb_context *ctx, const void *priv, xkb_atom_t field, + enum expr_value_type type, unsigned int *val_rtrn) +{ + const LookupEntry *entry; + const char *str; + + if (!priv || field == XKB_ATOM_NONE || type != EXPR_TYPE_INT) + return false; + + str = xkb_atom_text(ctx, field); + for (entry = priv; entry && entry->name; entry++) { + if (istreq(str, entry->name)) { + *val_rtrn = entry->value; + return true; + } + } + + return false; +} + +/* Data passed in the *priv argument for LookupModMask. */ +typedef struct { + const struct xkb_keymap *keymap; + enum mod_type mod_type; +} LookupModMaskPriv; + +static bool +LookupModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field, + enum expr_value_type type, xkb_mod_mask_t *val_rtrn) +{ + const char *str; + xkb_mod_index_t ndx; + const LookupModMaskPriv *arg = priv; + const struct xkb_keymap *keymap = arg->keymap; + enum mod_type mod_type = arg->mod_type; + + if (type != EXPR_TYPE_INT) + return false; + + str = xkb_atom_text(ctx, field); + + if (istreq(str, "all")) { + *val_rtrn = MOD_REAL_MASK_ALL; + return true; + } + + if (istreq(str, "none")) { + *val_rtrn = 0; + return true; + } + + ndx = ModNameToIndex(keymap, field, mod_type); + if (ndx == XKB_MOD_INVALID) + return false; + + *val_rtrn = (1 << ndx); + return true; +} + +bool +ExprResolveBoolean(struct xkb_context *ctx, const ExprDef *expr, + bool *set_rtrn) +{ + bool ok = false; + const char *ident; + + switch (expr->op) { + case EXPR_VALUE: + if (expr->value_type != EXPR_TYPE_BOOLEAN) { + log_err(ctx, + "Found constant of type %s where boolean was expected\n", + expr_value_type_to_string(expr->value_type)); + return false; + } + *set_rtrn = !!expr->value.ival; + return true; + + case EXPR_IDENT: + ident = xkb_atom_text(ctx, expr->value.str); + if (ident) { + if (istreq(ident, "true") || + istreq(ident, "yes") || + istreq(ident, "on")) { + *set_rtrn = true; + return true; + } + else if (istreq(ident, "false") || + istreq(ident, "no") || + istreq(ident, "off")) { + *set_rtrn = false; + return true; + } + } + log_err(ctx, "Identifier \"%s\" of type boolean is unknown\n", + xkb_atom_text(ctx, expr->value.str)); + return false; + + case EXPR_FIELD_REF: + log_err(ctx, "Default \"%s.%s\" of type boolean is unknown\n", + xkb_atom_text(ctx, expr->value.field.element), + xkb_atom_text(ctx, expr->value.field.field)); + return false; + + case EXPR_INVERT: + case EXPR_NOT: + ok = ExprResolveBoolean(ctx, expr, set_rtrn); + if (ok) + *set_rtrn = !*set_rtrn; + return ok; + case EXPR_ADD: + case EXPR_SUBTRACT: + case EXPR_MULTIPLY: + case EXPR_DIVIDE: + case EXPR_ASSIGN: + case EXPR_NEGATE: + case EXPR_UNARY_PLUS: + log_err(ctx, "%s of boolean values not permitted\n", + expr_op_type_to_string(expr->op)); + break; + + default: + log_wsgo(ctx, "Unknown operator %d in ResolveBoolean\n", expr->op); + break; + } + + return false; +} + +bool +ExprResolveKeyCode(struct xkb_context *ctx, const ExprDef *expr, + xkb_keycode_t *kc) +{ + xkb_keycode_t leftRtrn, rightRtrn; + ExprDef *left, *right; + + switch (expr->op) { + case EXPR_VALUE: + if (expr->value_type != EXPR_TYPE_INT) { + log_err(ctx, + "Found constant of type %s where an int was expected\n", + expr_value_type_to_string(expr->value_type)); + return false; + } + + *kc = expr->value.uval; + return true; + + case EXPR_ADD: + case EXPR_SUBTRACT: + case EXPR_MULTIPLY: + case EXPR_DIVIDE: + left = expr->value.binary.left; + right = expr->value.binary.right; + + if (!ExprResolveKeyCode(ctx, left, &leftRtrn) || + !ExprResolveKeyCode(ctx, right, &rightRtrn)) + return false; + + switch (expr->op) { + case EXPR_ADD: + *kc = leftRtrn + rightRtrn; + break; + case EXPR_SUBTRACT: + *kc = leftRtrn - rightRtrn; + break; + case EXPR_MULTIPLY: + *kc = leftRtrn * rightRtrn; + break; + case EXPR_DIVIDE: + if (rightRtrn == 0) { + log_err(ctx, "Cannot divide by zero: %d / %d\n", + leftRtrn, rightRtrn); + return false; + } + + *kc = leftRtrn / rightRtrn; + break; + default: + break; + } + + return true; + + case EXPR_NEGATE: + left = expr->value.child; + if (!ExprResolveKeyCode(ctx, left, &leftRtrn)) + return false; + + *kc = ~leftRtrn; + return true; + + case EXPR_UNARY_PLUS: + left = expr->value.child; + return ExprResolveKeyCode(ctx, left, kc); + + default: + log_wsgo(ctx, "Unknown operator %d in ResolveKeyCode\n", expr->op); + break; + } + + return false; +} + +/** + * This function returns ... something. It's a bit of a guess, really. + * + * If an integer is given in value ctx, it will be returned in ival. + * If an ident or field reference is given, the lookup function (if given) + * will be called. At the moment, only SimpleLookup use this, and they both + * return the results in uval. And don't support field references. + * + * Cool. + */ +static bool +ExprResolveIntegerLookup(struct xkb_context *ctx, const ExprDef *expr, + int *val_rtrn, IdentLookupFunc lookup, + const void *lookupPriv) +{ + bool ok = false; + int l, r; + unsigned u; + ExprDef *left, *right; + + switch (expr->op) { + case EXPR_VALUE: + if (expr->value_type != EXPR_TYPE_INT) { + log_err(ctx, + "Found constant of type %s where an int was expected\n", + expr_value_type_to_string(expr->value_type)); + return false; + } + + *val_rtrn = expr->value.ival; + return true; + + case EXPR_IDENT: + if (lookup) + ok = lookup(ctx, lookupPriv, expr->value.str, EXPR_TYPE_INT, &u); + + if (!ok) + log_err(ctx, "Identifier \"%s\" of type int is unknown\n", + xkb_atom_text(ctx, expr->value.str)); + else + *val_rtrn = (int) u; + + return ok; + + case EXPR_FIELD_REF: + log_err(ctx, "Default \"%s.%s\" of type int is unknown\n", + xkb_atom_text(ctx, expr->value.field.element), + xkb_atom_text(ctx, expr->value.field.field)); + return false; + + case EXPR_ADD: + case EXPR_SUBTRACT: + case EXPR_MULTIPLY: + case EXPR_DIVIDE: + left = expr->value.binary.left; + right = expr->value.binary.right; + if (!ExprResolveIntegerLookup(ctx, left, &l, lookup, lookupPriv) || + !ExprResolveIntegerLookup(ctx, right, &r, lookup, lookupPriv)) + return false; + + switch (expr->op) { + case EXPR_ADD: + *val_rtrn = l + r; + break; + case EXPR_SUBTRACT: + *val_rtrn = l - r; + break; + case EXPR_MULTIPLY: + *val_rtrn = l * r; + break; + case EXPR_DIVIDE: + if (r == 0) { + log_err(ctx, "Cannot divide by zero: %d / %d\n", l, r); + return false; + } + *val_rtrn = l / r; + break; + default: + break; + } + + return true; + + case EXPR_ASSIGN: + log_wsgo(ctx, "Assignment operator not implemented yet\n"); + break; + + case EXPR_NOT: + log_err(ctx, "The ! operator cannot be applied to an integer\n"); + return false; + + case EXPR_INVERT: + case EXPR_NEGATE: + left = expr->value.child; + if (!ExprResolveIntegerLookup(ctx, left, &l, lookup, lookupPriv)) + return false; + + *val_rtrn = (expr->op == EXPR_NEGATE ? -l : ~l); + return true; + + case EXPR_UNARY_PLUS: + left = expr->value.child; + return ExprResolveIntegerLookup(ctx, left, val_rtrn, lookup, + lookupPriv); + + default: + log_wsgo(ctx, "Unknown operator %d in ResolveInteger\n", expr->op); + break; + } + + return false; +} + +bool +ExprResolveInteger(struct xkb_context *ctx, const ExprDef *expr, + int *val_rtrn) +{ + return ExprResolveIntegerLookup(ctx, expr, val_rtrn, NULL, NULL); +} + +bool +ExprResolveGroup(struct xkb_context *ctx, const ExprDef *expr, + xkb_layout_index_t *group_rtrn) +{ + bool ok; + int result; + + ok = ExprResolveIntegerLookup(ctx, expr, &result, SimpleLookup, + groupNames); + if (!ok) + return false; + + if (result <= 0 || result > XKB_MAX_GROUPS) { + log_err(ctx, "Group index %u is out of range (1..%d)\n", + result, XKB_MAX_GROUPS); + return false; + } + + *group_rtrn = (xkb_layout_index_t) result; + return true; +} + +bool +ExprResolveLevel(struct xkb_context *ctx, const ExprDef *expr, + xkb_level_index_t *level_rtrn) +{ + bool ok; + int result; + + ok = ExprResolveIntegerLookup(ctx, expr, &result, SimpleLookup, + levelNames); + if (!ok) + return false; + + if (result < 1) { + log_err(ctx, "Shift level %d is out of range\n", result); + return false; + } + + /* Level is zero-indexed from now on. */ + *level_rtrn = (unsigned int) (result - 1); + return true; +} + +bool +ExprResolveButton(struct xkb_context *ctx, const ExprDef *expr, int *btn_rtrn) +{ + int result; + + if (!ExprResolveIntegerLookup(ctx, expr, &result, SimpleLookup, + buttonNames)) + return false; + + *btn_rtrn = result; + return true; +} + +bool +ExprResolveString(struct xkb_context *ctx, const ExprDef *expr, + xkb_atom_t *val_rtrn) +{ + switch (expr->op) { + case EXPR_VALUE: + if (expr->value_type != EXPR_TYPE_STRING) { + log_err(ctx, "Found constant of type %s, expected a string\n", + expr_value_type_to_string(expr->value_type)); + return false; + } + + *val_rtrn = expr->value.str; + return true; + + case EXPR_IDENT: + log_err(ctx, "Identifier \"%s\" of type string not found\n", + xkb_atom_text(ctx, expr->value.str)); + return false; + + case EXPR_FIELD_REF: + log_err(ctx, "Default \"%s.%s\" of type string not found\n", + xkb_atom_text(ctx, expr->value.field.element), + xkb_atom_text(ctx, expr->value.field.field)); + return false; + + case EXPR_ADD: + case EXPR_SUBTRACT: + case EXPR_MULTIPLY: + case EXPR_DIVIDE: + case EXPR_ASSIGN: + case EXPR_NEGATE: + case EXPR_INVERT: + case EXPR_NOT: + case EXPR_UNARY_PLUS: + log_err(ctx, "%s of strings not permitted\n", + expr_op_type_to_string(expr->op)); + return false; + + default: + log_wsgo(ctx, "Unknown operator %d in ResolveString\n", expr->op); + break; + } + return false; +} + +bool +ExprResolveEnum(struct xkb_context *ctx, const ExprDef *expr, + unsigned int *val_rtrn, const LookupEntry *values) +{ + if (expr->op != EXPR_IDENT) { + log_err(ctx, "Found a %s where an enumerated value was expected\n", + expr_op_type_to_string(expr->op)); + return false; + } + + if (!SimpleLookup(ctx, values, expr->value.str, EXPR_TYPE_INT, + val_rtrn)) { + log_err(ctx, "Illegal identifier %s; expected one of:\n", + xkb_atom_text(ctx, expr->value.str)); + while (values && values->name) + { + log_err(ctx, "\t%s\n", values->name); + values++; + } + return false; + } + + return true; +} + +static bool +ExprResolveMaskLookup(struct xkb_context *ctx, const ExprDef *expr, + unsigned int *val_rtrn, IdentLookupFunc lookup, + const void *lookupPriv) +{ + bool ok = 0; + unsigned int l, r; + int v; + ExprDef *left, *right; + const char *bogus = NULL; + + switch (expr->op) { + case EXPR_VALUE: + if (expr->value_type != EXPR_TYPE_INT) { + log_err(ctx, + "Found constant of type %s where a mask was expected\n", + expr_value_type_to_string(expr->value_type)); + return false; + } + *val_rtrn = (unsigned int) expr->value.ival; + return true; + + case EXPR_IDENT: + ok = lookup(ctx, lookupPriv, expr->value.str, EXPR_TYPE_INT, + val_rtrn); + if (!ok) + log_err(ctx, "Identifier \"%s\" of type int is unknown\n", + xkb_atom_text(ctx, expr->value.str)); + return ok; + + case EXPR_FIELD_REF: + log_err(ctx, "Default \"%s.%s\" of type int is unknown\n", + xkb_atom_text(ctx, expr->value.field.element), + xkb_atom_text(ctx, expr->value.field.field)); + return false; + + case EXPR_ARRAY_REF: + bogus = "array reference"; + + case EXPR_ACTION_DECL: + if (bogus == NULL) + bogus = "function use"; + log_err(ctx, + "Unexpected %s in mask expression; Expression Ignored\n", + bogus); + return false; + + case EXPR_ADD: + case EXPR_SUBTRACT: + case EXPR_MULTIPLY: + case EXPR_DIVIDE: + left = expr->value.binary.left; + right = expr->value.binary.right; + if (!ExprResolveMaskLookup(ctx, left, &l, lookup, lookupPriv) || + !ExprResolveMaskLookup(ctx, right, &r, lookup, lookupPriv)) + return false; + + switch (expr->op) { + case EXPR_ADD: + *val_rtrn = l | r; + break; + case EXPR_SUBTRACT: + *val_rtrn = l & (~r); + break; + case EXPR_MULTIPLY: + case EXPR_DIVIDE: + log_err(ctx, "Cannot %s masks; Illegal operation ignored\n", + (expr->op == EXPR_DIVIDE ? "divide" : "multiply")); + return false; + default: + break; + } + + return true; + + case EXPR_ASSIGN: + log_wsgo(ctx, "Assignment operator not implemented yet\n"); + break; + + case EXPR_INVERT: + left = expr->value.child; + if (!ExprResolveIntegerLookup(ctx, left, &v, lookup, lookupPriv)) + return false; + + *val_rtrn = ~v; + return true; + + case EXPR_UNARY_PLUS: + case EXPR_NEGATE: + case EXPR_NOT: + left = expr->value.child; + if (!ExprResolveIntegerLookup(ctx, left, &v, lookup, lookupPriv)) + log_err(ctx, "The %s operator cannot be used with a mask\n", + (expr->op == EXPR_NEGATE ? "-" : "!")); + return false; + + default: + log_wsgo(ctx, "Unknown operator %d in ResolveMask\n", expr->op); + break; + } + + return false; +} + +bool +ExprResolveMask(struct xkb_context *ctx, const ExprDef *expr, + unsigned int *mask_rtrn, const LookupEntry *values) +{ + return ExprResolveMaskLookup(ctx, expr, mask_rtrn, SimpleLookup, values); +} + +bool +ExprResolveModMask(struct xkb_keymap *keymap, const ExprDef *expr, + enum mod_type mod_type, xkb_mod_mask_t *mask_rtrn) +{ + LookupModMaskPriv priv = { .keymap = keymap, .mod_type = mod_type }; + return ExprResolveMaskLookup(keymap->ctx, expr, mask_rtrn, LookupModMask, + &priv); +} + +bool +ExprResolveKeySym(struct xkb_context *ctx, const ExprDef *expr, + xkb_keysym_t *sym_rtrn) +{ + int val; + + if (expr->op == EXPR_IDENT) { + const char *str; + str = xkb_atom_text(ctx, expr->value.str); + *sym_rtrn = xkb_keysym_from_name(str, 0); + if (*sym_rtrn != XKB_KEY_NoSymbol) + return true; + } + + if (!ExprResolveInteger(ctx, expr, &val)) + return false; + + if (val < 0 || val >= 10) + return false; + + *sym_rtrn = ((xkb_keysym_t) val) + '0'; + return true; +} + +bool +ExprResolveMod(struct xkb_keymap *keymap, const ExprDef *def, + enum mod_type mod_type, xkb_mod_index_t *ndx_rtrn) +{ + xkb_mod_index_t ndx; + xkb_atom_t name = def->value.str; + + if (def->op != EXPR_IDENT) { + log_err(keymap->ctx, + "Cannot resolve virtual modifier: " + "found %s where a virtual modifier name was expected\n", + expr_op_type_to_string(def->op)); + return false; + } + + ndx = ModNameToIndex(keymap, name, mod_type); + if (ndx == XKB_MOD_INVALID) { + log_err(keymap->ctx, + "Cannot resolve virtual modifier: " + "\"%s\" was not previously declared\n", + xkb_atom_text(keymap->ctx, name)); + return false; + } + + *ndx_rtrn = ndx; + return true; +} diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/expr.h b/src/3rdparty/xkbcommon/src/xkbcomp/expr.h new file mode 100644 index 0000000000..5434ad199e --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/expr.h @@ -0,0 +1,83 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +#ifndef XKBCOMP_EXPR_H +#define XKBCOMP_EXPR_H + +bool +ExprResolveLhs(struct xkb_context *ctx, const ExprDef *expr, + const char **elem_rtrn, const char **field_rtrn, + ExprDef **index_rtrn); + +bool +ExprResolveModMask(struct xkb_keymap *keymap, const ExprDef *expr, + enum mod_type mod_type, xkb_mod_mask_t *mask_rtrn); + +bool +ExprResolveMod(struct xkb_keymap *keymap, const ExprDef *def, + enum mod_type mod_type, xkb_mod_index_t *ndx_rtrn); + +bool +ExprResolveBoolean(struct xkb_context *ctx, const ExprDef *expr, + bool *set_rtrn); + +bool +ExprResolveKeyCode(struct xkb_context *ctx, const ExprDef *expr, + xkb_keycode_t *kc); + +bool +ExprResolveInteger(struct xkb_context *ctx, const ExprDef *expr, + int *val_rtrn); + +bool +ExprResolveLevel(struct xkb_context *ctx, const ExprDef *expr, + xkb_level_index_t *level_rtrn); + +bool +ExprResolveGroup(struct xkb_context *ctx, const ExprDef *expr, + xkb_layout_index_t *group_rtrn); + +bool +ExprResolveButton(struct xkb_context *ctx, const ExprDef *expr, + int *btn_rtrn); + +bool +ExprResolveString(struct xkb_context *ctx, const ExprDef *expr, + xkb_atom_t *val_rtrn); + +bool +ExprResolveEnum(struct xkb_context *ctx, const ExprDef *expr, + unsigned int *val_rtrn, const LookupEntry *values); + +bool +ExprResolveMask(struct xkb_context *ctx, const ExprDef *expr, + unsigned int *mask_rtrn, const LookupEntry *values); + +bool +ExprResolveKeySym(struct xkb_context *ctx, const ExprDef *expr, + xkb_keysym_t *sym_rtrn); + +#endif diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/include.c b/src/3rdparty/xkbcommon/src/xkbcomp/include.c new file mode 100644 index 0000000000..b4a4014635 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/include.c @@ -0,0 +1,289 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +/* + * Copyright © 2012 Ran Benita <ran234@gmail.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <errno.h> +#include <limits.h> +#include <stdio.h> + +#include "xkbcomp-priv.h" +#include "include.h" + +/** + * Parse an include statement. Each call returns a file name, along with + * (possibly) a specific map in the file, an explicit group designator, and + * the separator from the next file, used to determine the merge mode. + * + * @param str_inout Input statement, modified in-place. Should be passed in + * repeatedly. If str_inout is NULL, the parsing has completed. + * + * @param file_rtrn Set to the name of the include file to be used. Combined + * with an enum xkb_file_type, this determines which file to look for in the + * include path. + * + * @param map_rtrn Set to the string between '(' and ')', if any. This will + * result in the compilation of a specific named map within the file (e.g. + * xkb_symbols "basic" { ... }) , as opposed to the default map of the file. + * + * @param nextop_rtrn Set to the next operation in the complete statement, + * which is '\0' if it's the last file or '+' or '|' if there are more. + * Separating the files with '+' sets the merge mode to MERGE_MODE_OVERRIDE, + * while '|' sets the merge mode to MERGE_MODE_AUGMENT. + * + * @param extra_data Set to the string after ':', if any. Currently the + * extra data is only used for setting an explicit group index for a symbols + * file. + * + * @return true if parsing was successful, false for an illegal string. + * + * Example: "evdev+aliases(qwerty):2" + * str_inout = "aliases(qwerty):2" + * file_rtrn = "evdev" + * map_rtrn = NULL + * nextop_retrn = "+" + * extra_data = NULL + * + * 2nd run with "aliases(qwerty):2" + * str_inout = NULL + * file_rtrn = "aliases" + * map_rtrn = "qwerty" + * nextop_retrn = "" + * extra_data = "2" + * + */ +bool +ParseIncludeMap(char **str_inout, char **file_rtrn, char **map_rtrn, + char *nextop_rtrn, char **extra_data) +{ + char *tmp, *str, *next; + + str = *str_inout; + + /* + * Find the position in the string where the next file is included, + * if there is more than one left in the statement. + */ + next = strpbrk(str, "|+"); + if (next) { + /* Got more files, this function will be called again. */ + *nextop_rtrn = *next; + /* Separate the string, for strchr etc. to work on this file only. */ + *next++ = '\0'; + } + else { + /* This is the last file in this statement, won't be called again. */ + *nextop_rtrn = '\0'; + next = NULL; + } + + /* + * Search for the explicit group designator, if any. If it's there, + * it goes after the file name and map. + */ + tmp = strchr(str, ':'); + if (tmp != NULL) { + *tmp++ = '\0'; + *extra_data = strdup(tmp); + } + else { + *extra_data = NULL; + } + + /* Look for a map, if any. */ + tmp = strchr(str, '('); + if (tmp == NULL) { + /* No map. */ + *file_rtrn = strdup(str); + *map_rtrn = NULL; + } + else if (str[0] == '(') { + /* Map without file - invalid. */ + free(*extra_data); + return false; + } + else { + /* Got a map; separate the file and the map for the strdup's. */ + *tmp++ = '\0'; + *file_rtrn = strdup(str); + str = tmp; + tmp = strchr(str, ')'); + if (tmp == NULL || tmp[1] != '\0') { + free(*file_rtrn); + free(*extra_data); + return false; + } + *tmp++ = '\0'; + *map_rtrn = strdup(str); + } + + /* Set up the next file for the next call, if any. */ + if (*nextop_rtrn == '\0') + *str_inout = NULL; + else if (*nextop_rtrn == '|' || *nextop_rtrn == '+') + *str_inout = next; + else + return false; + + return true; +} + +static const char *xkb_file_type_include_dirs[_FILE_TYPE_NUM_ENTRIES] = { + [FILE_TYPE_KEYCODES] = "keycodes", + [FILE_TYPE_TYPES] = "types", + [FILE_TYPE_COMPAT] = "compat", + [FILE_TYPE_SYMBOLS] = "symbols", + [FILE_TYPE_GEOMETRY] = "geometry", + [FILE_TYPE_KEYMAP] = "keymap", + [FILE_TYPE_RULES] = "rules", +}; + +/** + * Return the xkb directory based on the type. + */ +static const char * +DirectoryForInclude(enum xkb_file_type type) +{ + if (type >= _FILE_TYPE_NUM_ENTRIES) + return ""; + return xkb_file_type_include_dirs[type]; +} + +FILE * +FindFileInXkbPath(struct xkb_context *ctx, const char *name, + enum xkb_file_type type, char **pathRtrn) +{ + unsigned int i; + FILE *file = NULL; + char buf[PATH_MAX]; + const char *typeDir; + + typeDir = DirectoryForInclude(type); + + for (i = 0; i < xkb_context_num_include_paths(ctx); i++) { + int ret = snprintf(buf, sizeof(buf), "%s/%s/%s", + xkb_context_include_path_get(ctx, i), + typeDir, name); + if (ret >= (ssize_t) sizeof(buf)) { + log_err(ctx, "File name (%s/%s/%s) too long\n", + xkb_context_include_path_get(ctx, i), typeDir, name); + continue; + } + + file = fopen(buf, "r"); + if (file) + break; + } + + if (!file) { + log_err(ctx, "Couldn't find file \"%s/%s\" in include paths\n", + typeDir, name); + + if (xkb_context_num_include_paths(ctx) > 0) { + log_err(ctx, "%d include paths searched:\n", + xkb_context_num_include_paths(ctx)); + for (i = 0; i < xkb_context_num_include_paths(ctx); i++) + log_err(ctx, "\t%s\n", + xkb_context_include_path_get(ctx, i)); + } + else { + log_err(ctx, "There are no include paths to search\n"); + } + + if (xkb_context_num_failed_include_paths(ctx) > 0) { + log_err(ctx, "%d include paths could not be added:\n", + xkb_context_num_failed_include_paths(ctx)); + for (i = 0; i < xkb_context_num_failed_include_paths(ctx); i++) + log_err(ctx, "\t%s\n", + xkb_context_failed_include_path_get(ctx, i)); + } + + return NULL; + } + + if (pathRtrn) + *pathRtrn = strdup(buf); + return file; +} + +XkbFile * +ProcessIncludeFile(struct xkb_context *ctx, IncludeStmt *stmt, + enum xkb_file_type file_type) +{ + FILE *file; + XkbFile *xkb_file; + + file = FindFileInXkbPath(ctx, stmt->file, file_type, NULL); + if (!file) + return false; + + xkb_file = XkbParseFile(ctx, file, stmt->file, stmt->map); + fclose(file); + if (!xkb_file) { + if (stmt->map) + log_err(ctx, "Couldn't process include statement for '%s(%s)'\n", + stmt->file, stmt->map); + else + log_err(ctx, "Couldn't process include statement for '%s'\n", + stmt->file); + return NULL; + } + + if (xkb_file->file_type != file_type) { + log_err(ctx, + "Include file wrong type (expected %s, got %s); " + "Include file \"%s\" ignored\n", + xkb_file_type_to_string(file_type), + xkb_file_type_to_string(xkb_file->file_type), stmt->file); + FreeXkbFile(xkb_file); + return NULL; + } + + /* FIXME: we have to check recursive includes here (or somewhere) */ + + return xkb_file; +} diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/include.h b/src/3rdparty/xkbcommon/src/xkbcomp/include.h new file mode 100644 index 0000000000..03e76ed5ce --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/include.h @@ -0,0 +1,42 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +#ifndef XKBCOMP_INCLUDE_H +#define XKBCOMP_INCLUDE_H + +bool +ParseIncludeMap(char **str_inout, char **file_rtrn, char **map_rtrn, + char *nextop_rtrn, char **extra_data); + +FILE * +FindFileInXkbPath(struct xkb_context *ctx, const char *name, + enum xkb_file_type type, char **pathRtrn); + +XkbFile * +ProcessIncludeFile(struct xkb_context *ctx, IncludeStmt *stmt, + enum xkb_file_type file_type); + +#endif diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/keycodes.c b/src/3rdparty/xkbcommon/src/xkbcomp/keycodes.c new file mode 100644 index 0000000000..edc54c94f3 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/keycodes.c @@ -0,0 +1,692 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +#include "xkbcomp-priv.h" +#include "text.h" +#include "expr.h" +#include "include.h" + +/* + * The xkb_keycodes section + * ======================== + * + * This is the simplest section type, and is the first one to be + * compiled. The purpose of this is mostly to map between the + * hardware/evdev scancodes and xkb keycodes. Each key is given a name + * by which it can be referred to later, e.g. in the symbols section. + * + * Keycode statements + * ------------------ + * Statements of the form: + * <TLDE> = 49; + * <AE01> = 10; + * + * The above would let 49 and 10 be valid keycodes in the keymap, and + * assign them the names TLDE and AE01 respectively. The format <WXYZ> is + * always used to refer to a key by name. + * + * [ The naming convention <AE01> just denoted the position of the key + * in the main alphanumric section of the keyboard, with the two letters + * specifying the row and the two digits specifying the column, from + * the bottom left.] + * + * In the common case this just maps to the evdev scancodes from + * /usr/include/linux/input.h, e.g. the following definitions: + * #define KEY_GRAVE 41 + * #define KEY_1 2 + * Similar definitions appear in the xf86-input-keyboard driver. Note + * that in all current keymaps there's a constant offset of 8 (for + * historical reasons). + * + * If there's a conflict, like the same name given to different keycodes, + * or same keycode given different names, it is resolved according to the + * merge mode which applies to the definitions. + * + * Alias statements + * ---------------- + * Statements of the form: + * alias <MENU> = <COMP>; + * + * Allows to refer to a previously defined key (here <COMP>) by another + * name (here <MENU>). Conflicts are handled similarly. + * + * LED name statements + * ------------------------- + * Statements of the form: + * indicator 1 = "Caps Lock"; + * indicator 2 = "Num Lock"; + * indicator 3 = "Scroll Lock"; + * + * Assigns a name to the keyboard LED (a.k.a indicator) with the given index. + * The led may be referred by this name later in the compat section + * and by the user. + * + * Effect on the keymap + * -------------------- + * After all of the xkb_keycodes sections have been compiled, the + * following members of struct xkb_keymap are finalized: + * xkb_keycode_t min_key_code; + * xkb_keycode_t max_key_code; + * unsigned int num_aliases; + * struct xkb_key_alias *key_aliases; + * char *keycodes_section_name; + * The 'name' field of leds declared in xkb_keycodes: + * darray(struct xkb_led) leds; + * Further, the array of keys: + * struct xkb_key *keys; + * had been resized to its final size (i.e. all of the xkb_key objects are + * referable by their keycode). However the objects themselves do not + * contain any useful information besides the key name at this point. + */ + +typedef struct { + enum merge_mode merge; + + xkb_atom_t alias; + xkb_atom_t real; +} AliasInfo; + +typedef struct { + enum merge_mode merge; + + xkb_atom_t name; +} LedNameInfo; + +typedef struct { + char *name; + int errorCount; + + xkb_keycode_t min_key_code; + xkb_keycode_t max_key_code; + darray(xkb_atom_t) key_names; + darray(LedNameInfo) led_names; + darray(AliasInfo) aliases; + + struct xkb_context *ctx; +} KeyNamesInfo; + +/***====================================================================***/ + +static void +InitAliasInfo(AliasInfo *info, enum merge_mode merge, + xkb_atom_t alias, xkb_atom_t real) +{ + memset(info, 0, sizeof(*info)); + info->merge = merge; + info->alias = alias; + info->real = real; +} + +static LedNameInfo * +FindLedByName(KeyNamesInfo *info, xkb_atom_t name, + xkb_led_index_t *idx_out) +{ + LedNameInfo *ledi; + xkb_led_index_t idx; + + darray_enumerate(idx, ledi, info->led_names) { + if (ledi->name == name) { + *idx_out = idx; + return ledi; + } + } + + return NULL; +} + +static bool +AddLedName(KeyNamesInfo *info, enum merge_mode merge, bool same_file, + LedNameInfo *new, xkb_led_index_t new_idx) +{ + xkb_led_index_t old_idx; + LedNameInfo *old; + const int verbosity = xkb_context_get_log_verbosity(info->ctx); + const bool report = (same_file && verbosity > 0) || verbosity > 9; + const bool replace = (merge == MERGE_REPLACE || merge == MERGE_OVERRIDE); + + /* LED with the same name already exists. */ + old = FindLedByName(info, new->name, &old_idx); + if (old) { + if (old_idx == new_idx) { + log_warn(info->ctx, + "Multiple indicators named \"%s\"; " + "Identical definitions ignored\n", + xkb_atom_text(info->ctx, new->name)); + return true; + } + + if (report) { + xkb_led_index_t use = (replace ? new_idx + 1 : old_idx + 1); + xkb_led_index_t ignore = (replace ? old_idx + 1 : new_idx + 1); + log_warn(info->ctx, + "Multiple indicators named %s; Using %d, ignoring %d\n", + xkb_atom_text(info->ctx, new->name), use, ignore); + } + + if (replace) + *old = *new; + + return true; + } + + if (new_idx >= darray_size(info->led_names)) + darray_resize0(info->led_names, new_idx + 1); + + /* LED with the same index already exists. */ + old = &darray_item(info->led_names, new_idx); + if (old->name != XKB_ATOM_NONE) { + if (report) { + const xkb_atom_t use = (replace ? new->name : old->name); + const xkb_atom_t ignore = (replace ? old->name : new->name); + log_warn(info->ctx, "Multiple names for indicator %d; " + "Using %s, ignoring %s\n", new_idx + 1, + xkb_atom_text(info->ctx, use), + xkb_atom_text(info->ctx, ignore)); + } + + if (replace) + *old = *new; + + return true; + } + + darray_item(info->led_names, new_idx) = *new; + return true; +} + +static void +ClearKeyNamesInfo(KeyNamesInfo *info) +{ + free(info->name); + darray_free(info->key_names); + darray_free(info->aliases); + darray_free(info->led_names); +} + +static void +InitKeyNamesInfo(KeyNamesInfo *info, struct xkb_context *ctx) +{ + memset(info, 0, sizeof(*info)); + info->ctx = ctx; + info->min_key_code = XKB_KEYCODE_MAX; +} + +static xkb_keycode_t +FindKeyByName(KeyNamesInfo *info, xkb_atom_t name) +{ + xkb_keycode_t i; + + for (i = info->min_key_code; i <= info->max_key_code; i++) + if (darray_item(info->key_names, i) == name) + return i; + + return XKB_KEYCODE_INVALID; +} + +static bool +AddKeyName(KeyNamesInfo *info, xkb_keycode_t kc, xkb_atom_t name, + enum merge_mode merge, bool same_file, bool report) +{ + xkb_atom_t old_name; + xkb_keycode_t old_kc; + const int verbosity = xkb_context_get_log_verbosity(info->ctx); + + report = report && ((same_file && verbosity > 0) || verbosity > 7); + + if (kc >= darray_size(info->key_names)) + darray_resize0(info->key_names, kc + 1); + + info->min_key_code = MIN(info->min_key_code, kc); + info->max_key_code = MAX(info->max_key_code, kc); + + /* There's already a key with this keycode. */ + old_name = darray_item(info->key_names, kc); + if (old_name != XKB_ATOM_NONE) { + const char *lname = KeyNameText(info->ctx, old_name); + const char *kname = KeyNameText(info->ctx, name); + + if (old_name == name) { + if (report) + log_warn(info->ctx, + "Multiple identical key name definitions; " + "Later occurrences of \"%s = %d\" ignored\n", + lname, kc); + return true; + } + else if (merge == MERGE_AUGMENT) { + if (report) + log_warn(info->ctx, + "Multiple names for keycode %d; " + "Using %s, ignoring %s\n", kc, lname, kname); + return true; + } + else { + if (report) + log_warn(info->ctx, + "Multiple names for keycode %d; " + "Using %s, ignoring %s\n", kc, kname, lname); + darray_item(info->key_names, kc) = XKB_ATOM_NONE; + } + } + + /* There's already a key with this name. */ + old_kc = FindKeyByName(info, name); + if (old_kc != XKB_KEYCODE_INVALID && old_kc != kc) { + const char *kname = KeyNameText(info->ctx, name); + + if (merge == MERGE_OVERRIDE) { + darray_item(info->key_names, old_kc) = XKB_ATOM_NONE; + if (report) + log_warn(info->ctx, + "Key name %s assigned to multiple keys; " + "Using %d, ignoring %d\n", kname, kc, old_kc); + } + else { + if (report) + log_vrb(info->ctx, 3, + "Key name %s assigned to multiple keys; " + "Using %d, ignoring %d\n", kname, old_kc, kc); + return true; + } + } + + darray_item(info->key_names, kc) = name; + return true; +} + +/***====================================================================***/ + +static int +HandleAliasDef(KeyNamesInfo *info, KeyAliasDef *def, enum merge_mode merge); + +static void +MergeIncludedKeycodes(KeyNamesInfo *into, KeyNamesInfo *from, + enum merge_mode merge) +{ + if (from->errorCount > 0) { + into->errorCount += from->errorCount; + return; + } + + if (into->name == NULL) { + into->name = from->name; + from->name = NULL; + } + + /* Merge key names. */ + if (darray_empty(into->key_names)) { + into->key_names = from->key_names; + darray_init(from->key_names); + into->min_key_code = from->min_key_code; + into->max_key_code = from->max_key_code; + } + else { + if (darray_size(into->key_names) < darray_size(from->key_names)) + darray_resize0(into->key_names, darray_size(from->key_names)); + + for (unsigned i = from->min_key_code; i <= from->max_key_code; i++) { + xkb_atom_t name = darray_item(from->key_names, i); + if (name == XKB_ATOM_NONE) + continue; + + if (!AddKeyName(into, i, name, merge, true, false)) + into->errorCount++; + } + } + + /* Merge key aliases. */ + if (darray_empty(into->aliases)) { + into->aliases = from->aliases; + darray_init(from->aliases); + } + else { + AliasInfo *alias; + + darray_foreach(alias, from->aliases) { + KeyAliasDef def; + + def.merge = (merge == MERGE_DEFAULT ? alias->merge : merge); + def.alias = alias->alias; + def.real = alias->real; + + if (!HandleAliasDef(into, &def, def.merge)) + into->errorCount++; + } + } + + /* Merge LED names. */ + if (darray_empty(into->led_names)) { + into->led_names = from->led_names; + darray_init(from->led_names); + } + else { + xkb_led_index_t idx; + LedNameInfo *ledi; + + darray_enumerate(idx, ledi, from->led_names) { + if (ledi->name == XKB_ATOM_NONE) + continue; + + ledi->merge = (merge == MERGE_DEFAULT ? ledi->merge : merge); + if (!AddLedName(into, ledi->merge, false, ledi, idx)) + into->errorCount++; + } + } +} + +static void +HandleKeycodesFile(KeyNamesInfo *info, XkbFile *file, enum merge_mode merge); + +static bool +HandleIncludeKeycodes(KeyNamesInfo *info, IncludeStmt *include) +{ + KeyNamesInfo included; + + InitKeyNamesInfo(&included, info->ctx); + included.name = include->stmt; + include->stmt = NULL; + + for (IncludeStmt *stmt = include; stmt; stmt = stmt->next_incl) { + KeyNamesInfo next_incl; + XkbFile *file; + + file = ProcessIncludeFile(info->ctx, stmt, FILE_TYPE_KEYCODES); + if (!file) { + info->errorCount += 10; + ClearKeyNamesInfo(&included); + return false; + } + + InitKeyNamesInfo(&next_incl, info->ctx); + + HandleKeycodesFile(&next_incl, file, MERGE_OVERRIDE); + + MergeIncludedKeycodes(&included, &next_incl, stmt->merge); + + ClearKeyNamesInfo(&next_incl); + FreeXkbFile(file); + } + + MergeIncludedKeycodes(info, &included, include->merge); + ClearKeyNamesInfo(&included); + + return (info->errorCount == 0); +} + +static bool +HandleKeycodeDef(KeyNamesInfo *info, KeycodeDef *stmt, enum merge_mode merge) +{ + if (stmt->merge != MERGE_DEFAULT) { + if (stmt->merge == MERGE_REPLACE) + merge = MERGE_OVERRIDE; + else + merge = stmt->merge; + } + + if (stmt->value < 0 || stmt->value > XKB_KEYCODE_MAX) { + log_err(info->ctx, + "Illegal keycode %lld: must be between 0..%u; " + "Key ignored\n", (long long) stmt->value, XKB_KEYCODE_MAX); + return false; + } + + return AddKeyName(info, stmt->value, stmt->name, merge, false, true); +} + +static int +HandleAliasDef(KeyNamesInfo *info, KeyAliasDef *def, enum merge_mode merge) +{ + AliasInfo *old, new; + + darray_foreach(old, info->aliases) { + if (old->alias == def->alias) { + if (def->real == old->real) { + log_vrb(info->ctx, 1, + "Alias of %s for %s declared more than once; " + "First definition ignored\n", + KeyNameText(info->ctx, def->alias), + KeyNameText(info->ctx, def->real)); + } + else { + xkb_atom_t use, ignore; + + use = (merge == MERGE_AUGMENT ? old->real : def->real); + ignore = (merge == MERGE_AUGMENT ? def->real : old->real); + + log_warn(info->ctx, + "Multiple definitions for alias %s; " + "Using %s, ignoring %s\n", + KeyNameText(info->ctx, old->alias), + KeyNameText(info->ctx, use), + KeyNameText(info->ctx, ignore)); + + old->real = use; + } + + old->merge = merge; + return true; + } + } + + InitAliasInfo(&new, merge, def->alias, def->real); + darray_append(info->aliases, new); + return true; +} + +static int +HandleKeyNameVar(KeyNamesInfo *info, VarDef *stmt) +{ + const char *elem, *field; + ExprDef *arrayNdx; + + if (!ExprResolveLhs(info->ctx, stmt->name, &elem, &field, &arrayNdx)) + return false; + + if (elem) { + log_err(info->ctx, "Unknown element %s encountered; " + "Default for field %s ignored\n", elem, field); + return false; + } + + if (!istreq(field, "minimum") && !istreq(field, "maximum")) { + log_err(info->ctx, "Unknown field encountered; " + "Assignment to field %s ignored\n", field); + return false; + } + + /* We ignore explicit min/max statements, we always use computed. */ + return true; +} + +static int +HandleLedNameDef(KeyNamesInfo *info, LedNameDef *def, + enum merge_mode merge) +{ + LedNameInfo ledi; + xkb_atom_t name; + + if (def->ndx < 1 || def->ndx > XKB_MAX_LEDS) { + info->errorCount++; + log_err(info->ctx, + "Illegal indicator index (%d) specified; must be between 1 .. %d; " + "Ignored\n", def->ndx, XKB_MAX_LEDS); + return false; + } + + if (!ExprResolveString(info->ctx, def->name, &name)) { + char buf[20]; + snprintf(buf, sizeof(buf), "%d", def->ndx); + info->errorCount++; + return ReportBadType(info->ctx, "indicator", "name", buf, "string"); + } + + ledi.merge = merge; + ledi.name = name; + return AddLedName(info, merge, true, &ledi, def->ndx - 1); +} + +static void +HandleKeycodesFile(KeyNamesInfo *info, XkbFile *file, enum merge_mode merge) +{ + bool ok; + + free(info->name); + info->name = strdup_safe(file->name); + + for (ParseCommon *stmt = file->defs; stmt; stmt = stmt->next) { + switch (stmt->type) { + case STMT_INCLUDE: + ok = HandleIncludeKeycodes(info, (IncludeStmt *) stmt); + break; + case STMT_KEYCODE: + ok = HandleKeycodeDef(info, (KeycodeDef *) stmt, merge); + break; + case STMT_ALIAS: + ok = HandleAliasDef(info, (KeyAliasDef *) stmt, merge); + break; + case STMT_VAR: + ok = HandleKeyNameVar(info, (VarDef *) stmt); + break; + case STMT_LED_NAME: + ok = HandleLedNameDef(info, (LedNameDef *) stmt, merge); + break; + default: + log_err(info->ctx, + "Keycode files may define key and indicator names only; " + "Ignoring %s\n", stmt_type_to_string(stmt->type)); + ok = false; + break; + } + + if (!ok) + info->errorCount++; + + if (info->errorCount > 10) { + log_err(info->ctx, "Abandoning keycodes file \"%s\"\n", + file->topName); + break; + } + } +} + +/***====================================================================***/ + +static bool +CopyKeyNamesToKeymap(struct xkb_keymap *keymap, KeyNamesInfo *info) +{ + xkb_keycode_t kc; + xkb_led_index_t idx; + LedNameInfo *ledi; + AliasInfo *alias; + unsigned i; + + keymap->keycodes_section_name = strdup_safe(info->name); + + keymap->min_key_code = info->min_key_code; + keymap->max_key_code = info->max_key_code; + + /* Copy key names. */ + keymap->keys = calloc(info->max_key_code + 1, sizeof(*keymap->keys)); + for (kc = info->min_key_code; kc <= info->max_key_code; kc++) { + keymap->keys[kc].keycode = kc; + keymap->keys[kc].name = darray_item(info->key_names, kc); + } + + /* + * Do some sanity checking on the aliases. We can't do it before + * because keys and their aliases may be added out-of-order. + */ + keymap->num_key_aliases = 0; + darray_foreach(alias, info->aliases) { + /* Check that ->real is a key. */ + if (!XkbKeyByName(keymap, alias->real, false)) { + log_vrb(info->ctx, 5, + "Attempt to alias %s to non-existent key %s; Ignored\n", + KeyNameText(info->ctx, alias->alias), + KeyNameText(info->ctx, alias->real)); + alias->real = XKB_ATOM_NONE; + continue; + } + + /* Check that ->alias is not a key. */ + if (XkbKeyByName(keymap, alias->alias, false)) { + log_vrb(info->ctx, 5, + "Attempt to create alias with the name of a real key; " + "Alias \"%s = %s\" ignored\n", + KeyNameText(info->ctx, alias->alias), + KeyNameText(info->ctx, alias->real)); + alias->real = XKB_ATOM_NONE; + continue; + } + + keymap->num_key_aliases++; + } + + /* Copy key aliases. */ + keymap->key_aliases = calloc(keymap->num_key_aliases, + sizeof(*keymap->key_aliases)); + i = 0; + darray_foreach(alias, info->aliases) { + if (alias->real != XKB_ATOM_NONE) { + keymap->key_aliases[i].alias = alias->alias; + keymap->key_aliases[i].real = alias->real; + i++; + } + } + + /* Copy LED names. */ + darray_resize0(keymap->leds, darray_size(info->led_names)); + darray_enumerate(idx, ledi, info->led_names) + if (ledi->name != XKB_ATOM_NONE) + darray_item(keymap->leds, idx).name = ledi->name; + + return true; +} + +/***====================================================================***/ + +bool +CompileKeycodes(XkbFile *file, struct xkb_keymap *keymap, + enum merge_mode merge) +{ + KeyNamesInfo info; + + InitKeyNamesInfo(&info, keymap->ctx); + + HandleKeycodesFile(&info, file, merge); + if (info.errorCount != 0) + goto err_info; + + if (!CopyKeyNamesToKeymap(keymap, &info)) + goto err_info; + + ClearKeyNamesInfo(&info); + return true; + +err_info: + ClearKeyNamesInfo(&info); + return false; +} diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/keymap-dump.c b/src/3rdparty/xkbcommon/src/xkbcomp/keymap-dump.c new file mode 100644 index 0000000000..034a8c1af3 --- /dev/null +++ b/src/3rdparty/xkbcommon/src/xkbcomp/keymap-dump.c @@ -0,0 +1,662 @@ +/************************************************************ + * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of Silicon Graphics not be + * used in advertising or publicity pertaining to distribution + * of the software without specific prior written permission. + * Silicon Graphics makes no representation about the suitability + * of this software for any purpose. It is provided "as is" + * without any express or implied warranty. + * + * SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH + * THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + ********************************************************/ + +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + */ + +#include "xkbcomp-priv.h" +#include "text.h" + +#define BUF_CHUNK_SIZE 4096 + +struct buf { + char *buf; + size_t size; + size_t alloc; +}; + +static bool +do_realloc(struct buf *buf, size_t at_least) +{ + char *new; + + buf->alloc += BUF_CHUNK_SIZE; + if (at_least >= BUF_CHUNK_SIZE) + buf->alloc += at_least; + + new = realloc(buf->buf, buf->alloc); + if (!new) + return false; + + buf->buf = new; + return true; +} + +ATTR_PRINTF(2, 3) static bool +check_write_buf(struct buf *buf, const char *fmt, ...) +{ + va_list args; + int printed; + size_t available; + + available = buf->alloc - buf->size; + va_start(args, fmt); + printed = vsnprintf(buf->buf + buf->size, available, fmt, args); + va_end(args); + + if (printed < 0) + goto err; + + if (printed >= available) + if (!do_realloc(buf, printed)) + goto err; + + /* The buffer has enough space now. */ + + available = buf->alloc - buf->size; + va_start(args, fmt); + printed = vsnprintf(buf->buf + buf->size, available, fmt, args); + va_end(args); + + if (printed >= available || printed < 0) + goto err; + + buf->size += printed; + return true; + +err: + free(buf->buf); + buf->buf = NULL; + return false; +} + +#define write_buf(buf, ...) do { \ + if (!check_write_buf(buf, __VA_ARGS__)) \ + return false; \ +} while (0) + +static bool +write_vmods(struct xkb_keymap *keymap, struct buf *buf) +{ + const struct xkb_mod *mod; + xkb_mod_index_t num_vmods = 0; + + darray_foreach(mod, keymap->mods) { + if (mod->type != MOD_VIRT) + continue; + + if (num_vmods == 0) + write_buf(buf, "\tvirtual_modifiers "); + else + write_buf(buf, ","); + write_buf(buf, "%s", xkb_atom_text(keymap->ctx, mod->name)); + num_vmods++; + } + + if (num_vmods > 0) + write_buf(buf, ";\n\n"); + + return true; +} + +static bool +write_keycodes(struct xkb_keymap *keymap, struct buf *buf) +{ + const struct xkb_key *key; + xkb_led_index_t idx; + const struct xkb_led *led; + + if (keymap->keycodes_section_name) + write_buf(buf, "xkb_keycodes \"%s\" {\n", + keymap->keycodes_section_name); + else + write_buf(buf, "xkb_keycodes {\n"); + + xkb_foreach_key(key, keymap) { + if (key->name == XKB_ATOM_NONE) + continue; + + write_buf(buf, "\t%-20s = %d;\n", + KeyNameText(keymap->ctx, key->name), key->keycode); + } + + darray_enumerate(idx, led, keymap->leds) + if (led->name != XKB_ATOM_NONE) + write_buf(buf, "\tindicator %d = \"%s\";\n", + idx + 1, xkb_atom_text(keymap->ctx, led->name)); + + + for (unsigned i = 0; i < keymap->num_key_aliases; i++) + write_buf(buf, "\talias %-14s = %s;\n", + KeyNameText(keymap->ctx, keymap->key_aliases[i].alias), + KeyNameText(keymap->ctx, keymap->key_aliases[i].real)); + + write_buf(buf, "};\n\n"); + return true; +} + +static bool +write_types(struct xkb_keymap *keymap, struct buf *buf) +{ + if (keymap->types_section_name) + write_buf(buf, "xkb_types \"%s\" {\n", + keymap->types_section_name); + else + write_buf(buf, "xkb_types {\n"); + + write_vmods(keymap, buf); + + for (unsigned i = 0; i < keymap->num_types; i++) { + const struct xkb_key_type *type = &keymap->types[i]; + + write_buf(buf, "\ttype \"%s\" {\n", + xkb_atom_text(keymap->ctx, type->name)); + + write_buf(buf, "\t\tmodifiers= %s;\n", + ModMaskText(keymap, type->mods.mods)); + + for (unsigned j = 0; j < type->num_entries; j++) { + const char *str; + const struct xkb_key_type_entry *entry = &type->entries[j]; + + /* + * Printing level 1 entries is redundant, it's the default, + * unless there's preserve info. + */ + if (entry->level == 0 && entry->preserve.mods == 0) + continue; + + str = ModMaskText(keymap, entry->mods.mods); + write_buf(buf, "\t\tmap[%s]= Level%d;\n", + str, entry->level + 1); + + if (entry->preserve.mods) + write_buf(buf, "\t\tpreserve[%s]= %s;\n", + str, ModMaskText(keymap, entry->preserve.mods)); + } + + for (xkb_level_index_t n = 0; n < type->num_levels; n++) + if (type->level_names[n]) + write_buf(buf, "\t\tlevel_name[Level%d]= \"%s\";\n", n + 1, + xkb_atom_text(keymap->ctx, type->level_names[n])); + + write_buf(buf, "\t};\n"); + } + + write_buf(buf, "};\n\n"); + return true; +} + +static bool +write_led_map(struct xkb_keymap *keymap, struct buf *buf, + const struct xkb_led *led) +{ + write_buf(buf, "\tindicator \"%s\" {\n", + xkb_atom_text(keymap->ctx, led->name)); + + if (led->which_groups) { + if (led->which_groups != XKB_STATE_LAYOUT_EFFECTIVE) { + write_buf(buf, "\t\twhichGroupState= %s;\n", + LedStateMaskText(keymap->ctx, led->which_groups)); + } + write_buf(buf, "\t\tgroups= 0x%02x;\n", + led->groups); + } + + if (led->which_mods) { + if (led->which_mods != XKB_STATE_MODS_EFFECTIVE) { + write_buf(buf, "\t\twhichModState= %s;\n", + LedStateMaskText(keymap->ctx, led->which_mods)); + } + write_buf(buf, "\t\tmodifiers= %s;\n", + ModMaskText(keymap, led->mods.mods)); + } + + if (led->ctrls) { + write_buf(buf, "\t\tcontrols= %s;\n", + ControlMaskText(keymap->ctx, led->ctrls)); + } + + write_buf(buf, "\t};\n"); + return true; +} + +static bool +write_action(struct xkb_ke |