Enable UNUMBERs in compose definitions
authorMichael Schutte <michi@uiae.at>
Fri, 24 Jul 2009 10:28:27 +0000 (12:28 +0200)
committerAlexey Gladkov <gladkov.alexey@gmail.com>
Thu, 30 Jul 2009 14:19:06 +0000 (18:19 +0400)
As always, auto-conversion applies in case of XLATE mode (or no
KDSKBDIACRUC support).

Since 18eadfe…, loadkeys supports the composition of two Unicode keysyms
to another Unicode keysym.  Whereas the resulting char could already be
specified as U+…, diacr and base had to be given as 8-bit characters,
which is ugly with today’s Unicode support.  Since it isn’t realistic to
make keymaps capable of UTF-8, I was asked by a Debian developer to at
least make it possible to specify Unicode codepoints.  rvalue is
unsuitable at this point (because it does some trickery with KT_LATIN
vs. KT_LETTER which is not applicable here), I decided to add this to a
new expression just for compose.

Signed-off-by: Michael Schutte <michi@uiae.at>
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
src/loadkeys.y

index c58aa03..6beba09 100644 (file)
@@ -169,15 +169,20 @@ strline           : STRING LITERAL EQUALS STRLITERAL EOL
                            addfunc(kbs_buf);
                        }
                ;
-compline        : COMPOSE CCHAR CCHAR TO CCHAR EOL
+compline        : COMPOSE compsym compsym TO compsym EOL
                         {
                            compose($2, $3, $5);
                        }
-                | COMPOSE CCHAR CCHAR TO rvalue EOL
+                | COMPOSE compsym compsym TO rvalue EOL
                        {
                            compose($2, $3, $5);
                        }
                 ;
+compsym                : CCHAR
+                       { $$ = $1; }
+               | UNUMBER
+                       { $$ = $1 ^ 0xf000; }
+               ;
 singleline     :       { mod = 0; }
                  modifiers KEYCODE NUMBER EQUALS rvalue EOL
                        {