public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans-Georg Thien <1682-600@onlinehome.de>
To: Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Khalid Aziz <khalid_aziz@hp.com>
Subject: Re: [RFC][PATCH] "Disable Trackpad while typing" on Notebooks withh aPS/2 Trackpad
Date: Fri, 09 May 2003 13:47:47 +0200	[thread overview]
Message-ID: <3EBB9563.7080709@onlinehome.de> (raw)
In-Reply-To: <3EBAAC12.F4EA298D@hp.com>

[-- Attachment #1: Type: text/plain, Size: 811 bytes --]

Khalid Aziz wrote:
> [...] impossible to perform any operation that requires
> pressing a key on the keyboard while clicking a mouse button - for
> example bringing up X-terminal menu with CTRL-<middle button>. I am sure
> there are other similar combination used by other software. You would
> think 1 second after the CTRL key is pressed (which is when a keyboard
> event is generated), mouse will be re-enabled and you should be able to
> click mouse buttons as long as you do not let go of the key. Does not
> seem to work that way. Mouse stays disabled as long as the key is
> pressed.
> 
Thanks a lot Khalid! I have fixed that now.

Now, when you first press a key the trackpad is disabled. But the
"timer" is not restarted now when you hold the key pressed down
(prev_scancode == actual_scancode).







[-- Attachment #2: trackpad-2.4.20.diff --]
[-- Type: text/plain, Size: 3118 bytes --]

--- /usr/src/linux-2.4.20/Documentation/Configure.help	Fri Nov 29 00:53:08 2002
+++ /usr/src/linux/Documentation/Configure.help	Thu May  1 02:12:04 2003
@@ -17752,6 +17752,16 @@
   <ftp://gnu.systemy.it/pub/gpm/>) solves this problem, or you can get
   the "mconv2" utility from <ftp://ibiblio.org/pub/Linux/system/mouse/>.
 
+Disable trackpad while typing
+CONFIG_DISABLE_TRACKPAD_WHILE_TYPING
+  For people with a notebook that have a build in trackpad.
+
+  It prevents unintended mouse moves and mouse taps while typing on
+  the notebook keyboard.
+
+  The majority of notebooks on the market have a PS/2 trackpad. 
+  So you will probably say "Y" if you have a notebook with a trackpad.
+
 C&T 82C710 mouse port support (as on TI Travelmate)
 CONFIG_82C710_MOUSE
   This is a certain kind of PS/2 mouse used on the TI Travelmate. If
--- /usr/src/linux-2.4.20/drivers/char/Config.in	Fri Nov 29 00:53:12 2002
+++ /usr/src/linux/drivers/char/Config.in	Thu May  1 02:30:45 2003
@@ -170,6 +170,13 @@
 tristate 'Mouse Support (not serial and bus mice)' CONFIG_MOUSE
 if [ "$CONFIG_MOUSE" != "n" ]; then
    bool '  PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE
+
+   if [ "$CONFIG_PSMOUSE" = "y" ]
+   then
+     bool '    Disable Trackpad while typing on Notebooks' CONFIG_DISABLE_TRACKPAD_WHILE_TYPING
+   fi
+
+
    tristate '  C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE
    tristate '  PC110 digitizer pad support' CONFIG_PC110_PAD
    tristate '  MK712 touch screen support' CONFIG_MK712_MOUSE
--- /usr/src/linux-2.4.20/drivers/char/pc_keyb.c	Fri Nov 29 00:53:12 2002
+++ /usr/src/linux/drivers/char/pc_keyb.c	Fri May  9 15:17:45 2003
@@ -13,6 +13,11 @@
  * Code fixes to handle mouse ACKs properly.
  * C. Scott Ananian <cananian@alumni.princeton.edu> 1999-01-29.
  *
+ * Implemented the "disable trackpad while typing" feature. This prevents
+ * unintended mouse moves and mouse taps while typing on the keyboard on
+ * notebooks with a PS/2 trackpad.
+ * Hans-Georg Thien <1682-600@onlinehome.de> 2003-04-30.
+ *
  */
 
 #include <linux/config.h>
@@ -67,6 +72,11 @@
 static void aux_write_ack(int val);
 static void __aux_write_ack(int val);
 static int aux_reconnect = 0;
+
+#ifdef CONFIG_DISABLE_TRACKPAD_WHILE_TYPING
+static int last_kbd_event = 0; /* used to hold timestamp of last kbd event */
+#endif
+
 #endif
 
 #ifndef kbd_controller_present
@@ -449,6 +459,11 @@
 		return;
 	}
 
+#ifdef CONFIG_DISABLE_TRACKPAD_WHILE_TYPING
+        /* do nothing if time since last kbd event is less then 1Sec */
+        if ( abs(jiffies - last_kbd_event) < HZ ) return;
+#endif
+
 	prev_code = scancode;
 	add_mouse_randomness(scancode);
 	if (aux_count) {
@@ -469,6 +484,17 @@
 
 static inline void handle_keyboard_event(unsigned char scancode)
 {
+
+#ifdef CONFIG_DISABLE_TRACKPAD_WHILE_TYPING
+        static unsigned char prev_scancode=0;
+
+        if (scancode != prev_scancode)
+        {
+                last_kbd_event = jiffies;
+                prev_scancode=scancode;
+        }
+#endif
+
 #ifdef CONFIG_VT
 	kbd_exists = 1;
 	if (do_acknowledge(scancode))


  reply	other threads:[~2003-05-09 11:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-01 21:48 [RFC][PATCH] "Disable Trackpad while typing" on Notebooks withh a PS/2 Trackpad Hans-Georg Thien
2003-05-01 22:13 ` Måns Rullgård
2003-05-06  9:29 ` wwp
2003-05-06 11:27   ` Hans-Georg Thien
2003-05-08 19:12 ` [RFC][PATCH] "Disable Trackpad while typing" on Notebooks withh aPS/2 Trackpad Khalid Aziz
2003-05-09 11:47   ` Hans-Georg Thien [this message]
2003-05-27 20:47   ` Hans-Georg Thien
2003-05-27 21:10     ` wwp
2003-05-29 12:07       ` Hans-Georg Thien
2003-09-30 20:51       ` [PORT to 2.6.x] "Disable Trackpad while typing" on Notebooks with a PS/2 Trackpad Hans-Georg Thien
2003-10-02 17:40       ` getting timestamp of last interrupt? Hans-Georg Thien
2003-10-02 18:54         ` Karim Yaghmour
2003-10-02 18:59         ` Richard B. Johnson
2003-10-02 22:46         ` Peter Chubb

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=3EBB9563.7080709@onlinehome.de \
    --to=1682-600@onlinehome.de \
    --cc=khalid_aziz@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    /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