public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Toshiba keyboard workaroun
@ 2003-02-18 21:19 Pavel Machek
  2003-02-23  8:19 ` Vojtech Pavlik
  2003-02-23 11:50 ` Christoph Hellwig
  0 siblings, 2 replies; 7+ messages in thread
From: Pavel Machek @ 2003-02-18 21:19 UTC (permalink / raw)
  To: alan, kernel list

Hi!

You said that you'll submit toshiba keyboard fix for 2.4 to
marcelo... Here goes 2.5 version, will you submit it to Linus? ;-).

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

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-02-23 11:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1045603384.24857.linux-kernel2news@redhat.com>
2003-02-18 22:13 ` Toshiba keyboard workaroun Pete Zaitcev
2003-02-18 22:21   ` Pavel Machek
2003-02-18 22:24   ` Pavel Machek
2003-02-18 21:19 Pavel Machek
2003-02-23  8:19 ` Vojtech Pavlik
2003-02-23 11:29   ` Pavel Machek
2003-02-23 11:50 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox