2003-08-01 14:27:14

by Jurgen Kramer

[permalink] [raw]
Subject: 2.6.0-test1/2: keyboard funnies in textmode

Hi,

With both 2.6.0-test1 and test2 I am unable to use
de pipe (|) key in textmode (??). When in X it works again.
I have tested this on 2 machines. One machine is a laptop with Japanese
keyboard the other a regular PC with wireless Logitech USB keyboard.

All the other keys seem to work properly...anyone else with this strange
problem?

Greetings,

Jurgen



2003-08-01 14:52:27

by Andries Brouwer

[permalink] [raw]
Subject: Re: 2.6.0-test1/2: keyboard funnies in textmode

On Fri, Aug 01, 2003 at 04:25:45PM +0200, Jurgen Kramer wrote:

> With both 2.6.0-test1 and test2 I am unable to use
> de pipe (|) key in textmode (??). When in X it works again.
> I have tested this on 2 machines. One machine is a laptop with Japanese
> keyboard the other a regular PC with wireless Logitech USB keyboard.
>
> All the other keys seem to work properly...anyone else with this strange
> problem?

Can you give some details?

- When did it last work?
- What does it mean: "am unable to use"?
(Is the key ignored? Does the system crash? Do you get different keycodes?)
- What are the boot messages about the keyboard?

The pipe key is the same as the backslash key (say, on a US keyboard).
And there is some interesting confusion between Yen and Backslash
(since ASCII and JIS-Roman coincide, except in the yen and overbar
positions, where ASCII has backslash and tilde).
So, I am not surprised by weird things on a Japanese keyboard.

Do you use scancode Set 3?

Andries

2003-08-01 15:35:00

by Jurgen Kramer

[permalink] [raw]
Subject: Re: 2.6.0-test1/2: keyboard funnies in textmode

On Fri, 2003-08-01 at 16:52, Andries Brouwer wrote:

> Can you give some details?
>
> - When did it last work?

OK, I no longer have compiled 2.5 kernels installed, only 2.6.0-test1/2.
I can only say it does work normally under 2.4.x.

> - What does it mean: "am unable to use"?
> (Is the key ignored? Does the system crash? Do you get different keycodes?)
On the laptop with Japanese keyboard the Yen/Pipe key is totally dead.
On the regular PC with USB keyboard only the backslash works.

How can I check keycodes while in textmode?

> - What are the boot messages about the keyboard?
>
Very annoying, I can't type dmesg | grep keyboard while in textmode..:-(
But from X:

>From the laptop (2.6.0-test1):
input: PS/2 Generic Mouse on isa0060/serio4
input: AT Set 2 keyboard on isa0060/serio0

>From the PC (2.6.0-test2):
input: USB HID v1.10 Keyboard [Logitech USB Receiver] on
usb-0000:00:1d.1-2
input: USB HID v1.10 Mouse [Logitech USB Receiver] on usb-0000:00:1d.1-2

> The pipe key is the same as the backslash key (say, on a US keyboard).
> And there is some interesting confusion between Yen and Backslash
> (since ASCII and JIS-Roman coincide, except in the yen and overbar
> positions, where ASCII has backslash and tilde).
> So, I am not surprised by weird things on a Japanese keyboard.
> Do you use scancode Set 3?
Above shows Set 2 for the laptop. I can't tell for the PC.

Cheers,

Jurgen

2003-08-01 16:38:04

by Andries Brouwer

[permalink] [raw]
Subject: Re: 2.6.0-test1/2: keyboard funnies in textmode

On Fri, Aug 01, 2003 at 05:33:31PM +0200, Jurgen Kramer wrote:

> How can I check keycodes while in textmode?

The usual answer is "showkeys" for keycodes, "showkeys -s"
for scancodes. On 2.6 some cheating is involved, since the
driver first translates and then untranslates, so raw mode
is not exactly raw anymore, and replies may be wrong.

For the backslash/pipe key you expect scancode 0x2b
(in the default, translated scancode Set 2) and keycode 43.
X uses its own keycodes, maybe it will be 51, haven't checked.

2003-08-01 17:57:33

by Jurgen Kramer

[permalink] [raw]
Subject: Re: 2.6.0-test1/2: keyboard funnies in textmode

On Fri, 2003-08-01 at 18:37, Andries Brouwer wrote:

> The usual answer is "showkeys" for keycodes, "showkeys -s"
> for scancodes. On 2.6 some cheating is involved, since the
> driver first translates and then untranslates, so raw mode
> is not exactly raw anymore, and replies may be wrong.
>

OK here it goes:

Laptop 2.4 showkey:
kb mode was UNICODE
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
keycode 28 release
keycode 124 press
keycode 124 release
keycode 124 press
keycode 124 release
keycode 124 press
keycode 124 release

Laptop 2.4 showkey -s:
0x7d
0xfd
0x7d
0xfd
0x7d
0xfd
0x2a
0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a
0x2a 0x2a
0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a
0x7d
0xfd
0x7d
0xfd
0x7d
0xfd 0xaa



Laptop 2.6 showkey:
keycode 0 press
keycode 1 release
keycode 55 release
keycode 0 release
keycode 1 release
keycode 55 release

Laptop 2.6 showkey -s:
0x7d
0xfd
0x7d
0xfd
0x7d
0xfd


PC 2.4 showkey:
keycode 43 release
keycode 43 press
keycode 43 release
keycode 43 press
keycode 43 release

PC 2.4 showkey -s:
0x2b 0xab
0x2b 0xab
0x2a
0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2b 0xab
0x2b
0xab 0xaa

PC 2.6 showkey:
keycode 84 press
keycode 84 release
keycode 84 press
keycode 84 release

PC 2.6 showkey -s:
0x2b 0xab
0x2b 0xab
0x2a
0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2b 0xab
0x2b 0xab 0xaa

The difference between 2.4 and 2.6 on the laptop are very weird.
Hope this helps.

Greetings,

Jurgen


2003-08-01 20:16:54

by Andries Brouwer

[permalink] [raw]
Subject: Re: 2.6.0-test1/2: keyboard funnies in textmode

On Fri, Aug 01, 2003 at 07:56:04PM +0200, Jurgen Kramer wrote:

> Laptop 2.4 showkey:
> keycode 124
>
> Laptop 2.6 showkey:
> keycode 0 press
> keycode 1 release
> keycode 55 release
> keycode 0 release
> keycode 1 release
> keycode 55 release
>
> Laptop 2.6 showkey -s:
> 0x7d
> 0xfd
> 0x7d
> 0xfd
> 0x7d
> 0xfd

Aha - this is a problem we have seen a few more times recently.
Scancode 0x7d, well-known from Japanese keyboards, has keycode 124
under 2.4 and keycode 183 under 2.6.

There are many solutions, and searching for "keycode 183" will
show you a few. A quick-n-dirty solution for you is to replace
the 183 in the array atkbd_set2_keycode[] in atkbd.c by 124.

Will look at your USB problem later.

Andries


[PS - Your strange 1,55 release is because 1*128+55 = 183.
The new kernel breaks old keyboard utilities. Bad.]

2003-08-01 22:16:48

by Andries Brouwer

[permalink] [raw]
Subject: Re: 2.6.0-test1/2: keyboard funnies in textmode

On Fri, Aug 01, 2003 at 07:56:04PM +0200, Jurgen Kramer wrote:

> PC 2.4 showkey:
> keycode 43 release
> keycode 43 press
>
> PC 2.6 showkey:
> keycode 84 press
> keycode 84 release

Funny indeed.

The USB standards define USB code 49 for the US \| key,
USB code 50 for the non-US \| key (French mu, etc),
and USB code 137 for the Japanese Yen |.
So, you should get one of these.

This USB code is translated to a Linux keycode in
usb_kbd_keycode[] in usbkbd.c.
The three possible translations are 43, 84, 183.

Maybe you can check for yourself (e.g. with a printk in usbkbd.c)
that you really get different USB codes from that keyboard under
2.4 and 2.6?

Maybe the code one gets depends on the initialization of the keyboard.

2003-08-10 18:40:27

by Mikael Magnusson

[permalink] [raw]
Subject: Re: 2.6.0-test1/2: keyboard funnies in textmode

On Sat, Aug 02, 2003 at 12:16:27AM +0200, Andries Brouwer wrote:
> On Fri, Aug 01, 2003 at 07:56:04PM +0200, Jurgen Kramer wrote:
>
> > PC 2.4 showkey:
> > keycode 43 release
> > keycode 43 press
> >
> > PC 2.6 showkey:
> > keycode 84 press
> > keycode 84 release
>

I have got the same problem in 2.6.0-test3 with a swedish USB keyboard.
It's a Microsoft Natural Keyboard pro. The "'/*" key generates keycode
43 in 2.4.21 and keycode 84 in 2.6.0-test3. But my swedish AT keyboard
still generates the same keycode (43) in both releases.

I have tried to find what caused the change. In 2.4 keycode 84 is
translated to 43 by x86_keycodes table in drivers/input/keybdev.c. But
in 2.6 I think the table is used only in raw mode, otherwise the keymap
is used directly (in drivers/char/keyboard.c).

My workaround is to define keycode 84 in the keymap file/s. I have added
the following to my US keymap:

keycode 84 = backslash bar
control keycode 84 = Control_backslash

Regards,
Mikael Magnusson