The first thing that I did when I needed to access the Internet through one of the PCs in the PC Pool of RWTH Aachen is to transform the German keyboard to an English keyboard. This is usually the first thing that people do when they are faced with foreign keyboards that their fingers are not accustomed to. The operating system used in each of the PCs in the PC Pool is GNU/Linux Debian 4.0.
I went straight to Desktop -> Preferences -> Keyboard. Under tab Layouts, I added "U.S. English Alternative international (former us_intl)" and deleted "Germany Eliminate dead keys". With this, whenever I press "z", "y" is output, and vice versa. This is exactly what I want since "z" and "y" are put the other way around in a German keyboard. However, I didn't get a grave sign (`) when I pressed the button that in a U.S. keyboard should output the grave sign. Moreover, I couldn't make the right ALT button work as the left ALT button, which is pretty useful when working in a BASH console in which I can press ALT + b to go back one word. So, I googled for the way to map the German keyboard to an English (U.S.) keyboard without being the root user.
It turned out that the information was not easily available since I had to change the keywords three times. At the end I found a good page: http://cweiske.de/howto/xmodmap/allinone.html. Following the instruction, I dumped the current map. After that, I modified the value of `keycode 113' to `Alt_R'. But, the BASH feature of being able to move the cursor back one word with `ALT + b' still didn't work. Reading the man page of xmodmap, I decided to clear `mod5' of xmodmap. After this, `ALT + b' works in the BASH console.
Next, I found out that the grave sign can only be output after pressing the button twice. Beside that, I couldn't output a usual apostrophe (') with the usual button found in a U.S. keyboard. Pressing the button twice will output a closing quote. But, pressing the button after pressing a Super button output an apostrophe. Looking at the content of the dumped map, I found out that the usual grave sign, tilde, apostrophe and double quote was not put as the first or second value of the corresponding keycode (e.g., "keycode 48 = dead_acute dead_diaeresis apostrophe quotedbl apostrophe quotedbl" instead of "keycode 48 = apostrophe quotedbl"). So, I changed the value accordingly, and that solved the problem.
Finally, the German keyboard has an additional button just to the left of the button where I usually find the "z" button in a U.S. keyboard. In a U.S. keyboard, this button doesn't exist, and its place is occupied with a long Shift button. Since my left little finger is accustomed to pressing Shift button at that position, I make that button act as a Left Shift button by modifying the value of `keycode 94' to `Shift_L'. But, it didn't work until I added the button to the shift modifier of xmodmap: xmodmap -e "add shift = Shift_L". This solved everything within an hour (what a long time!)
To conclude, the steps needed to map the German keyboard to a U.S. keyboard in one of the PCs running GNU/Linux Debian 4.0 in RWTH Aachen PC Pool is as follows:
1. Download the file attached in this article and save it to your home directory as `.Xmodmap' (don't forget the dot before Xmodmap).
2. Logout and login back again.
| Attachment | Size |
|---|---|
| map.txt | 5.25 KB |