From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Herrmann Subject: Re: [PATCH] Handle spurious backslash key repeats on some keyboards Date: Thu, 11 Sep 2014 14:41:25 +0200 Message-ID: References: <1407664566-5303-1-git-send-email-megahallon@gmail.com> <20140910225134.GH38736@core.coreip.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-ig0-f176.google.com ([209.85.213.176]:58294 "EHLO mail-ig0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754600AbaIKMl0 (ORCPT ); Thu, 11 Sep 2014 08:41:26 -0400 Received: by mail-ig0-f176.google.com with SMTP id hn15so840500igb.9 for ; Thu, 11 Sep 2014 05:41:25 -0700 (PDT) In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Fredrik Hallenberg Cc: Dmitry Torokhov , Jiri Kosina , "open list:HID CORE LAYER" Hi On Thu, Sep 11, 2014 at 10:50 AM, Fredrik Hallenberg wrote: >>> The nicest fix, obviously, is to blacklist keys that are not >>> physically present on the keyboard. But I assume the keyboard reports >> >> Hmm, somebody could still load keymap with duplicate keycodes though... >> > > The HID mapping is hardcoded, so only key code 43 will have this > problem regardless of user keymaps. I think Dmitry is talking about setkeycode() which can change the keycode a scancode is mapped to. This is indeed a problem, but I thought we implicitly tell people to not map two scancodes to the same keycode.. we simply don't support it (as we only have 1bit state per keycode, and 0bit per scancode). But this reminds me: we can use udev hwdb and setkeycode() to fix your keyboard. Simply add this to /lib/udev/hwdb.d/60-keyboard.hwdb: keyboard:name:*Corsair*:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr* KEYBOARD_KEY_32=0 this will run setkeycode(0x32, KEY_RESERVED) and thus disable the key 0x32 entirely. Adding properly crafted match-rules to udev should solve this mess, I guess. Imho, this is the cleanest solution, but depends on udev, of course. Thanks David