Understanding/modifying Keybow 2040 hid-keypad-fifteen-layers.py


First post, so hope doing everything correctly and not over asking. I searched the forums for answers to this but no one seems to have posted. I’m looking at :

Which is improves on hid-keys-advanced.py by making all keys usable bar the ‘modifier’ key. So that’s 15 keys assignable per layer, rather than 12.

I’d like to do two things, but struggling, so if anyone had any hints that would be much appreciated please.

  • I was wondering what the ‘dictionary of sets’ code was doing from line 118 onwards. I’d been trying to move the modifier key to top right instead of bottom left, and thought I’d changed the code appropriately, but couldn’t seem to get it to work. This was the only bit in the original code that I didn’t understand what it was doing, so thought the problem could lie in there.

  • I was thiniking since I only want a limited number of layers (3), that it would be quicker to just tap the modifier button to cycle through them. (Rather than holding down the modifier and selecting a layer to go to). Is this possible? I guess part of the code for that would look a little bit like:

if current_layer ==1:
current_layer = 2
elif current_layer == 2:
current_layer = 3
elif current_layer == 3:
current_layer = 1

But I’m not sure where to go beyond that as it quite fundamentally changes how the code works now. Realise this is a big ask, so appreciate any hints.

Thank you!