Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Layer toggles across ergodox can get stuck in the wrong state #66
With the "stock" ergodox layout, pressing the two f1 keys at the same time (across both keyboards) and then releasing them in order will lock the keyboard in Layer 1 until the process is repeated.
Steps to reproduce:
I'd expect f1 to be cleared when both keys are up, and if you release the second key before the first, this does indeed happen. Also, when using a layout that has multiple f1 keys on the same half-keyboard, this issue does not seem to manifest for those two keys, so it seems that operating across the split is required.
Yep, definitely a bug.
I should be able to fix it in the next few days, but if someone gets impatient, this is where the code is:
Basically, in this function (and the functions calling it) https://github.com/kiibohd/controller/blob/master/Macro/PartialMap/macro.c#L139
I believe what's happening is I'm using an XOR instead of just a set/unset. This means if you pressed two Shift keys at different times (now the layer is temporarily unset). But release them at the same time (I think this is what's happening), it will only unset once.
It should be possible to fix this by strengthening the logic a bit more. Instead of blindly setting every time the function is called.