Are there any plans/effort to create a way for easy keymap switching? (I did search the forum but have not found anything regarding this topic)
Some background: I use the dvorak layout on my keyboard, but also on regular basis I have someone else use my computer that is not a dvorak user. In the past using a classic keyboard I was just selecting the keyboard mapping in the OS selector (OS X, Windows, Linux I use all of them). Using that solution on the Model 01 is not optimal as I end up with a bunch of special characters hidden under the palm key overlay, when using dvorak.
I would be happy with either of the two following solutions:
a dedicated program that with one or two clicks can swap the layout programming of the keyboard
a key combination on the keyboard to switch between two different keyboard mappings within kaleidoscope
This is actually quite easy and straightforward to do with Kaleidoscope. The default firmware sketch from the factory has only three keymap layers, but you can define many more than that if you want (up to 32, but the practical limit is space in program memory). I makes a lot of sense for a Dvorak user to also have a QWERTY layer for other occasional users, and switching between them is pretty easy using a LockLayer key. I’d be surprised if nobody has done exactly this yet.
See my sketch here; I defined another layer (_QWERTY), then configured the Leader plugin so I can press the Lead(0) key (which I have on the Any key), then L (for layout) then either Q for QWERTY or D for Dvorak.
This is what I ended up doing with mine, but there are a few limitations with that approach. I set the butterfly key to switch between the two, but I do find myself accidentally hitting it from time to time. Ideally, I’d want a key combination, or something on the Function layer to handle this, but I found when I tried to do this it was impossible to get back to the original layer after switching.
The way other LockLayers work, like NumLock, for example, is by having the key fall through on the locked layer, at which point Kaleidoscope finds the original LockLayer and undoes it. For one reason or another, if the original LockLayer is on the Function layer, pressing the same key again will not find it on the stack, so it won’t be reverted, and you’ll be stuck.
Anyway, the unmodified butterfly key seems to work well enough, but it really would be nice to have a more robust solution. As it stands, it’s impossible to scale this to three or more layouts, since the fallthrough logic will just find the last LockLayer. It’s just a hack for switching between QWERTY and Dvorak.
You can avoid the problem of getting a layer stuck by having a LockLayer(DVORAK) key on the QWERTY (base) layer, and the same key defined as LockLayer(DVORAK) on the DVORAK layer. The name LockLayer() is a bit misleading; it actually causes the target layer to be toggled, so it’s turned on if it was off, and off if it was on. You don’t need to rely on transparent keys and other layers to be able to turn off a “locked” layer – in fact, I would recommend having a LockLayer(N) key on any layer that can be activated by a LockLayer(N) key from a different layer.
This gives me an idea. @algernon, what do you think of the idea of a layer-switch Key value that’s reserved for “unlock this layer”, which does a lookup of whatever layer that key is mapped from, and turns it off?
Interesting, so if I had four layers:
DVORAK, FUNCTION_DVORAK, QWERTY, and FUNCTION_QWERTY
And then on FUNCTION_DVORAK I had the butterfly key bound to LockLayer(QWERTY), and on FUNCTION_QWERTY I had the same key bound to LockLayer(QWERTY), then when I hit Fn+BF the second time, when I released Fn, it would pop the FUNCTION_QWERTY layer, see that QWERTY was disabled, and then fall through to DVORAK?