I'd like to keep a layer turned on as long as keys from that layer are pressed. Only when no more keys from the layer are pressed, it should disengage automatically.
It's related to a more general problem. If multiple &mo presses going to the same layer would stack, it would be easy -- just use a macro on each key that includes a &mo going to the current layer itself. But they don't stack. As soon as the first key is released, the layer gets disengaged, despite others still being held.
I came up with a workaround: Create a copy of the layer for each key in the layer and use macros that include a &mo going to that unique copy. It works, but it's a very cumbersome kludge. Is there a better solution?
#Keeping a layer turned on as long as any key from a certain set is pressed
1 messages · Page 1 of 1 (latest)
Does the auto-layer module work for your use case?
The module is keycode based. If you prefer to define the set of keys that keep a layer on by their key position, you could also use tri-state instead
Instead of &moing to the layer, could you &tog the layer and define each of the keys you don't want to continue to a macro that &togs it back off and sends the key? That's what I do for my custom caps-word layer.
multiple &mo presses going to the same layer would stack
Sounds like a reasonable feature request to me, maybe worth a github issue? (if there isn't one for it already, I didn't check)
I want to stay in the layer only as long as at least one key from the layer is in the pressed state. As soon as all keys from the layer are released, the layer should deactivate by itself. It can very well happen that after letting go of the last key, that same key is the next to get pressed, but then it will hit a behavior on a different layer. There is no press happening in between that could be used to toggle the layer off.
@proud galleon the module doesn't work for the same reasons.
I use this for modifiers, one modifier-layer for each half of the keyboard. I want to be able to press additional modifiers while one of them is being held. So the modifier-layer has to stay active as long as any modifier is held.
I can't find an existing issue, but it's hard to come up with fitting search terms. I guess I'll just create one and see.