[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [debian-knoppix] toshiba satelite prob: eepro100.o missing, keyboard



Moin Chris!
Chris Liechti schrieb am Monday, den 11. November 2002:

> and there is a _very_ nasty bug in the keyboard handling. every now and then the key appears
> to be pressed twice altough it isn't. "woordss lookk thenn like thhis"
> i don't know what do about that but it makes writing on that machine a challenge...

Recent Toshiba laptops have crappy hardware, ie. a controller which
sends the key events in the wrong order when typing to fast.
Console-tools guys build a filter for this effect so you do not have the
problem on the console, but in X. There is a fix in kernel 2.5, or take
this patch for 2.4.x.

--- drivers/char/keyboard.c.original	2002-10-25 21:19:03.000000000 +0200
+++ drivers/char/keyboard.c	2002-10-25 21:24:20.000000000 +0200
@@ -97,6 +97,9 @@
 
 void compute_shiftstate(void);
 
+static unsigned char prev_scancode;
+static unsigned char next_scancode;
+
 typedef void (*k_hand)(unsigned char value, char up_flag);
 typedef void (k_handfn)(unsigned char value, char up_flag);
 
@@ -213,7 +216,19 @@
 	}
 	kbd = kbd_table + fg_console;
 	if ((raw_mode = (kbd->kbdmode == VC_RAW))) {
-		put_queue(scancode | up_flag);
+ /*             put_queue(scancode | up_flag); */
+                 /* The following 'if' is a workaround for hardware
+                  * which sometimes send the key release event twice
+                  */
+                 unsigned char next_scancode = scancode|up_flag;
+                 if (up_flag && next_scancode==prev_scancode) {
+                        /* unexpected 2nd release event */
+                 } else {
+                         prev_scancode=next_scancode;
+                         put_queue(next_scancode);
+                 }
+ 
+
 		/* we do not return yet, because we want to maintain
 		   the key_down array, so that we have the correct
 		   values when finishing RAW mode or when changing VT's */

Gruss/Regards,
Eduard, no longer Toshiba fan.
-- 
Perfection is achieved not when you have nothing more to add,
but when you have nothing left to take away. 
                        -- Antoine de Saint-Exupéry 
_______________________________________________
debian-knoppix mailing list
debian-knoppix@linuxtag.org
http://mailman.linuxtag.org/mailman/listinfo/debian-knoppix


Reply to: