mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kernel-2.4.21-final drivers/char/keyboard.c - key release bug
@ 2003-06-15  3:18 Geoff Jacobsen
  0 siblings, 0 replies; only message in thread
From: Geoff Jacobsen @ 2003-06-15  3:18 UTC (permalink / raw)
  To: linux-kernel

-- I am not on the list; please reply to geoffj@casquet.inet.net.nz --

In the kernel-2.4.21-final drivers/char/keyboard.c file there was a
workaround applied from the AC patches "for hardware which sometimes
send the key release event twice".

Unfortunately this fix causes a bug. If you hold down the left_ctrl and
press the right_ctrl then the left_ctrl release is missed (same story
with the two alt keys).

In X this means that until the left_ctrl is pressed again every key
typed will be as if the left_ctrl is still held down.

Removing the workaround fixes the problem.

Here is the patch to remove the offending code:


--- linux-2.4.21/drivers/char/keyboard.c        2003-06-15
15:00:38.000000000 +1200
+++ linux/drivers/char/keyboard.c       2003-06-15 15:03:00.000000000
+1200
@@ -72,7 +72,7 @@
  
 /*
  * global state includes the following, and various static variables
- * in this module: prev_scancode, shift_state, diacr, npadch,
dead_key_next.
+ * in this module: shift_state, diacr, npadch, dead_key_next.
  * (last_console is now a global variable)
  */
  
@@ -95,7 +95,6 @@
 static struct tty_struct **ttytab;
 static struct kbd_struct * kbd = kbd_table;
 static struct tty_struct * tty;
-static unsigned char prev_scancode;
  
 void compute_shiftstate(void);
  
@@ -215,17 +214,7 @@
        }
        kbd = kbd_table + fg_console;
        if ((raw_mode = (kbd->kbdmode == VC_RAW))) {
-               /*
-                *      The following is a workaround for hardware
-                *      which sometimes send the key release event twice
-                */
-               unsigned char next_scancode = scancode|up_flag;
-               if (up_flag && next_scancode==prev_scancode) {
-                       /* unexpected 2nd release event */
-               } else {
-                       prev_scancode=next_scancode;
-                       put_queue(next_scancode);
-               }
+               put_queue(scancode | up_flag);
                /* we do not return yet, because we want to maintain
                   the key_down array, so that we have the correct
                   values when finishing RAW mode or when changing VT's
*/



-- 
Geoff Jacobsen <geoffj@casquet.inet.net.nz>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-15  3:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-15  3:18 [PATCH] kernel-2.4.21-final drivers/char/keyboard.c - key release bug Geoff Jacobsen

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®