Re: 2.6 input drivers FAQ

Andries Brouwer
2004-02-01T15:14:56Z

On Sun, Feb 01, 2004 at 02:50:01PM +0100, Vojtech Pavlik wrote:

> Sorry. I was typing that from memory. I'll fix it. Btw, could you make
> the kbd package accept scancodes in the 0x80-0xff range (same as e000 to
> e07f), if it is not yet there? And how about scancodes in the
> 0x100-0x1ff range? Will those work?

What is needed for the 2.6 kernel is rather volatile
(and maybe the present kernel version is not quite final yet).
But setkeycodes does ioctl(fd,KDSETKEYCODE,&a) where

a.keycode = atoi(argv[2]);
a.scancode = strtol(argv[1], &ep, 16);
if (a.scancode >= 0xe000) {
a.scancode -= 0xe000;
a.scancode += 128; /* some kernels needed +256 */
}

The 2.6.1 kernel is still very messy, with code

if (atkbd->emul) {
if (--atkbd->emul)
goto out;
code |= (atkbd->set != 3) ? 0x80 : 0x100;
}

where the representation of the e0 prefix depends on the current scancode mode.
A bad idea.

> One more question: Will kbdrate work properly (use ioctls) when compiled
> on a 2.6 kernels?

kbdrate first tries the KDKBDREP ioctl, then the KIOCSRATE ioctl,
and if both fail it will try to write to /dev/port.

Andries