Subject: [E3-hacking] Support status update

From: Janusz Krzysztofik <[email-masked]>
Date: Mon, 2 Aug 2010 20:25:18 +0200

Hi,
With the 2.6.35 released today, we finally have a slightly modified version of 
the old Matt Callow's mailboard serio adapter driver included in the mainline 
kernel.

A small fix for more stable LCD display blanking/unblanking has been 
integrated as well.

Due to the changes requested by Dmitry Torokhov, the input subsystem 
maintainer, who finally accepted the resulting serio code and integrated it 
into his tree, we now need some extra userspace support to get the mailboard 
working as expected. The preferred way is using a relatively new udev extras 
utility called keymap. A proper keymap file still has to be created and 
possibly submitted to the udev maintainer for inclusion.

Still using an older version of udev from the Ansgstrom distribution, I use a 
different utility, called input-kbd, that is a part of input-utils. My udev 
rule that automatically loads a required keys map for me looks like this:

ACTION=="add", KERNEL=="event[0-9]*", \
	ATTRS{phys}=="GPIO/serio0/input[0-9]*", \
	RUN+="/usr/bin/input-kbd -f /etc/mailboard-raw.map %n"

My /etc/mailboard-raw.map is appended below. The top row consists of Esc and 
F1 - F10. Please modify the map to suit your taste.

This keys map is unidimensional, its purpose is to provide the driver with 
correct physical keycaps layout. To get the keyboard producing correct 
characters with shift, ctrl, alt, etc., loadkeys utility with a proper key 
table must be used on top. I have not yet played with it.

It should be possible to use a standard AT or PS/2 keyboard connected to the 
E3 instead of the mailboard (I have not tried, but I succesfully tested the 
opposite, ie. the mailboard connected to a PC). For this, you have to build a 
special adapter (you can use the gamepad cable if you don't play games on 
your E3). Since a standard keyboard needs no keys map modifications, don't 
put the above udev rule in your /etc/udev/rules.d/ if you decide to use it 
instead of the mailboard.  Unfortunately, it's not possible for the udev to 
distinguish whether the mailboard or a standard keyboard is connected (they 
respond exactly the same), so it's not possible to switch from one to another 
without manually loading/unloading the mailboard specific keymap.

Happy typing.
Janusz

my /etc/mailboard-raw.map:
---
112 = KEY_ESC
122 = KEY_F1
 70 = KEY_F2
124 = KEY_F3
119 = KEY_F4
114 = KEY_F5
105 = KEY_F6
 26 = KEY_F7
 42 = KEY_F8
 28 = KEY_F9
 21 = KEY_F10
113 = KEY_TAB
116 = KEY_1
115 = KEY_2
107 = KEY_3
 34 = KEY_4
 27 = KEY_5
 29 = KEY_6
 30 = KEY_7
121 = KEY_8
125 = KEY_9
117 = KEY_0
108 = KEY_BACKSPACE
 33 = KEY_Q
 35 = KEY_W
 36 = KEY_E
 38 = KEY_R
 82 = KEY_T
 93 = KEY_Y
 13 = KEY_U
 14 = KEY_I
 50 = KEY_O
 52 = KEY_P
 44 = KEY_ENTER
 49 = KEY_A
 51 = KEY_S
 53 = KEY_D
 54 = KEY_F
 41 = KEY_G
 91 = KEY_H
  3 = KEY_J
118 = KEY_K
 58 = KEY_L
 59 = KEY_APOSTROPHE
 60 = KEY_LEFTSHIFT
 61 = KEY_Z
 78 = KEY_X
 84 = KEY_C
 11 = KEY_V
  5 = KEY_B
 65 = KEY_N
 66 = KEY_M
 67 = KEY_DOT
 62 = KEY_UP
 85 = KEY_RIGHTSHIFT
259 = KEY_LEFTCTRL
  6 = KEY_LEFTALT
 73 = KEY_RIGHTMETA
 75 = KEY_SPACE
 68 = KEY_COMMA
 22 = KEY_LEFT
 46 = KEY_DOWN
  9 = KEY_RIGHT