(Modified 2013 Apr 23)
Keyboard mapping
using xmodmap
I have a Czech keyboard, which has various special characters, such as accents over the vowels, or hačeks over some consonants. None on the Czech keyboard layouts in the Ubuntu installation (12.10) corresponded to my kayboard, so I modified the keyboard settings using xmodmap, according to instructions at Black Eternal and Steve Engledow's blog.
Steps in brief:
Export current mappings by typing:
xmodmap -pke > ~/.xmodmap
Open .xmodmap in a text editor
Each key has a line corresponding to the keycode. If you're not sure which key a given keycode refers to, type:
xev
which opens an window which reports events back to the console window. The xev command writes a lot of information to the screen, so an alternative is to search the output for the word keycode by typing:
xev | grep keycode
For each keycode, there is some number of modified mapped keys. The first entry correspond to the unmodified keystroke, e.g., a lowercase character. The second entry corresponds to the keystroke plus SHIFT. The fifth entry corresponds to the keystroke plus AltGr, present on my Czech keyboard.
Edit the entries with the name of the characters that you would like. If you're not sure about the name of the character, search for it elsewhere in the document (perhaps in the unedited version), or on Google.
Load the map file by typing (it'll take a couple seconds):
xmodmap ~/.xmodmap
(TO DO) Have the session manager execute this command on startup.
This page is Lynx-enhanced