diff options
author | Daniel Stone <daniel@fooishbar.org> | 2009-04-25 14:32:04 +1000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2009-04-25 14:56:57 +1000 |
commit | 8e3239a78f7e47321535a4917bddf4ce00d3d244 (patch) | |
tree | a5805f21f06dafddebc50a2f0801176ef408f39f /src/keysym.c | |
parent | a5ce9754dc3c8313e9d35bf86d31d78e8bf9653c (diff) | |
download | xorg-lib-libxkbcommon-8e3239a78f7e47321535a4917bddf4ce00d3d244.tar.gz |
KeySym: Actually handle NoSymbol
Add NoSymbol into the keysym table, so keysym <-> string conversion works for
that, too; also eliminate special-casing of VoidSymbol.
This will require special-casing in libX11 to preserve its API.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'src/keysym.c')
-rw-r--r-- | src/keysym.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/keysym.c b/src/keysym.c index 4738fc2..3bcfd8f 100644 --- a/src/keysym.c +++ b/src/keysym.c @@ -42,13 +42,17 @@ XkbcKeysymToString(KeySym ks) { int i, n, h, idx; const unsigned char *entry; + static char ret[11]; unsigned char val1, val2, val3, val4; - if (!ks || (ks & ((unsigned long) ~0x1fffffff)) != 0) + if ((ks & ((unsigned long) ~0x1fffffff)) != 0) return NULL; - if (ks == XK_VoidSymbol) - ks = 0; + /* Not listed in keysymdef.h for hysterical raisins. */ + if (ks == NoSymbol) { + sprintf(ret, "NoSymbol"); + return ret; + } if (ks <= 0x1fffffff) { val1 = ks >> 24; |