summaryrefslogtreecommitdiff
path: root/src/text.h
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-09-27 18:49:13 +0200
committerRan Benita <ran234@gmail.com>2012-09-27 21:12:08 +0200
commit3b389b15bfaa33874ee6a2c308241984c8727faa (patch)
tree8302997228575ce60ba9bcfccfc710961a9f7444 /src/text.h
parent53cfe8c36211fe3d1fb7576d2c9498f7f67ea6af (diff)
downloadxorg-lib-libxkbcommon-3b389b15bfaa33874ee6a2c308241984c8727faa.tar.gz
Don't limit key names to 4 characters
Currently you can't give a key in xkb_keycodes a name of more than XKB_KEY_NAME_LENGTH (= 4) chars. This is a pretty annoying and arbitrary limitation; it leads to names such as <RTSH>, <COMP>, <PRSC>, <KPAD> etc. which may be hard to decipher, and makes it impossible to give more standard names (e.g. from linux/input.h) to keycodes. The purpose of this, as far as I can tell, was to save memory and to allow encoding a key name directly to a 32 bit value (unsigned long it was). We remove this limitation by just storing the names as atoms; this lifts the limit, allows for easy comparison like the unsigned long thing, and doesn't use more memory than previous solution. It also relieves us from doing all of the annoying conversions to/from long. This has a large diffstat only because KeyNameText, which is used a lot, now needs to take the context in order to resolve the atom. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/text.h')
-rw-r--r--src/text.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/text.h b/src/text.h
index 56d2ec9..e38ed20 100644
--- a/src/text.h
+++ b/src/text.h
@@ -69,7 +69,7 @@ const char *
KeysymText(xkb_keysym_t sym);
const char *
-KeyNameText(const char name[XKB_KEY_NAME_LENGTH]);
+KeyNameText(struct xkb_context *ctx, xkb_atom_t name);
const char *
SIMatchText(unsigned type);