From: Fredrik Hallenberg <megahallon@gmail.com>
To: linux-input@vger.kernel.org, nveber@tamariongroup.com
Subject: Backslash repeat bug
Date: Fri, 8 Aug 2014 16:11:56 +0200 [thread overview]
Message-ID: <CAMsZVf-Y5202EyYod+ZDfjEd_OS7N2oOFYEMniCc5Z12B14uqA@mail.gmail.com> (raw)
Hi,
On my Corsair K70 keyboard, when pressing some key and then the
backslash key (KEY_BACKSLASH) in rapid succession the backslash
character will be repeated three times. This bug has been mentioned on
this list before (by Norbert Veber on the 24th of februrary) but there
was no responses, also Norbert consider it a problem with Corsair
keyboards but as I describe below I feel it is more of a general
problem in the HID input code.
This bug is discussed on the Corsair forums, but it seems the exact
same thing also happens with Gigabyte Osmium and QPAD MK85, possibly
it is a problem on all keyboards supporting n-key rollover.
I believe the root cause of this is that the keyboard reports all keys
including both HID keys 0x31 and 0x32 which are both mapped to
KEY_BACKSLASH in hid-input.c. I am using a nordic keyboard meaning
KEY_BACKSLASH is labeled "apostrophe" and that HID key 0x32 is
reported. A US keyboard has a backslash key which should report 0x31.
I have added some traces before the input_event call at the end of
hidinput_report_event. When pressing A key and then apostrophe,
something like this is seen (omitting all inactive 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
VALUE 1 CODE 43 HID 0x32
Output: '
VALUE 0 CODE 30 HID 0x4
VALUE 0 CODE 43 HID 0x31
VALUE 1 CODE 43 HID 0x32
Output: '
VALUE 0 CODE 30 HID 0x4
VALUE 0 CODE 43 HID 0x31
VALUE 1 CODE 43 HID 0x32
Output: '
VALUE 0 CODE 30 HID 0x4
VALUE 0 CODE 43 HID 0x31
VALUE 0 CODE 43 HID 0x32
So the fact that 0x31 is inactive will cause bad release events on key
43 to be sent.
I have made a simple patch that tracks which of the two variants is
active and ignores the other one. It works but I don't have much
knowledge on HID input so before posting it would like to know if
someone has input on how to do a cleaner fix. I am happy to help with
testing or implementation if I am able.
Regards,
Fredrik
next reply other threads:[~2014-08-08 14:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 14:11 Fredrik Hallenberg [this message]
2014-08-08 16:08 ` Backslash repeat bug Fredrik Hallenberg
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=CAMsZVf-Y5202EyYod+ZDfjEd_OS7N2oOFYEMniCc5Z12B14uqA@mail.gmail.com \
--to=megahallon@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=nveber@tamariongroup.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).