Re: Input system and keycodes > 256

From: Vojtech Pavlik
Date: Wed Jun 02 2004 - 18:45:20 EST


On Mon, Apr 26, 2004 at 02:18:07AM +0200, Benoit Plessis wrote:
> Hi,
>
> I've digged into the kernel source/tools since i do own a new logitech
> USB keyboard MX with a great number a keys.
>
> There are two kind of addons keys, some works (scancode in the e0 XX
> form): Email, Prev, Next, Play/Pause, Vol+/-, Mute, ...
> + some of thoses generate a simple keycode eg
> Vol+: 0x73 | 0xf3 (scancodes: 0xe0 0x30 | 0xe0 0xb0)
> + some doesn't eg:
> play: 0x00 0x81 0xa4 | 0x80 0x81 0xa4 (scancodes: 0xe0 0x22 | 0xe0
> 0xa2)
> _ but all thoses key work quite well under X.
>
> The pb come from the new 'Function' keys with replace F1-F12 when the
> Flock mod isn't active (it's an hardware mod) and some other (Messenger,
> Webcam, iTouch and Buy).
>
> When grabbing with 'showkey -s' nothing appear
> When grabbing with 'showkey' i got keycodes like '0x00 0x82 0xd0 | 0x80
> 0x82 0xd0' (i got same keycodes when pressing mouse buttons except those
> are in 0x82 0x90 -> 0x82 0x97 range)
>
> When using the evbug module see that those keys generates > 255
> keycodes. (see attached file)
> And strangely all thoses keys generates the sames strings than keys with
> keycode2 = keycode - 256.
>
> Eg: the 'New' function key (shared with F1) reported by evbug as 336
> keycode as the same effect as keycode 80 (keypad 2).
>
> So i'm a little lost :(
> And i wanted some direction on how make thoses keys work correctly on
> the console (and X eventually. Actually under X some keys generate mouse
> button event, some doesn't generate anything).
>
> I am wondering if a good start would not be to extend the kbentry
> structure, to use unsigned short at least for the index so whe can acces
> a fully 512 entry keymap.

I'm sorry, but X only understands the RAW PS/2 protocol, and that one
can only transport keycodes up to 240.

For keycodes above 240, XFree86 would either need to use the MediumRAW
mode, or use event devices for parsing the keyboard.

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/