keyboardio / Kaleidoscope

Firmware for Keyboardio keyboards and other keyboards with AVR or ARM MCUs.
http://keyboard.io
GNU General Public License v3.0
756 stars 259 forks source link

multiple ShiftToLayer keys should behave like one #1438

Open mrwonko opened 1 week ago

mrwonko commented 1 week ago

Describe the bug When I press both of my "fun" keys and release one, the layer shift is undone.

To Reproduce Bind two keys to Shift to Layer 2. Hold both of them. Release one.

Expected behavior While at least one of the Shift to Layer keys for the same layer is held, I want to stay on that layer. The shift should only be undone once I release all the shift keys, similarly to how holding both "shift" keys on a keyboard and releasing one still lets me write uppercase.

Environment (please complete the following information):

Additional context I originally reported this bug in the Chrysalis repo, but I now realize it probably belongs here.

Rom1deTroyes commented 1 week ago

Does your keys on Layer 2 also Shift to Layer 2 ?

If :

As you can't press e and u exactly at the same time (one of the keys will be scanned before the other), you will have a sequence like :

or the opposite :

Now, in this second case, if you release one of the key :

I agree that the comparison with the behavior of the 2 Shift keys on a legacy keyboard is straightforward and is of course confusing !

I don't have my Model100 under the hand to make a full test case, and I'm not sure we can Shift to the same Level we already are (I think there was discussions about that long ago ?), but maybe this can help to find a way to achieve this ?

Happy hacking :-)

mrwonko commented 6 days ago

Does your keys on Layer 2 also Shift to Layer 2 ?

They're set to transparent on Layer 2, so they should retain their "Shift to Layer 2" binding from Layer 0.

on Layer 1, you have e and u both configured as e and u, with a Shift to Layer 2

I don't understand the "with a Shift to Layer 2" part. I have dedicated keys for layer shifting, it's not a side-effect of entering a different button. So staying with the e and u example, they would both be configured to only Shift to Layer 2, without triggering an e or u press. So I may press one or both of them, and then e.g. h j k l change to arrow keys.