jfedor2/hid-remapper

Connected device hotplug results in keyboard not detected if GPIO as first input on reconnect.

Chozo4 opened this issue · 0 comments

Chozo4 commented

Maybe it's a unique issue on my end but it seems to occur on multiple testing machines. Using an RP2040-Zero by Waveshare and currently have it setup with a 4PDT switch as a 'remapper bypass' as the unit is currently integrated as part of the keyboard [A RAKK Ilis]. This is to be able to access keyboard firmware directly as needed by manufacturer software. It operates by disconnecting only the signal lines from the RP2040 on both ends and connecting the signal lines direct to the keyboard. Switching back disconnects the direct connection to the keyboard and reconnects the RP2040 in between as normal.

However, when switching back the RP2040 is detected normal but the keyboard is not detected and no inputs as seen in the monitoring tab. GPIO connected switches however do operate normally regardless.

Perhaps this can be resolved with a simple polling loop to detect device presence and reinitialize if needed?

Edit: Ok, so from more testing it does [occasionally] get detected and inputs are working. However, if you were to activate a GPIO connected input switch [such as GPIO-27 in this case] as the first keypress after hotplug none of the other buttons are detected and only the GPIO's are seen in monitoring. However, pressing any non-GPIO key as the first input results in all keypresses [including GPIO] working as expected.