From plasma@freebsd.sinica.edu.tw  Sat Sep 27 00:42:43 2003
Return-Path: <plasma@freebsd.sinica.edu.tw>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E844316A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 27 Sep 2003 00:42:43 -0700 (PDT)
Received: from freebsd.sinica.edu.tw (freebsd.sinica.edu.tw [140.109.13.51])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3C40244022
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 27 Sep 2003 00:42:43 -0700 (PDT)
	(envelope-from plasma@freebsd.sinica.edu.tw)
Received: by freebsd.sinica.edu.tw (Postfix, from userid 1026)
	id B5656999; Sat, 27 Sep 2003 15:42:43 +0800 (CST)
Message-Id: <20030927074243.B5656999@freebsd.sinica.edu.tw>
Date: Sat, 27 Sep 2003 15:42:43 +0800 (CST)
From: plasma <plasma@freebsd.sinica.edu.tw>
Reply-To: plasma <plasma@freebsd.sinica.edu.tw>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: PATCH, fix usb keyboard repeat problem
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         57273
>Category:       kern
>Synopsis:       PATCH, fix usb keyboard repeat problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 27 00:50:19 PDT 2003
>Closed-Date:    Mon Mar 01 12:56:32 PST 2004
>Last-Modified:  Mon Mar 01 12:56:32 PST 2004
>Originator:     plasma
>Release:        FreeBSD 4.9-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD freebsd.sinica.edu.tw 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #4: Mon Sep 15 18:44:48 CST 2003 root@freebsd.sinica.edu.tw:/usr/src/sys/compile/GENERIC i386


	
>Description:
	Using a usb keyboard, the keystrokes will repeat itself if typing
	too fast.

	See http://docs.freebsd.org/cgi/getmsg.cgi?fetch=984685+0+current/freebsd-stable
	for details.
>How-To-Repeat:
	1. Plug a usb keyboard.
	2. Do 'kbdcontrol -k /dev/kbd1 < /dev/console', activate the usb
	   keyboard.
	3. Type.  Make sure you type fast enough that one key is pressed
	   before the previous key is not released yet.
>Fix:

	Apply the following patch:

--- /usr/src/sys/dev/usb/ukbd.c.orig	Mon Mar 31 08:31:35 2003
+++ /usr/src/sys/dev/usb/ukbd.c	Sat Sep 27 15:13:31 2003
@@ -732,10 +732,10 @@
 	for (i = 0; i < NKEYCODE; i++) {
 		key = state->ks_odata.keycode[i];
 		if (key == 0)
-			break;
+			continue;
 		for (j = 0; j < NKEYCODE; j++) {
 			if (ud->keycode[j] == 0)
-				break;
+				continue;
 			if (key == ud->keycode[j])
 				goto rfound;
 		}
@@ -748,11 +748,11 @@
 	for (i = 0; i < NKEYCODE; i++) {
 		key = ud->keycode[i];
 		if (key == 0)
-			break;
+			continue;
 		state->ks_ntime[i] = now + kbd->kb_delay1;
 		for (j = 0; j < NKEYCODE; j++) {
 			if (state->ks_odata.keycode[j] == 0)
-				break;
+				continue;
 			if (key == state->ks_odata.keycode[j]) {
 				state->ks_ntime[i] = state->ks_otime[j];
 				if (state->ks_otime[j] > now)



>Release-Note:
>Audit-Trail:

From: David Gilbert <dgilbert@aci.ca>
To: freebsd-gnats-submit@FreeBSD.org, plasma@freebsd.sinica.edu.tw
Cc:  
Subject: Re: kern/57273: PATCH, fix usb keyboard repeat problem
Date: Sat, 27 Sep 2003 17:33:08 -0400

 This happens in -CURRENT as well.
 

From: "Walter C. Pelissero" <walter@pelissero.de>
To: freebsd-gnats-submit@FreeBSD.org, plasma@freebsd.sinica.edu.tw
Cc:  
Subject: Re: kern/57273: PATCH, fix usb keyboard repeat problem
Date: Tue, 30 Sep 2003 23:42:23 +0200

 On 4.9-PRERELEASE the patch suggested by plasma@freebsd.sinica.edu.tw
 does fix the problem.
 
 -- 
 walter pelissero
 http://www.pelissero.de
Responsible-Changed-From-To: freebsd-bugs->joe 
Responsible-Changed-By: znerd 
Responsible-Changed-When: Mon Jan 5 02:41:56 PST 2004 
Responsible-Changed-Why:  
Over to USB maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57273 
State-Changed-From-To: open->patched 
State-Changed-By: jhb 
State-Changed-When: Mon Feb 23 07:37:19 PST 2004 
State-Changed-Why:  
Fix committed to head and will be merged to 4.x in a week. 


Responsible-Changed-From-To: joe->jhb 
Responsible-Changed-By: jhb 
Responsible-Changed-When: Mon Feb 23 07:37:19 PST 2004 
Responsible-Changed-Why:  
Fix committed to head and will be merged to 4.x in a week. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57273 
State-Changed-From-To: patched->closed 
State-Changed-By: jhb 
State-Changed-When: Mon Mar 1 12:56:20 PST 2004 
State-Changed-Why:  
Fix merged to 4.x. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57273 
>Unformatted:
