Re: Toshiba Satellite 2595XDVD

Pavel Machek (pavel@suse.cz)
Thu, 2 Dec 1999 12:35:16 +0100


Hi!

> I am not sure to whom should I address this, it's about a buggy
> keyboard controller (I guess) found on <subj> laptops that has a
> peculiar behavior with some key sequences. Specifically, when you
> press a shift (ctrl, alt, shift) and a key - (mostly when you play a
> lot with shifts, like in emacs :-)) - sometimes the controller ignores
> the repeat delay and repeats the key, sending very close (tens of
> miliseconds) key_down interrups (kbd MAKEs).

It would be nice to warn if such condition is detected. Silently
correcting problems is bad thing (tm). So patch currently looks like
this. (Also owners of good keyboards with short autorepeats will at
least know what code to disable and to who complain :-)))))

/*
* Fix for Toshiba Satellites. Under some
* circumstances, its keyboards behave like ignoring the
* kbd repeat delay. This happens in conjunction with shift
* keys (ctrl, alt, shift) and leads to undesirable repeat
* of a key even if pressed briefly. Fix it by ignoring any
* subsequent occurence of the second identical scancode for
* 200 ms. IMO, this doesn't break anything on a good keyboard.
*
* Thanx to Andrei Pitis <pink@roedu.net>.
*/
static int prev_scancode = 0;
static int stop_jiffies = 0;

/* new scancode, trigger delay */
if (scancode != prev_scancode)
stop_jiffies = jiffies;

/* same scancode, accept only after the delay */
else if (jiffies - stop_jiffies >= 10)
stop_jiffies = 0;

/* glitch! bail out... */
else {
printk( "Keyboard glitch detected, ignoring keypress\n" );
return;
}
prev_scancode = scancode;

-- 
I'm really pavel@ucw.cz. Look at http://195.113.31.123/~pavel.  Pavel
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!

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