summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2010-06-15 18:47:37 +0100
committerDaniel Stone <daniel@fooishbar.org>2010-09-20 16:03:58 +1000
commit77cb2bda308b39dc0a8267f18d92e7b4bf178aa1 (patch)
treecb09431667baf24f60d4e38373dde483cb0412f7
parent8e3877aa50f3092c8fdfd916b072720439bc818b (diff)
downloadxorg-lib-libX11-77cb2bda308b39dc0a8267f18d92e7b4bf178aa1.tar.gz
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>
-rw-r--r--src/StrKeysym.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/StrKeysym.c b/src/StrKeysym.c
index fb507458..f502de1e 100644
--- a/src/StrKeysym.c
+++ b/src/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;
}