MoLUX: Keyboard mode

Hello forum,

I'd like to change MoLUX's keyboard mode so that every key resembles a single character, _not_ emulating a mobile phone's keyboard.

I'm working with nano-X, and its scancode->character mapping, and the mouse emulation, are disturbing my input routines also. I'm aware that this adds another level of complexity.

Currently, the left soft key, the shift/# key, and the 5 keys used for mouse emulation don't generate keyboard events at all. I don't want to use a "mouse", but have these keys as "cursor keys".

linuxguide.pdf (section 9. The input driver) does not clearly state how to switch the keyboard to have no modifiers at all.

I suppose, if I don't define any modifier keys, and map the 0-9 keys to the scancodes for "0".."9", the arrow keys to the cursor key scancodes, the soft keys to, e.g. 'A' and 'B', then nano-X's key mapping should not disturb any more.

Anyone who can assist me?
Thanks in advance,

Re: MoLUX: Keyboard mode

Most of your problem should be resolved when you install the current kernel image for MoLUX. The default keymap in this release has almost no modifiers in it. Only two key still have them: the '#' is mapped with SHIFT+3 and the top left key, which switches between this default layout and the one using the mouse and phone emulation. If you do not like the mapping of these two keys, just modify them with the API as described in the Linux guide or change the keymap directly in the kernel sources. You find it in the file arch/arm/mach-at91/board-panelcard.c. Look for portuxinput_matrixmap.

As a side note: Additionally to the description in chapter 9 of the Linux guide, there is a API reference in section 11.5. And your right, leaving out the modifier (flags = 0) should do, what you want.

Re: MoLUX: Keyboard mode

Thank you, defining an own keymap with no modifiers at all did indeed help a bit.

My second problem is the constant repeating of the keys, regardless if the flag PORTUXINPUT_MASK_REPEAT is set or not.

I get for each key repeatedly key down and key up events, instead of repeated key down events and a single key up event, when the key is released.

Is there a possibility to change this behaviour?

Edit: I can see that [linux src]/drivers/input/keyboard/at91-matrix.c cares for pressed and released keys and generates the appropriate events, so the information about "really" released keys must be lost at a more upper level of keyboard processing.

Re: MoLUX: Keyboard mode


having tried a bit more, I found that /dev/tty0 in medium-raw mode itself delivers a press and a release (+80h) scancode consecutively, when a key is pressed. This sequence (x, x+80h) is then repeated, as long the key is held down. I reckon this is caused by an old keyboard driver, as the driver source I examined (see above) should behave correctly.

I have not replaced a new kernel image so far; which one should I use (images-2.6.22-taskit3.tgz from the download page here?) and how do I install it on MoLUX, where I cannot access the bootloader, because I don't have serial access?

Re: MoLUX: Keyboard mode

Yes, images-2.6.22-taskit3.tgz are the current images. Unfortunately your key repeating problem has to do with a little workaround that should have already been removed. It is contained in the file drivers/input/misc/portuxinput/portuxmatrix.c, the ifdef including the code in function matrixhandler has to be removed to make the flag PORTUXINPUT_MASK_REPEAT work. But you will still get press and release events at once. Therefore to disable the false behaviour, download, remove the mentioned lines and recompile the kernel.

To flash the image, you don't have to have access to the bootloader. You can flash the image from linux with the following command:
flashcp imagename /dev/mtd1

Re: MoLUX: Keyboard mode

Even following your advice hasn't cured the problem. There are still uncontrollable key repeats, even when a key is pressed as short as possible.
I currently help myself with a timeout in the nano-X keyboard driver that blocks further upcoming key-press-codes from the same key, but this of course can't be the silver bullet.

On the phone, Mr Ehrlich told me that this problem really arises in the Molux's keyboard (and battery) controller chip, which is an Atmel controller. As I am familiar with Atmel, I could try to remedy the bug in its code, but I don't find any sources or documented possibilities for downloading in the available sources.

Is it possible to obtain this information?

Re: MoLUX: Keyboard mode

To determine whether this problem arises in the AVR or not you can add a debug message in the matrix part of the driver.

In: portuxmatrix.c

static void matrixhandler(struct matrix_t *event)
portuxinput_report_event(portuxmatrix, &(*matrix)[layer.cur][event->y][event->x], event->repeat, &layer);

By printing event->x, event->y and event->repeat this issue should become more clear.

If event->repeat is 0 the key is pressed unrepeated.

Re: MoLUX: Keyboard mode

Okay, I did as you suggested, and get e.g. "x=6, y=0, repeat=0" as long as I hold the key down (approx. 14/second).
event->repeat stays always 0, although the key is automatically repeated.

Syndicate content