Using a german keyboard most of the time I have to press <Shift><7> to get a slash. Working in Unix this is not really convenient so I created an suitable .Xmodmap ages ago.
This worked rock solid until evdev was rolled out (e.g. in Hardy Heron if I remember correctly).
From that point of time my settings in .Xmodmap were gone after a Supend / Resume of my laptop.
As usual with Google’s help it turned out, that I was not the only one with this issue. But I could not find a solution.
Finally I changed the systemwide configuration file /usr/share/X11/xkb/symbols/de.
In the section xkb_symbols “basic” I changed the keys AB08 and AB09
key <AB08> { [ comma, semicolon, slash, multiply ] };
key <AB09> { [ period, colon, slash, division ] };
(On my current laptop keyboard AB08 is the best choice, but on a standard keybord its AB09, so I changed both).
For the sake of completeness: The files in /usr/share/X11/xkb/keycodes map keycodes to symbolic keynames. In my case the file evdev contains:
xkb_keycodes "basic" {
...
<AB08> = 59;
<AB09> = 60;
...
};
You may call the binary xev to get the keycode of any key (among other information).
Now on to another configuration task. I use my laptop frequently with a standard PS/2 keyboard, connected to the laptop via a little electronic device which connects to the laptop via USB. lsusb gives me:
Bus 006 Device 002: ID 074e:0001 Digital Stream Corp. PS/2 Adapter
For reasons completely unknown to me the key “less greater bar” (German keyboard, left to y, would normally be keycode 94) is completely dead (LEDs on the PS/2 Adapter do not even flash when pressing this key). Maybe this device was designed for US keyboards in mind, were no such key exists … In my old .Xmodmap I used the left Windows key (keycode 133) to replace the dead one.
Unfortunately keycode 133 is bound to the key , which is a modifier key in karmic. Run xmodmap -pm to check. I reconfigured the key to emit “less” and “”greater”, but pressing <LWIN> + <AltGr> I never got “bar”.
Finally I changed /usr/share/X11/xkb/keycodes/evdev to read:
// Microsoft keyboard extra keys
// <LWIN> = 133;
<AE13> = 133;
...
//// <AE13> = 132; // Yen
Again in file /usr/share/X11/xkb/symbols/de I added:
default
xkb_symbols "basic" {
...
key <AE13> { [ less, greater, bar ] };
...
};
This configuration works as fine as my old .Xmodmap did also after a Suspend + Resume. Unfortunately it took me quite some time to get this working. From a user’s perspective this stuff is not really well documented. Of course my changes will be eventually overwritten by an update.
If somebody knows how to make my changes on a per user basis, please share.