aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2010-06-15 18:47:37 +0100
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:24 +0200
commitf0b87f3de6261a4b95e6a68aa0a24b35b5278e56 (patch)
treed45a9238dd538d25057fd73ffa239792fb994f0f
parent6c303d9e4ffd162b8c7f59a4b135e592d923a656 (diff)
downloadnx-libs-f0b87f3de6261a4b95e6a68aa0a24b35b5278e56.tar.gz
nx-libs-f0b87f3de6261a4b95e6a68aa0a24b35b5278e56.tar.bz2
nx-libs-f0b87f3de6261a4b95e6a68aa0a24b35b5278e56.zip
XStringToKeysym: Special case for XF86 keysyms
Some XFree86 keysyms were in XKeysymDB as XF86_foo, despite really being XF86foo. So, if we get to the bottom of XStringToKeysym and haven't found our XF86_foo, try it again as XF86foo. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
-rw-r--r--nx-X11/lib/X11/StrKeysym.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/nx-X11/lib/X11/StrKeysym.c b/nx-X11/lib/X11/StrKeysym.c
index 9bdc80d32..98629ed18 100644
--- a/nx-X11/lib/X11/StrKeysym.c
+++ b/nx-X11/lib/X11/StrKeysym.c
@@ -152,5 +152,18 @@ XStringToKeysym(_Xconst char *s)
return val;
return val | 0x01000000;
}
+
+ /* 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) {
+ KeySym ret;
+ char *tmp = strdup(s);
+ memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1);
+ ret = XStringToKeysym(tmp);
+ free(tmp);
+ return ret;
+ }
+
return NoSymbol;
}