linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: Fredrik Hallenberg <megahallon@gmail.com>,
	Jiri Kosina <jkosina@suse.cz>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>
Subject: Re: [PATCH] Handle spurious backslash key repeats on some keyboards
Date: Wed, 10 Sep 2014 15:51:34 -0700	[thread overview]
Message-ID: <20140910225134.GH38736@core.coreip.homeip.net> (raw)
In-Reply-To: <CANq1E4Q0oiAxDB7osAMrqs=OGEys6GzZh8GDj9B8jAEpxX7now@mail.gmail.com>

On Wed, Sep 10, 2014 at 04:22:13PM +0200, David Herrmann wrote:
> Hi
> 
> On Wed, Sep 10, 2014 at 1:13 PM, Fredrik Hallenberg
> <megahallon@gmail.com> wrote:
> > The keyboards in question have n-key rollover, this seems to be
> > implemented by sending every single key id every time the keyboard is
> > polled, this includes several keys that does not exist physically for
> > example 0x31. This may be a bit excessive but not broken. If I press
> > a-key and '-key in rapid succession, I get the following events
> > (omitting all other keys):
> >
> > VALUE 1 CODE 30 HID 0x4
> > VALUE 0 CODE 43 HID 0x31
> > VALUE 0 CODE 43 HID 0x32
> > Output: a
> >
> > VALUE 1 CODE 30 HID 0x4
> > VALUE 0 CODE 43 HID 0x31  - 43 is up
> > VALUE 1 CODE 43 HID 0x32  - 43 is down
> > Output: '
> >
> > VALUE 0 CODE 30 HID 0x4
> > VALUE 0 CODE 43 HID 0x31  - 43 is up
> > VALUE 1 CODE 43 HID 0x32  - 43 is down
> > Output: '
> >
> > VALUE 0 CODE 30 HID 0x4
> > VALUE 0 CODE 43 HID 0x31  - 43 is up
> > VALUE 1 CODE 43 HID 0x32  - 43 is down
> > Output: '
> >
> > So even though the keyboard is behaving a bit weird the problem is in
> > the kernel as it will interpret 0x31 and 0x32 as the same key.
> 
> Thanks for the information! Please include that in follow-up
> commit-messages so others can see it as well. I don't think a report
> descriptor is needed, anymore.
> 
> This indeed explains the problem. We only track keys on the keycode
> level, not scancode level. Therefore, you get weird key-up or
> key-repeat events depending on the scan-order.
> 
> 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...

>
> either key depending on the model (standard vs. European). Given that
> this key is indeed special as we only have a single keycode for it, we
> probably need some quirk like yours. I'd like to hear Dmitry's
> comments on this, maybe he has had similar problems with non-HID
> keyboards.

Hmm, I do not think we have a good story for duplicate keycodes for
drivers that send entire state as opposed to just changed bits.

Thanks.

-- 
Dmitry

  reply	other threads:[~2014-09-10 22:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-10  9:56 [PATCH] Handle spurious backslash key repeats on some keyboards Fredrik Hallenberg
2014-09-09  9:40 ` Fredrik Hallenberg
2014-09-09  9:42   ` Jiri Kosina
2014-09-09 10:37     ` Fredrik Hallenberg
2014-09-10  8:26   ` Jiri Kosina
2014-09-10 10:09     ` David Herrmann
2014-09-10 11:13       ` Fredrik Hallenberg
2014-09-10 14:22         ` David Herrmann
2014-09-10 22:51           ` Dmitry Torokhov [this message]
2014-09-11  8:50             ` Fredrik Hallenberg
2014-09-11 12:41               ` David Herrmann
2014-09-11 20:35                 ` Fredrik Hallenberg
2014-09-12 10:29                   ` David Herrmann
2014-09-12 11:34                     ` Fredrik Hallenberg
2014-09-12 11:47                       ` David Herrmann
2014-09-12 17:36                         ` Fredrik Hallenberg
2014-12-19 16:28                           ` RH
2014-12-20 19:56                             ` Fredrik Hallenberg
2014-09-14 16:45 ` David Herrmann
2014-09-14 17:03   ` David Herrmann
2014-09-14 22:53   ` Fredrik Hallenberg
2014-09-15  8:29     ` Fredrik Hallenberg
2014-09-15 14:39   ` Benjamin Tissoires
2014-09-15 14:47     ` Benjamin Tissoires
2014-09-15 14:52       ` David Herrmann
2014-09-15 15:14         ` Benjamin Tissoires

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140910225134.GH38736@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=dh.herrmann@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=megahallon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).