What this is about...

This blog is about how I spend some of my time with my computers.

Various topics on Computing, Operating Systems, Programming Languages, Computer Games, Internet and Communications

Tuesday, August 3, 2010

Ubuntu and my favourite keyboard IBM SK-8835 (.xmodmap & KEYSYMNAME)

Let me start with this: I'm a trackpoint fan and I only use a touchpad if I absolutely MUST. Given a choice, I would go for the trackpoint , then the mouse, and finally the dreaded touchpad. The reason is that using the pad moves my index fingers away from the typing position. So much for pad gestures...

Anyhow, for quite some time now I have been ordering keyboards from IBM (Ultranavs) in various configurations, from full keyboards with numeric keypads (for my desktops) to space saving versions for some of my old laptops.

My present keyboard model is an old USB IBM Ultranav (an SK-8835 model) which I use with my primary Ubuntu server machine. It’s quite non-standard as far as keyboards go (see picture), so I needed to make some changes to accommodate the various key locations.

Since it’s Ubuntu I am using, I had to find a way to change the keyboard layouts so that the keys match exactly.



After some googling around I found references to the .xmodmap file. After reading some more, I decided that this was the simplest way of doing it so here is what I did:

This file is read by the X software upon login and modifies the keyboard according to the instructions in the file. The instructions consist of lines starting with a keyword: keycode followed by a number (i.e. 18), an equal sign (=) and then a series KEYSYMNAME definitions.

You only need to put in the file the keycodes that need changing.

This is the format:

!Put a comment here

keycode 9 = Escape Escape Escape Escape
keycode 20 = apostrophe question apostrophe degree 


the keycode is a number generated each time a key is pressed. The keycode number can be generated/discovered using the xev command in any terminal window. By opening an editor, anyone can create a list of the keycodes generated by their keyboard. Just press the key, find the number, and record it in the editor file along with some detailed description of the characters on the key. Save the file under a name that describes its function i.e. KeycodesIBMSK8835.

The  KEYSYMNAME definitions can be found in "the header file (without the XK_ prefix) or the keysym database /lib/X11/XKeysymDB, where refers to the root of the X11 install tree. Note that if the same keysym is bound to multiple keys, the expression is executed for each matching keycode." See here for more details.

There is a maximum of 4 KEYSYMNAME definitions for each of my keys, the first two for the GBr (UK) keyboard layout, and two for the Gre (Greek) keyboard layout.

So, here are the contents for my layout:

keycode 49 = backslash bar onehalf plusminus
keycode 10 = 1 exclam 1 exclam
keycode 11 = 2 quotedbl 2 quotedbl
keycode 12 = 3 sterling 3 numbersign
keycode 13 = 4 dollar 4 dollar
keycode 14 = 5 percent 5 percent
keycode 15 = 6 ampersand 6 notsign
keycode 16 = 7 slash 7 slash
keycode 17 = 8 parenleft 8 parenleft
keycode 18 = 9 parenright 9 parenright
keycode 19 = 0 equal 0 equal
keycode 20 = apostrophe question apostrophe degree
keycode 21 = plus asterisk plus asterisk
keycode 34 = bracketleft braceleft bracketleft leftdoublequotemark
keycode 35 = bracketright braceright bracketright rightdoublequotemark
keycode 48 = rightsinglequotemark leftsinglequotemark caret asciitilde
keycode 51 = acute at twosuperior threesuperior
keycode 94 = less greater paragraph copyright
keycode 59 = comma semicolon comma semicolon
keycode 60 = period colon period colon
keycode 61 = minus underscore minus Greek_horizbar

And that did it! When I saved the file under the name .xmodmap, after a logout/login gnome asked me to read the file. I said yes, and now, everykey is at the right place.

Backup/Clonezilla and we are safe!




6 comments:

  1. Hey

    I use the ame keyboard (which is great) with ubuntu 10.10
    but the page scrolling (using the middle button of the trackball) doesn't work...any idea on how to make it work?

    thanks

    ReplyDelete
    Replies
    1. 100Goto100: Ubuntu And My Favourite Keyboard Ibm Sk-8835 (.Xmodmap And Keysymname) >>>>> Download Now

      >>>>> Download Full

      100Goto100: Ubuntu And My Favourite Keyboard Ibm Sk-8835 (.Xmodmap And Keysymname) >>>>> Download LINK

      >>>>> Download Now

      100Goto100: Ubuntu And My Favourite Keyboard Ibm Sk-8835 (.Xmodmap And Keysymname) >>>>> Download Full

      >>>>> Download LINK ow

      Delete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Hello,

    I'm trying to configure the key Fn (first left bottom row, blue letters) to work together with the keys Home and End to get up or down the brightness of the screen .
    My SK-8835 has the latinamerican layout, it means including the key for the letter ñ and other symbols (Home and End appears as Inicio and Fin)
    My laptop is an old T60 squared screen.

    Can you give some advice?

    Best Regards,

    Salvador

    Note: I think I found you in Twitter and send you a message...

    ReplyDelete
  4. mite0punc_ge Colleen Kennedy Here
    stanontugood

    ReplyDelete