Don't limit key names to 4 characters
authorRan Benita <ran234@gmail.com>
Thu, 27 Sep 2012 16:49:13 +0000 (18:49 +0200)
committerRan Benita <ran234@gmail.com>
Thu, 27 Sep 2012 19:12:08 +0000 (21:12 +0200)
commit3b389b15bfaa33874ee6a2c308241984c8727faa
tree8302997228575ce60ba9bcfccfc710961a9f7444
parent53cfe8c36211fe3d1fb7576d2c9498f7f67ea6af
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>
12 files changed:
src/keymap-dump.c
src/keymap.h
src/text.c
src/text.h
src/xkbcomp/ast-build.c
src/xkbcomp/ast-build.h
src/xkbcomp/ast.h
src/xkbcomp/keycodes.c
src/xkbcomp/keycodes.h
src/xkbcomp/parser.y
src/xkbcomp/scanner.l
src/xkbcomp/symbols.c