hid-remapper icon indicating copy to clipboard operation
hid-remapper copied to clipboard

Crazy behaviour with rollover/ghosting

Open columna1 opened this issue 2 years ago • 6 comments

Using this HID remapper I sometimes get really weird key repeats and such when typing. I have done some research and have come to the conclusion that this likely has to do with ghosting/rollover sending all 0x01 bytes in the keycode report when there is an error state. This likely causes prev_input_state to be overwritten with all 0x01 or something similar making hid-remapper think the keys are no longer pressed. Then, when the keyboard comes out of error state and sends the rest of the keys currently pressed hid-remapper thinks that all of those keys are pressed sends them all again a second time. this results in things like in colemak the "oul" keys when pressed on a cheap hp keyboard gives an error state. (; I and U keys in qwerty) leading to things like typing "could" resulting in "cououllud" or something similar. I would assume we want to ignore packets that have that error state or at least prevent updating the keyboard state when one is received. I am able to reproduce this when using a proper 6-key rollover keyboard and pressing more than 6 keys.

columna1 avatar May 10 '23 22:05 columna1

Good catch!

jfedor2 avatar May 11 '23 08:05 jfedor2

I just want to clarify, on some keyboards this can occur when pressing as little as 3 keys at once, it's not just a 6kRO (only) bug. That's why it was an issue with my cheap company provided keyboard at work. I was hitting this when typing normally.

columna1 avatar Nov 22 '23 19:11 columna1

I haven't forgotten about this!

jfedor2 avatar Nov 22 '23 21:11 jfedor2

If you still have access to that keyboard and are up for some testing, you can try a test build from here (the artifact link at the bottom):

https://github.com/jfedor2/hid-remapper/actions/runs/6973886250

I'm not sure if it's necessarily the solution I want to go with, but it's one possible solution.

jfedor2 avatar Nov 23 '23 20:11 jfedor2

Sorry for the delay. I've managed to test the firmware you provided and it works great.

columna1 avatar Nov 25 '23 12:11 columna1

The latest official release also contains a (different) fix for this!

jfedor2 avatar Jan 10 '24 18:01 jfedor2