From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 21 08:00:37 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B35216A4BF for ; Thu, 21 Aug 2003 08:00:37 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4362B43FEA for ; Thu, 21 Aug 2003 08:00:36 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h7LF0aUp041633 for ; Thu, 21 Aug 2003 08:00:36 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h7LF0aPY041632; Thu, 21 Aug 2003 08:00:36 -0700 (PDT) Resent-Date: Thu, 21 Aug 2003 08:00:36 -0700 (PDT) Resent-Message-Id: <200308211500.h7LF0aPY041632@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, thn@saeab.se Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 068D116A4BF for ; Thu, 21 Aug 2003 07:54:18 -0700 (PDT) Received: from trumma.int.saeab.se (ture.saeab.se [213.80.3.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3767D43FD7 for ; Thu, 21 Aug 2003 07:54:16 -0700 (PDT) (envelope-from root@trumma.int.saeab.se) Received: from trumma.int.saeab.se (localhost [127.0.0.1]) by trumma.int.saeab.se (8.12.8p1/8.12.8) with ESMTP id h7LEsFtU000342 for ; Thu, 21 Aug 2003 16:54:15 +0200 (CEST) (envelope-from root@trumma.int.saeab.se) Received: (from root@localhost) by trumma.int.saeab.se (8.12.8p1/8.12.8/Submit) id h7LEsE5e000341; Thu, 21 Aug 2003 16:54:14 +0200 (CEST) Message-Id: <200308211454.h7LEsE5e000341@trumma.int.saeab.se> Date: Thu, 21 Aug 2003 16:54:14 +0200 (CEST) From: thn@saeab.se To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/55838: Dual characters from keyboard in X on Toshiba laptop X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: thn@saeab.se List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2003 15:00:37 -0000 >Number: 55838 >Category: kern >Synopsis: Dual characters from keyboard in X on Toshiba laptop >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 21 08:00:35 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Thomas Nyström (thn@saeab.se) >Release: FreeBSD 4.8-RELEASE-p1 i386 >Organization: Sv. Aktuell Elektronik AB >Environment: System: FreeBSD trumma.int.saeab.se 4.8-RELEASE-p1 FreeBSD 4.8-RELEASE-p1 #3: Thu Aug 21 16:13:43 CEST 2003 root@trumma.int.saeab.se:/usr/obj/usr/src/sys/TRUMMA i386 Hardware is Toshiba Satellite S1410-303 >Description: When running X (4.3.0) and typing on the keyboard, characters are repeated sometimes. "Likke thhis andd it iss verry annnoyying" Same problem have been seen on other Toshiba laptops running Linux and X (I have found that in mailarchives through Google). The root cause of the problem is buggy hardware. No problem have been seen when running in non-X mode. >How-To-Repeat: See above. >Fix: The following patch is a workaround for the problem by removing identical release codes that is coming back-to-back. **************************************************************** --- sys/dev/kbd/atkbd.c.org Mon Apr 8 21:21:38 2002 +++ sys/dev/kbd/atkbd.c Thu Aug 21 16:17:09 2003 @@ -183,6 +183,7 @@ int ks_polling; int ks_state; /* shift/lock key state */ int ks_accents; /* accent key index (> 0) */ + int ks_last_code; /* last seen scancode */ u_int ks_composed_char; /* composed char code (> 0) */ u_char ks_prefix; /* AT scan code prefix */ } atkbd_state_t; @@ -592,6 +593,11 @@ printf("atkbd_read_char(): scancode:0x%x\n", scancode); #endif + /* Don't allow two identical release-scancodes back-to-back */ + if ((scancode & 0x80) && (scancode == state->ks_last_code)) + goto next_code; + state->ks_last_code = scancode; + /* return the byte as is for the K_RAW mode */ if (state->ks_mode == K_RAW) return scancode; @@ -947,6 +953,7 @@ state->ks_polling = 0; state->ks_state &= LOCK_MASK; /* preserve locking key state */ state->ks_accents = 0; + state->ks_last_code = 0; state->ks_composed_char = 0; #if 0 state->ks_prefix = 0; /* XXX */ **************************************************************** >Release-Note: >Audit-Trail: >Unformatted: