Adding Pipe and Tab to the N810 Keyboard

I’ve been poking around with remapping the keys on the N810 keyboard and got xmodmap working this morning. I didn’t think it was available for OS2008, but you can snag the xmodmap binary for OS2008 from here. I used some of the information on the page about using a Bluetooth keyboard with older Maemo releases, but also just read some general hints about how to use xmodmap and where to find info about keysyms.

I started out just testing the modifications I wanted from the command line in xterm. You can use a command like the following to test out a mapping before adding it to any config files:

xmodmap -e ‘keysym m = m M bar bar bar’

My targets for remapping were the euro and pound signs (Fn-M and Fn-; on the built in keyboard). I live in the United States, and as everyone knows one of our favorite pastimes when not destroying other countries during religious crusades is to ignore them completely. So the chances of me needing to use those symbols is pretty low unless I suddenly decide to write some kind of political satire. What I wanted there were the tab character and the pipe character. Essential to sanity when doing a lot of command line stuff, which I do. So I ended up with this .xmodmap file:

keysym m = m M bar bar bar
keysym semicolon = semicolon colon Tab Tab Tab

Fantastic! Now I can run ‘xmodmap /home/user/.xmodmap’ and get the remapped keys I want. I had seen mentions on some of the discussion boards about the keymappings getting reset with every keypress or something. I’m not seeing that on my relatively recent OS2008 install (1.2007.42-19). Once I set the mappings they stay around till I reboot. What I can’t figure out how to do however is to run xmodmap automatically at startup and have it work. I tried adding it to a bunch of different places in startup files, but the remappings weren’t active for some reason. So I just created a nice short script I can run from xterm, which is mostly when I want to enact these mappings anyway. Good enough for now. Still, would be really slick to just have them working, is there a thread out there with a working example for .19? I didn’t run across one in my wanderings.

This entry was posted in Maemo, Open Source. Bookmark the permalink.

12 Responses to Adding Pipe and Tab to the N810 Keyboard

  1. Niki says:

    Works fine on my N810, thanks.

  2. considering you are going to need two keystrokes to get {tab} in this way, why not just hit Ctrl+i, which is tab anyway ?

  3. miker says:

    Because the control key and the i key are on the same side of the keyboard. The function key and the m and semicolon keys are on different sides, it’s just a much easier combo to type.

  4. tajuma says:

    My brute force solution to this has been to edit directly file /usr/share/X11/xkb/symbols/nokia_vndr/rx-44.

    One very useful change, IMHO, is to map the front cover ‘back’ button to ‘post menu’ which makes it a lot easier to use (e.g. with Maemo mapper) with lid closed:

    key { type=”EIGHT_LEVEL”, [ F4, Escape, Escape, Escape, Escape, Escape, Escape, Escape ] };

    Other changes I have made are Fn-Backspace => ESC, Fn-Space => Tab and Chr => Left Control:

    key { type=”EIGHT_LEVEL”, [ BackSpace, BackSpace, Escape, BackSpace, BackSpace, BackSpace, BackSpace, BackSpace ] };

    key { type=”EIGHT_LEVEL”, [ space, space, Tab, space, space, space, space, space ] };

    key { type=”EIGHT_LEVEL”, [ Control_L, Control_L, Control_L, Multi_key, Multi_key, Multi_key, Multi_key, Multi_key ] };
    modifier_map Control { Control_L, Control_R };

    And finally to allow your application to receive Ctrl-E (which is otherwise global search):

    gconftool-2 –set -t string /apps/osso/keybindings/global/osso-global-search ”

  5. daniels says:

    Editing the XKB layout is hardly the ‘brute-force’ approach: xmodmap is an ugly hack, whereas editing the layout is definitely the best option. You can make completely arbitrary customisations there.

    -daniels, Maemo X maintainer

  6. MichaelA says:

    I don’t know if my problem is related, but I figured I’d give it a shot. Apologies if I’m shooting in the dark here…

    I recently updated my n810 to 2.2007.50-2 the other day, and every since I’ve lost the function of some keys on the hardware keyboard. The Fn key no longer works, so I can’t select the blue characters, Chr doesn’t work either (no character menu comes up on the screen), and I’m pretty sure Ctrl isn’t working too (although in truth I never really used it before the update.)

    Is this something I can fix by editing a file? I took a look at my rx-44 file as mentioned above, and it looks fairly sane. Any help is appreciated!

  7. Sean Luke says:

    Interesting, I have a similar page with lots of resources for OS2007 here:

    I’m upgrading to OS2008, so expect this page to update accordingly.

  8. moa says:

    The easiest way to add a “|” (pipe) to your keyboard layout is editing the rx-44 file as mentioned above (/usr/share/X11/xkb/symbols/nokia_vndr/rx-44).

    tajuma is right, but doesn’t explain it very well. All you have to do is replace “EuroSign” with “bar”.

    key { [ m, M, EuroSign, EuroSign ] };

    After Editing:
    key { [ m, M, bar, bar ] };

    Give your n810 a hard reset and you should have a pipe with Fn-m.

  9. geoff says:

    Great tip. Now changed and expanded on my N810 to put ‘Pipe’ on the Yen spot and add braceleft and braceright as FN-M and FN-;

    Two questions for anyone…How can we create an actual DELETE key with a FN-BKSP (or BackSpace…) Nothing I have tried is accepted by xmodmap

    And how do we actually access the fourth colum in the mapping? We have, for example: m M bar bar bar….but what if we wanted: m M bar bracketleft

    Anyone know how that is accessed? I cannot find any key combos which work.

  10. Pingback: Mike Rowehl: This is Mobility » Blog Archive » Swapped Keyboard Mapping Techniques on the N810

  11. LoCusF says:

    In which part do I add the key { … } as tajuna mentioned in his post?

  12. miker says:

    I changed the last two for the changes I made.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">