Document Home

Valid HTML 4.01 Transitional

Nokia N810 and 770 Internet Tablets
Input Methods

James F. Carter <jimc@math.ucla.edu>, 2006-03-24, updated 2008-03-15

en_GK: The Geek Keyboard

The layout of punctuation glyphs on the en_US (US English) keyboard seems to change with every version of Maemo. The one with Maemo-2.0 is very unfriendly to geeks: the punctuation most used when entering shell commands (hyphen, dollar sign, asterisk and double quote) is all shifted, and some important keys (pipe, grave accent and braces) are relegated to the symbol page. Therefore I resolved to create my own custom keyboard. My initial plan (not actually realized) was to call it English (Geek) with a locale symbol of en_GK.

The first job was to locate the keyboard configuration files: they turned up in /usr/share/keyboards. Now, what is the file's format? Reverse engineering the keyboard configuration file turned out to be harder than expected. However, I prodced this PERL script which can read and dump any of the keyboard files including latin.special.vkb, the symbol pages.

In the national language VKB files there are six keyboards: normal unshifted, normal shifted, and four pages of thumb keyboards. In each one the keys are listed by rows, in (mostly) units of 5 octets each:

  1. Format variant, normally 0, or 1 for the one weird key.
  2. Category code: bits indicate alphabetic, decimal, hex, accent, or two kinds of punctuation.
  3. Length in octets for the following string. Usually 1, could be 0 (on empty keys) or greater than 1 (for super-ASCII Unicode).
  4. The keysym as a UTF-8 (Unicode) string. (Or multiple such strings on the weird key.)
  5. Key shape indicator.
There are 32 punctuation characters, but 30 keys to put them on: 8 in each alphabetic keyboard, 2 in the unshifted numeric area, and 12 in the shifted numeric area. I omitted two keysyms that geeks are less likely to use: ^ and %. They can be found on the symbol page. If your national currency symbol is not the dollar sign, e.g. is the Euro, you will want to pick another one to displace in its favor. Then I distributed the keysyms among the various keys in a pattern that I thought would be more geek-friendly. Very important: when moving the keysyms, also move the category codes. Here is the keyboard layout, before and after the change:
en_US Unshifted
q w e r t y u i o p @ 1 2 3
a s d f g h j k l ; ' ! 4 5 6
z x c v b n m , . / ? 7 8 9
+ 0 =
en_US Shifted
Q W E R T Y U I O P ^ # £ ¥
A S D F G H J K L : " ] $ %
Z X C V B N M < > \ [ & ( )
~ * -
en_GK Unshifted
q w e r t y u i o p ! 1 2 3
a s d f g h j k l ; " : 4 5 6
z x c v b n m , . / $ 7 8 9
- 0 =
en_GK Shifted
Q W E R T Y U I O P ? # { }
A S D F G H J K L @ ' ~ | [ ]
Z X C V B N M < > \ * & ( )
+ ` _

I planned to change the text description, the locale codes in the file, and the filename (to en_GK.vkb), but even after a reboot the control panel applet for text input would only list the file as en_GK, refusing to show the text description, and I could not select the new keyboard. With the locale and filename as en_US but the text description changed, the applet got it right but the input method did not show any keys. With the text description reverted to English (USA), then it worked properly. Very strange. I did hack the length byte of the text description to show the actual length. I did all the work using a SSH session, so when the input method weirded out I was able to restore the saved original keyboard file.

Here is the Geek Keyboard. To use it, cd /usr/share/keyboards and rename en_US.vkb to some other name (for easy reversion). Then copy my file to become en_US.vkb. You could also use the dumper script and a hex editor (I used hexedit-0.9.7 on my laptop) to improve the keyboard file for your proper language. Hint: in the likely case that Unicode strings are changed in length, do them starting from the end of the file, so file offsets in the dump are not invalidated.

Here's a future research project: if we didn't use 1.5x wide keys at the ends of the first and third alphabetic rows, we could get two more keys onto each of two keyboards. Would the input method accept this?

Handwriting Training

This whole thing is on hold until I can figure out how to remove pattern glyphs that conflict with what I want to use, and mistakes in entering glyphs.

Several reviewers said they disliked the handwriting input method; I'm going to make my own judgment. Sphinx of black quartz judge my vow. Seven wildly panting fruit flies gazed anxiously at the juicy bouncing kumquat. OK, I got the texts to go in.

This is a partnership between you and the Artificial Intelligence, and definitely you need to have thought seriously about the technical and programming issues of handwriting recognition to be able to do your part of the teamwork. It's going to take practice to get fast and accurate, but I know that Palm users do this regularly and I'm going to keep trying. After a few days of experience I can send handwriting with an error rate and speed similar to using the keyboard. (Except, passwords are a problem because you can't be sure what's typed.) Here are a few hints:

Decide on decent and consistent glyphs. a = alpha, b = beta, d = backward 6, f = (conventional), g = gamma (cross with loop below), q = o backslash, t = upper left corner, x = gamma upside down (cross with loop above), digit 1 = line bottom to top, I = line top to bottom.

Sorted by shape:

Cross with loop:
Corners:

How to detect changed files:

    echo "whatever" > /tmp/timestamp.txt
    (do the activity that changes files)
    find / -xdev -type f -newer /tmp/timestamp.txt -print
    

I taught it one shape: upside down lower case gamma for lower case a. This resulted in changes to the following files:


Document Home