Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754696Ab0AIPPa (ORCPT ); Sat, 9 Jan 2010 10:15:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754658Ab0AIPP3 (ORCPT ); Sat, 9 Jan 2010 10:15:29 -0500 Received: from cantor2.suse.de ([195.135.220.15]:36628 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752768Ab0AIPP2 (ORCPT ); Sat, 9 Jan 2010 10:15:28 -0500 Date: Sat, 9 Jan 2010 16:15:26 +0100 (CET) From: Jiri Kosina To: Roel Kluin Cc: linux-input@vger.kernel.org, LKML Subject: Re: HID: is scancode correctly reported after key status change in hidinput_hid_event()? In-Reply-To: <4B489B44.50101@gmail.com> Message-ID: References: <4B489B44.50101@gmail.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1213 Lines: 35 On Sat, 9 Jan 2010, Roel Kluin wrote: > vi drivers/hid/hid-input.c +634 and not in hidinput_hid_event() > > /* report the usage code as scancode if the key status has changed */ > if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value) > input_event(input, EV_MSC, MSC_SCAN, usage->hid); > > Only if value is 1 or 0 the input_event() can occur, but value doesn't > seem to be intended to be used as a boolean. are we really doing the > correct test here? Hi Roel, well, value 2 means 'repeated' key, and there is no other possibility for EV_KEY value than 0,1,2. For EV_KEY events generated by HID devices, the autorepeat is done by input core (as the device sends the report only when status is changed), so there is no easy way how to inject EV_MSC into the 'autorepeat reports' anyway. Are you hitting some bug because of this, or have you found this out solely by code reading? Thanks, -- Jiri Kosina SUSE Labs, Novell Inc. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/