linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Backslash repeat bug
@ 2014-08-08 14:11 Fredrik Hallenberg
  2014-08-08 16:08 ` Fredrik Hallenberg
  0 siblings, 1 reply; 2+ messages in thread
From: Fredrik Hallenberg @ 2014-08-08 14:11 UTC (permalink / raw)
  To: linux-input, nveber

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Backslash repeat bug
  2014-08-08 14:11 Backslash repeat bug Fredrik Hallenberg
@ 2014-08-08 16:08 ` Fredrik Hallenberg
  0 siblings, 0 replies; 2+ messages in thread
From: Fredrik Hallenberg @ 2014-08-08 16:08 UTC (permalink / raw)
  To: linux-input

I just found bugzilla bug #70181 which is the same problem as I
describe but seen with a QPAD MK-85 keyboard. I will add my findings
to that bug.

On Fri, Aug 8, 2014 at 4:11 PM, Fredrik Hallenberg <megahallon@gmail.com> wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-08 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-08 14:11 Backslash repeat bug Fredrik Hallenberg
2014-08-08 16:08 ` Fredrik Hallenberg

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).