Page 1 of 1

How do I toggle between two layers (with 3+ layers)?

Posted: Mon Dec 11, 2017 6:05 pm
by badbob001
I want to set a mouse button to toggle between two layers. When I only have two layers, I can just set that button to 'Layer (next)' and it works since the later selection wraps around from 2 to 1. When I wanted 3+ layers but still have that button only toggle between layers 1 and 2, then I can't figure out how to do it.

So with 3+ layers, I can't simply use 'layer (next)'. So I tried under layer 1, have the button trigger 'layer 2'. Then under layer 2, I tried to have the same button trigger back to 'layer 1'. But then I get this error:
You can not add a LAYER X modifier to this layer because another layer already has a layer modifier setup to this layer. Doing so would cause undetermined behavior and is therefore not supported.
I don't really understand the error. Perhaps I'm misunderstanding the 'layer x' command. Is it not a change-to-layer-x command?

Re: How do I toggle between two layers (with 3+ layers)?

Posted: Mon Dec 11, 2017 6:54 pm
by badbob001
I managed to use the simulated key {LAYER:x} to switch to a specific layer. So my config has one mouse button toggle the wheel from up/down to pageup/down and another button to toggle between up/down and home/end.

layer 1 (mouse wheel up/down normal)
mouse 4: {LAYER:2}
mouse 5: {LAYER:3}

layer 2 (mouse wheel page-up/down):
mouse 4: {LAYER:1}
mouse 5: {LAYER:3}

layer 3 (mouse wheel home/end):
mouse 4: {LAYER:1}
mouse 5: {LAYER:4}

layer 4 (mouse wheel up/down normal):
mouse 4: {LAYER:2}
mouse 5: {LAYER:3}

Re: How do I toggle between two layers (with 3+ layers)?

Posted: Mon Dec 11, 2017 11:55 pm
by injtsvetkov
Why don't you use Button chording for that?

Actually I have to admit you've achieved that quite elegantly with the {layer:x} command :), but it seems to me it would be simpler with Button chording.

Re: How do I toggle between two layers (with 3+ layers)?

Posted: Tue Dec 12, 2017 1:07 am
by phil
badbob001 wrote:
Mon Dec 11, 2017 6:05 pm
You can not add a LAYER X modifier to this layer because another layer already has a layer modifier setup to this layer. Doing so would cause undetermined behavior and is therefore not supported.
I don't really understand the error. Perhaps I'm misunderstanding the 'layer x' command. Is it not a change-to-layer-x command?
This is because the layer commands in the drop downs are for when the button is held, not pressed. That is, the layer is changed WHILE you hold the button and when you release it, the layer is changed back. This is why it does not allow you to change the dropdown on the target layer. Your simkey solution is the best bet, because with sim keys, its a change layer (and don't change back when the button is released).

Or perhaps as mentioned, in this particular case, button chording might be just as good/easier to understand!

Re: How do I toggle between two layers (with 3+ layers)?

Posted: Tue Dec 12, 2017 1:41 am
by badbob001
My previous implementation was using chording, but it was tiring to hold the button down throughout a scroll and the layer switching was inconsistent. I then decided I essentially wanted a mode toggle than a modifier key.

Re: How do I toggle between two layers (with 3+ layers)?

Posted: Tue Dec 12, 2017 2:01 pm
by injtsvetkov
Well I'm not sure I understand how you did it with chording but there is no need to change layers. For example I've set "fast scrolling" like that:
RMB+Wheel Up = {MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}
RMB+Wheel Down = {MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}
I use it for my brouser, excel, word etc. and it's very convenient.

Re: How do I toggle between two layers (with 3+ layers)?

Posted: Wed Dec 13, 2017 12:55 am
by phil
injtsvetkov wrote:
Tue Dec 12, 2017 2:01 pm
Well I'm not sure I understand how you did it with chording but there is no need to change layers. For example I've set "fast scrolling" like that:
RMB+Wheel Up = {MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}{MWUP}
RMB+Wheel Down = {MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}{MWDN}
I use it for my brouser, excel, word etc. and it's very convenient.
I think badbob's point is that he does not want to have to hold the button down (chord button) while scrolling. So his solution works using layer toggles...

Re: How do I toggle between two layers (with 3+ layers)?

Posted: Wed Dec 13, 2017 12:12 pm
by injtsvetkov
badbob001 wrote:
Tue Dec 12, 2017 1:41 am
...and the layer switching was inconsistent.
Yea, that makes sense, but he mentioned layer switching while using chording :roll:

Re: How do I toggle between two layers (with 3+ layers)?

Posted: Wed Dec 13, 2017 2:08 pm
by badbob001
injtsvetkov wrote:
Wed Dec 13, 2017 12:12 pm
badbob001 wrote:
Tue Dec 12, 2017 1:41 am
...and the layer switching was inconsistent.
Yea, that makes sense, but he mentioned layer switching while using chording :roll:
The chording method did not use layer switching. Sorry for the confusion.