JonnyHaystack / HayBox

Modular cross-platform firmware for digital or mixed analog/digital game controllers
GNU General Public License v3.0
183 stars 231 forks source link

Spams buttons when swapping to a Keyboard mode on a Pico #21

Open UMS-Ultra opened 2 years ago

UMS-Ultra commented 2 years ago

When inputting the button combination for a Keyboard mode on a Pico, the device will rapidly spam those same 3 keys for maybe a second. For example, when inputing the Default Keyboard mode, it will spit out A, F, and H repeatedly in a long sequence. The sequence is variable, and appears to be related to how long all 3 buttons where held down after the button combination was inputed.

JonnyHaystack commented 2 years ago

This is known, it is caused by the keyboard mode being rapidly constructed/destructed many times very quickly

ribbanya commented 1 year ago

Would something like this fix the issue? I wrote this for Smash Box rocker toggles but it also ensures that you can't switch to the current mode.

https://github.com/JonnyHaystack/HayBox/blob/3459f03b3f41987e806ef094073a03cef9dd3e52/config/mode_selection.hpp#L70-L98

JonnyHaystack commented 1 year ago

Yeah, it makes it significantly more complicated for the average user to edit the mode bindings though, which I'd prefer to avoid. I feel like the real problem is just the way keyboard modes themselves exist in the current architecture. It doesn't really fit in well. Especially considering they don't even work with XInputBackend which is the default on Pico now, so you need to hold a button on plugin as well. Gonna have to redesign it at some point.