Fix for toshiba keyboard glitch

From: Pavel Machek (pavel@suse.cz)
Date: Fri May 05 2000 - 16:17:03 EST


Hi!

This is workaround for buggy toshiba notebooks.

--- clean/drivers/char/keyboard.c Tue Feb 15 00:31:14 2000
+++ linux/drivers/char/keyboard.c Fri May 5 23:13:52 2000
@@ -205,6 +208,23 @@
         char up_flag = down ? 0 : 0200;
         char raw_mode;
 
+ /*
+ * Fix for Toshiba Satellites. Toshiba's like to repeat
+ * "key down" event for A in combinations like shift-A.
+ * 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;
+ else if (jiffies - stop_jiffies >= 10) stop_jiffies = 0;
+ else {
+ printk( "Keyboard glitch detected, ignoring keypress\n" );
+ return;
+ }
+ prev_scancode = scancode;
+
         pm_access(pm_kbd);
 
         do_poke_blanked_console = 1;

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents me at discuss@linmodems.org

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



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:11 EST