Keyboard at TC1000 (was Re: HEADSUP: kbdmux(4) is in both HEAD and RELENG_6)

From: Milan Obuch <current_at_dino.sk>
Date: Thu, 30 Mar 2006 13:40:32 +0100
On Friday 10 March 2006 15:27, Milan Obuch wrote:
> On Monday 06 March 2006 22:48, Milan Obuch wrote:
> > On Saturday 04 March 2006 01:52, Maksim Yevmenkin wrote:
> > > kbdmux(4) is now fully integrated into HEAD and RELENG_6.
> >
> > ... it works on my TabletPC TC1000. Many thanks, I think this is a must
> > for every notebook/similar device user.
>

TC1000 has two keyboards - technically. There is standard AT keyboard 
controller with four side keys/buttons, somewhat hidden reset key, and a jog 
dial (Left, Press, Right). Scan codes produced are as follows:

'Outlook' š š š e0 02 š š š š š e0 82
'CompaQ' š š š še0 03 š š š š š e0 83
TAB š š š š š š e0 04 š š š š š e0 84
ESC š š š š š š e0 05 š š š š š e0 85
Left š š š š š še0 06 š š š š š e0 86
Press š š š š š 1c š š š š š š š9c
Right š š š š š e0 07 š š š š š e0 87
Ctrl-Alt-Del š š1d 38 e0 53 š š 9d b8 e0 d3

Detachable USB keyboard (with pointing stick working like USB mouse) works 
well. In that situation, using kbdmux is the best solution - even another 
keyboard attached via USB works well. Scan codes are another story - with no 
other changes, only Press (like Enter) and Ctrl-Alt-Del (like 
Ctrl-Alt-Del :) ) works. As there is no point using TC1000 with no (either 
detachable or standard) USB keyboard, I think the best way is modify kbdmux.c 
to recognize TC1000's non standard scan codes. I used this patch:

--- kbdmux.c.orig š š š Sat Mar š4 01:08:20 2006
+++ kbdmux.c.patched š šMon Mar 27 00:11:33 2006
_at__at_ -697,6 +697,24 _at__at_
š š š š case 0xE0: š š š/* 0xE0 prefix */
š š š š š š š š state->ks_prefix = 0;
š š š š š š š š switch (keycode) {
+ š š š š š š š case 0x02: š š š/* TC1000 'Outlook' key */
+ š š š š š š š š š š š devctl_notify("TC1000","Outlook",scancode & 0x80 ? 
"RELEASE" : "MAKE",NULL);
+ š š š š š š š š š š š goto next_code;
+ š š š š š š š case 0x03: š š š/* TC1000 'CompaQ' key */
+ š š š š š š š š š š š devctl_notify("TC1000","CompaQ",scancode & 0x80 ? 
"RELEASE" : "MAKE",NULL);
+ š š š š š š š š š š š goto next_code;
+ š š š š š š š case 0x04: š š š/* TC1000 Tab key */
+ š š š š š š š š š š š keycode = 0x0F;
+ š š š š š š š š š š š break;
+ š š š š š š š case 0x05: š š š/* TC1000 Esc key */
+ š š š š š š š š š š š keycode = 0x01;
+ š š š š š š š š š š š break;
+ š š š š š š š case 0x06: š š š/* TC1000 Left key */
+ š š š š š š š š š š š keycode = 0x61;
+ š š š š š š š š š š š break;
+ š š š š š š š case 0x07: š š š/* TC1000 Right key */
+ š š š š š š š š š š š keycode = 0x62;
+ š š š š š š š š š š š break;
š š š š š š š š case 0x1C: š š š/* right enter key */
š š š š š š š š š š š š keycode = 0x59;
š š š š š š š š š š š š break;

(please unwrap what's necessary, use tabs instead of spaces where applicable).

I would like to get this into source tree - at least Maxim has no objections, 
however, maybe making this patch an option would be good, too, but I have no 
idea now, how to do it, exactly.

As both 'Outlook' and 'CompaQ' keys start an application under Windows, I 
decided to send a notification from kernel, so a user level script could be 
fired. Relevant dev.conf lines could be

notify 0 {
        match "system"          "TC1000";
        action "/root/test $subsystem $type";
};

Today I discovered a way to go with those kays undex X and verified it, so 
with this patch one can create both console text-mode and X configuration.

Regards,
Milan

-- 
Please reply to the mailing list only.
This address is filtered.
Received on Thu Mar 30 2006 - 10:41:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:54 UTC