From owner-freebsd-bugs@FreeBSD.ORG Thu Feb 23 09:30:10 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org 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 20B0416A420 for ; Thu, 23 Feb 2006 09:30:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95FE643D46 for ; Thu, 23 Feb 2006 09:30:09 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k1N9U93T096696 for ; Thu, 23 Feb 2006 09:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k1N9U9EP096695; Thu, 23 Feb 2006 09:30:09 GMT (envelope-from gnats) Resent-Date: Thu, 23 Feb 2006 09:30:09 GMT Resent-Message-Id: <200602230930.k1N9U9EP096695@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, Norbert Koch Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B121216A420 for ; Thu, 23 Feb 2006 09:29:16 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86BAF43D49 for ; Thu, 23 Feb 2006 09:29:16 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k1N9TGDK075037 for ; Thu, 23 Feb 2006 09:29:16 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k1N9TG5M075036; Thu, 23 Feb 2006 09:29:16 GMT (envelope-from nobody) Message-Id: <200602230929.k1N9TG5M075036@www.freebsd.org> Date: Thu, 23 Feb 2006 09:29:16 GMT From: Norbert Koch To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: kern/93738: ukbd_check_char returns FALSE with character buffered X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2006 09:30:10 -0000 >Number: 93738 >Category: kern >Synopsis: ukbd_check_char returns FALSE with character buffered >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 23 09:30:08 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Norbert Koch >Release: RELENG-4/RELENG-6 >Organization: >Environment: >Description: When playing around with kbdmux I found scan codes coming from my (secondary) usb keyboard mixed with those coming from my primary keyboard. An Example: 1. Numpad-Enter on the usb keyboard 2. ESC on the ps/2 keyboard 3. Numpad-Enter on the usb keyboard This results in the following sequence: E0 1C E0 01 81 9C E0 1C E0 ++++++++ +++++ ++ ++++++++ | | | | | | | 2nd Numpad-Enter withount break code | | | | | break code for 1st Numpad-Enter | | | break/make for ESC | 1st Numpad-Enter without break code The problem is in ukbd_check_char() which is different from ukbd_check() in not testing ks_buffered[0]. This leads to ukbd returning the missing break code with the next key pressed on the usb keyboard. This obviously results in a lot of trouble with kbdmux. I managed to have the Xserver returning a permanent state of ctrl key pressed. >How-To-Repeat: >Fix: This patch is against current. --- ukbd.c.orig Thu Feb 23 09:48:44 2006 +++ ukbd.c Thu Feb 23 09:55:00 2006 @@ -1143,6 +1143,10 @@ if (!KBD_IS_ACTIVE(kbd)) return FALSE; state = (ukbd_state_t *)kbd->kb_data; +#ifdef UKBD_EMULATE_ATSCANCODE + if (state->ks_buffered_char[0]) + return TRUE; +#endif if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0)) return TRUE; if (state->ks_inputs > 0) >Release-Note: >Audit-Trail: >Unformatted: