I’m a language fetishist. This means that I need to write in different languages from time to time. With Norwegian, Spanish, and English, writing is painless, because I have everything I need at my fingertips. Most keyboards have diacritics (usually é, è, ë, ê, ẽ).
When I started writing in French on a computer, I discovered that I lacked ç and œ, but I substituted them with c and æ (found on Norwegian keyboards by default). I lacked even more characters when I started to learn Old Norse – þ, ð, and ǫ, as well. The ǫ wasn’t even in the character map in Windows, so I had to substitute with the modern Icelandic ö, or copy-paste from Wikipedia. Sure, I could change to the Icelandic keyboard, but that was a pain in the ass – especially since Windows thought changing them randomly was fun.
A couple of years later, when I got into Linux, my problems were suddenly gone. Now I have every single character I need (and a lot that I don’t need yet) on the same keyboard. For example, I have œ, đ, ḷ, ṁ, ǫ, š, ı, ō, ŋ, ů… You name it. No need to copy anything. The reason for this is that Odin taught me how to use Xmodmap. After that, I figured out the rest myself. This might work on a Mac as well, but not in Windows.
The Compose Key (Method 1)
The first way to easily make your keyboard a sexy, lean, mean character machine is to go to System => Preferences => Keyboard (I’m using Ubuntu 8.10). Go to Layout, and click the “Other Options” button. Find “Compose key position” and choose one – for example the useless Win-key. (The screen shots are – mostly – in Norwegian, sorry.)
(Picture lost.)
The Compose Key (Method 2 – Recommended)
The second (and recommended) way to go about it is to implement the Compose Key directly into you .Xmodmap file. Press alt + f2 and enter:
gedit .Xmodmap
Your .Xmodmap file is probably empty, but we’ll fix that. Let’s say you want to assign the Compose Key to the Left Win-key. To do that, you need to know its keycode number. Open a terminal, and enter:
xmodmap -pke
You’ll now see a long list of keycode numbers. The Left Win-key is called “Super_L”. You should see something like:
keycode 133 = Super_L NoSymbol Super_L NoSymbol Super_L
You can see that in my case, the Left Win-key has the keycode 133. In your .Xmodmap file, enter this:
keycode 133 = Multi_key Multi_key Multi_key Multi_key Multi_key Multi_key
(You can probably just write “Multi_key” once, but I want it to be the same key no matter what other buttons are being pressed.) Save the file, then go to the terminal and enter:
xmodmap .Xmodmap
Now you can test the Compose Key by pressing it and entering a combination of characters. For example, try combining o + e = œ.
More Characters:
If you want more characters, the same rules apply as the second method for adding the Compose Key, but with other names for the buttons – for example:
(Picture lost.)
dead_ogonek (ǫ), dead_macron (ā), dead_breve (ĕ), dead_caron (š), dead_cedilla (ç)*, eng (Ŋ/ŋ), dead_belowdot (ṇ), dead_abovedot (ṅ), clear lock (removes caps lock – recommended!).
* The character ç is available by default (at least on my Norwegian Dvorak keyboard), but not as a capital letter. There is also a (hidden) dead_cedilla, but you might find it more convenient to simply use the Compose Key => , + c. With a dead_cedilla, you can combine it with more characters, however: ģ, ç, ŗ, ļ, ḑ, ḩ, ţ, ņ, ş, ķ.
Remember that a lot of other characters are standard in Linux (at least Ubuntu 8.10), like alt gr + D = Ð/ð, alt gr + P = Þ/þ, alt gr + S = ß, alt gr + Y = ¥, and so on. Have fun taking control over your keyboard, just remember to enter xmodmap .Xmodmap to reload the keymap.