mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Toshiba keyboard workaroun
Date: Tue, 18 Feb 2003 23:24:02 +0100	[thread overview]
Message-ID: <20030218222402.GG21974@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <200302182213.h1IMDKX31357@devserv.devel.redhat.com>

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.

  parent reply	other threads:[~2003-02-18 22:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1045603384.24857.linux-kernel2news@redhat.com>
2003-02-18 22:13 ` Pete Zaitcev
2003-02-18 22:21   ` Pavel Machek
2003-02-18 22:24   ` Pavel Machek [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030218222402.GG21974@atrey.karlin.mff.cuni.cz \
    --to=pavel@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®