-   Linux - General (
-   -   Creating new compose and dead-key combinations (

DavidMcCann 10-10-2007 11:28 AM

Creating new compose and dead-key combinations
Although one can alter the effect of AltGr by editing the keyboard file, there doesn't seem to be any way to alter the key combinations used by the Compose key. Thus Compose + "th" for "" is built in, but you can't add Compose + "dh" for "".

Also, the dead keys generated with AltGr can only be used in built-in combinations. AltGr + ";" will give dead_acute, but there is a limit to what you can type next: "s" for Polish is fine, but "k" for transliterated Macedonian is out.

One website suggests using a file ~/.XCompose for new defintions, but it doesn't work for me. Another suggests using "loadkeys", but that won't affect X.

I suspect that only altering the kernel will do the job, and I'm not opening that can of worms. Is there a simple solution I've just missed?

Su-Shee 10-10-2007 12:00 PM

It's not an exact answer, but it maybe helps.

I tried to tweak a kind-of "what's the most common foreign language in Berlin keymap" and it worked surpringly nice. (I added a specific l from Poland and the turkish i without a dot, for example.)

If you want, you can also change your "Multi_key" ( xmodmap -e "keycode 109=Multi_key" would be right Ctrl instead of AltGr) to something different.

I took my


and added

key <AD08> { [ i, I, rightarrow, idotless ] };

instead of

key <AD08> { [ i, I, idotless, rightarrow ] };

to gain the turkish i with AltGr-i. The best thing is: you can add Unicode codepoints - instead of idotless U0131.

I just add all mappings I did with compose keys to key combinations of the third (AltGr) or even fourth order (forgot which modifier key this is) in the keymap file and use them with AltGr. (I probably would map thorn on AltGr t, for example.)

But I usally use Unicode code points with Ctrl-Shift-u<codepoint> instead.

DavidMcCann 10-12-2007 11:20 AM

Character composition
I've done most of the things you mention: they're just the sort of flexibilty that makes me use Linux!

The point I was making is that they have their limit. Suppose you're writing about Arabs and keep needing to enter names with ṣ &c in them. You may not have room to put the characters on the keyboard. You can't define a dead key, activated with AltGr or Compose, because the characters are not in the predefined set. You can decompose and use AltGr to get a combining underdot: that works in this case, but combining diacritics are often misplaced unless you have a very sophisticated font.

The answer is to put the difficult characters on a Gnome palatte, but I just hate the idea that there's something I can't do the way I want to perfectionist or bloody-minded?

Su-Shee 10-13-2007 05:01 AM

No, rightly so.

I'm a political scientist, I see immediately why someone would like to type arabic on a latin keyboard.

I use the compose key solution only for a handful of specific letters which are not part of latin1 or not on my keyboard - turkish i dotless, polish l, french accents - stuff like that.

If it comes to a single character or maybe two in chinese or japanese, I use Unicode code point intput with Ctrl-Shift-u.

Everything which somehow resembles an entire "word", I start scim for with a real input translation. First it seems a bit inconvenient, but one gets used to it.

The only language I'm thinking of connecting an entire different keyboard is for russian.

Or back to pen and ink. :)

All times are GMT -5. The time now is 04:59 AM.