It was time for a better keyboard because the one I plugged to my Lenovo 3000 N100 laptop was an IBM keyboard with a very strange layout, putting the PgDn, PgUp, Home, End and Ins keys in very strange places. The situation was no more bearable. Going around the university halls I met a Sun Type 6 keyboard who was sitting silently on a desk, nobody making use of it, so I genlty borrowed this little treasure.
The feel of the keys are not bad and the layout is very close to what I may call standard PC keyboard layout. However, this one being from Sun Microsystems had some extra keys. That would not bother me had Sun not decided to make the Alt keys smaller and place it to the on the left of left Super key and right of right Super key. Those Super keys (with black diamond shapes on them) were a great annoyance for a person who used Emacs, thus Alt keys very frequently. I needed a solution to be able to use those big and comfortable keys as Alt, or, to use the correct Emacs terminology, Meta keys.
The solution for Ubuntu GNU/Linux was xmodmap and a suitable .xmodmap configuration file:
! Swap Caps_Lock and Control_L
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
! make the Super_L and Super_R as the Alt keys
! on the Sun Microsystems keyboard
keycode 115 = Alt_L
keycode 116 = Alt_R
And in order to automate things I placed the following lines in my ~/.bash_profile file:
which completed the operation. Now I have a nice Sun keyboard whose Super keys are mapped to Alt. The Ctrl – Caps Lock swapping functionality comes as a bonus with that configuration (it seems to be so frequently done that the man page includes an example showing how to do it! ;-))
PS: I have used the xev utility to learn the keycodes of those Super keys.