mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-07 21:28:04 +02:00
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>
This commit is contained in:
parent
8c2ffce9e5
commit
ebd6ef0a4d
1 changed files with 13 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue