2004-04-26 00:18:20

by Benoit Plessis

[permalink] [raw]
Subject: Input system and keycodes > 256

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.



--
Benoit Plessis <[email protected]> +33 6 77 42 78 32
<[email protected]> <[email protected]>
<[email protected]> <[email protected]>
1024D/B4D74B76 B9A7 3697 661D 25FB A609 E69E 92CA FFAB B4D7 4B76



Attachments:
kern.log (12.28 kB)
signature.asc (189.00 B)
This is a digitally signed message part
Download all attachments

2004-04-26 08:49:18

by David Gómez

[permalink] [raw]
Subject: Re: Input system and keycodes > 256

Hi Benoit ;),

> 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)

You could make them work using the 'setkeycodes' command to configure
the kernel tables, so you can put some setkeycodes lines in your init
scripts to make those extra keys always avaliable on your console.

bye

--
David G?mez

"The question of whether computers can think is just like the question of
whether submarines can swim." -- Edsger W. Dijkstra

2004-04-26 09:20:28

by Benoit Plessis

[permalink] [raw]
Subject: Re: Input system and keycodes > 256

On Mon, 2004-04-26 at 12:48, David Gómez wrote:
> Hi Benoit ;),
>
> > 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)
>
> You could make them work using the 'setkeycodes' command to configure
> the kernel tables, so you can put some setkeycodes lines in your init
> scripts to make those extra keys always avaliable on your console.
>
> bye

Ok thanks for that,
in fact thoses key works under XFree so i doesn't exactly focus on them.
It's the other keys with 0x82 0xXX keycodes, no scancodes (maybe an
empty translation table ? for i've read that USB keyboard need one of
those) and that generate mouse click event under X that are really
bothering me.

--
Benoit Plessis <[email protected]> +33 6 77 42 78 32
<[email protected]> <[email protected]>
<[email protected]> <[email protected]>
1024D/B4D74B76 B9A7 3697 661D 25FB A609 E69E 92CA FFAB B4D7 4B76



Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2004-04-28 23:49:42

by Andries Brouwer

[permalink] [raw]
Subject: Re: Input system and keycodes > 256

On Mon, Apr 26, 2004 at 02:18:07AM +0200, Benoit Plessis wrote:

> 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)

What version of showkey are you using?

2004-06-02 23:39:38

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: Input system and keycodes > 256

On Mon, Apr 26, 2004 at 10:48:50AM +0000, David G?mez wrote:
> Hi Benoit ;),
>
> > 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)
>
> You could make them work using the 'setkeycodes' command to configure
> the kernel tables, so you can put some setkeycodes lines in your init
> scripts to make those extra keys always avaliable on your console.

Won't work for USB keyboards.

--

2004-06-02 23:42:09

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: Input system and keycodes > 256

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.

--

2004-06-02 23:42:19

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: Input system and keycodes > 256

On Thu, Apr 29, 2004 at 01:48:41AM +0200, Andries Brouwer wrote:
> On Mon, Apr 26, 2004 at 02:18:07AM +0200, Benoit Plessis wrote:
>
> > 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)
>
> What version of showkey are you using?

A normal mode. This is 2.6 extended medium raw mode I suppose.

--