Re: Toshiba keyboard workaroun

From: Pavel Machek (pavel@suse.cz)
Date: Tue Feb 18 2003 - 17:24:02 EST


Hi!

> First, formatting does not respect the original code. Pavel, please,
> I do not care what crap you write in softsuspend, but this is a

Do you like this better?

                                                                Pavel
PS: Oh, and, what crap in swsusp are you talking about?

--- clean/drivers/char/keyboard.c 2003-02-15 18:51:18.000000000 +0100
+++ linux/drivers/char/keyboard.c 2003-02-18 23:20:33.000000000 +0100
@@ -1020,6 +1041,26 @@
         struct tty_struct *tty;
         int shift_final;
 
+ /*
+ * 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 (keycode != prev_scancode)
+ stop_jiffies = jiffies;
+ else
+ if (time_after(jiffies, stop_jiffies + HZ/10))
+ prev_scancode = -1;
+ else {
+ printk( "Keyboard glitch detected, ignoring keypress\n" );
+ return;
+ }
+ prev_scancode = keycode;
+
         if (down != 2)
                 add_keyboard_randomness((keycode << 1) ^ down);
 

-- 
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Feb 23 2003 - 22:00:23 EST