# Coming from Ergodox - Momentary Layer Toggle possible?

**URL:** <https://community.keyboard.io/t/coming-from-ergodox-momentary-layer-toggle-possible/1264>\
**Category:** Help and Getting Started\
**Created:** [March 17, 2018, 5:07pm UTC](https://community.keyboard.io/t/coming-from-ergodox-momentary-layer-toggle-possible/1264 "2018-03-17T17:07:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![darrenph1](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/darrenph1/32/1065_2.png) [@darrenph1](https://community.keyboard.io/u/darrenph1)\
**Post date:** [March 17, 2018, 5:07pm UTC](https://community.keyboard.io/t/coming-from-ergodox-momentary-layer-toggle-possible/1264/1 "2018-03-17T17:07:09Z")

</div>

Hello, I’ve been looking through a bunch of threads and I’m still not entirely sure I can do what I want. I’d love to change the thumb buttons to something that the Ergodox can do called Momentary Layer Toggle. I’d like the key to change to keymap x when held and send the selected key when tapped.

I’m fairly new to all the programming side of this but I’ve installed and updated the Model-01 firmware through arduino and now trying to wrap my head around the Kaleidoscope (I know I’ll need plugins to get this working if its possible) and/or if trying to go the Chrysalis route would be easier for me.

Is this possible? Thanks.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [March 17, 2018, 5:14pm UTC](https://community.keyboard.io/t/coming-from-ergodox-momentary-layer-toggle-possible/1264/2 "2018-03-17T17:14:40Z")

</div>

Yes, the palm keys already work like that. We call this feature `ShiftToLayer(NAME)`, and works very much like on the ErgoDox.

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [March 17, 2018, 6:00pm UTC](https://community.keyboard.io/t/coming-from-ergodox-momentary-layer-toggle-possible/1264/3 "2018-03-17T18:00:13Z")

</div>

> [@darrenph1](#):
>
> I’d like the key to change to keymap x when held and send the selected key when tapped.

As @algernon mentioned, the palm keys (i.e. `ShiftToLayer(N)`) already do the layer-shift, but if you also want the “send the selected key when tapped”, your best bet is using [Kaleidoscope-Qukeys](https://github.com/gedankenlab/Kaleidoscope-Qukeys) and defining the key as `LT(<layer>, <key>)`. For example, if you want a key to shift to layer `FUNCTION` when held, but send `x` when tapped: `LT(FUNCTION, X)`.

---

<div class="post-metadata">

**Author:** ![darrenph1](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/darrenph1/32/1065_2.png) [@darrenph1](https://community.keyboard.io/u/darrenph1)\
**Post date:** [March 17, 2018, 6:11pm UTC](https://community.keyboard.io/t/coming-from-ergodox-momentary-layer-toggle-possible/1264/4 "2018-03-17T18:11:31Z")

</div>

Thank you! That’s exactly what I was looking for. Now to dive in and figure out how to do it… lol

---

<div class="post-metadata">

**Author:** ![darrenph1](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/darrenph1/32/1065_2.png) [@darrenph1](https://community.keyboard.io/u/darrenph1)\
**Post date:** [March 18, 2018, 12:26am UTC](https://community.keyboard.io/t/coming-from-ergodox-momentary-layer-toggle-possible/1264/5 "2018-03-18T00:26:55Z")

</div>

So I have figured out how to change the keys and reflash the keyboard. I have downloaded and added the Qukeys file to the library. I also understand where to to call up the plugin. What I am not sure about is the use and where that goes and also the set up of the keys. Right now i have it after the plugin call. Is this right and what about the key set up?

// The Kaleidoscope core  
#include “Kaleidoscope.h”

// The Kaleidoscope Qukeys  
#include \<Kaleidoscope-Qukeys.h\>

void setup (){  
Kaleidoscope.use(&Qukeys);  
Kaleidoscope.setup QUKEYS(  
kaleidoscope::Qukey(LT(QWERTY2, Spacebar)), // QWERTY2/Spacebar  
);  
}

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [March 18, 2018, 1:41am UTC](https://community.keyboard.io/t/coming-from-ergodox-momentary-layer-toggle-possible/1264/6 "2018-03-18T01:41:32Z")

</div>

To use it, you need to make three changes to your sketch:

1. Add this line near the top of the file (in the section with similar statements for other plugins):

```auto
#include <Kaleidocope-Qukeys.h>

```

1. In the `setup()` function, add a parameter to the call to `Kaleidoscope.use()` (again, like other plugins): `&Qukeys`. In this case, the order matters; `&Qukeys` should be one of the first plugins in the parameter list in order to work best.

2. In the keymap, replace `Key_Spacebar` on the `QWERTY` layer with `LT(QWERTY2, Spacebar)` (assuming you want that key to activate a layer called `QWERTY2` when held). You don’t need to use the `QUKEYS()` macro at all for this key definition.

---

<div class="post-metadata">

**Author:** ![darrenph1](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/darrenph1/32/1065_2.png) [@darrenph1](https://community.keyboard.io/u/darrenph1)\
**Post date:** [March 18, 2018, 8:41pm UTC](https://community.keyboard.io/t/coming-from-ergodox-momentary-layer-toggle-possible/1264/7 "2018-03-18T20:41:01Z")

</div>

Thank you! I got it working but I’m having an issue with the set up below:

Key\_LeftControl, Key\_Backspace, LT(QWERTY2, Spacebar), LT(QWERTY3, Enter),

The first LT will switch to QWERTY2 when held but does not do spacebar when tapped. The next one works fine QWERTY3 is brought up when held and enter works when tapped. Any ideas?

I’m also getting this if it matters:  
Sketch uses 22520 bytes (78%) of program storage space. Maximum is 28672 bytes.  
Global variables use 2086 bytes (81%) of dynamic memory, leaving 474 bytes for local variables. Maximum is 2560 bytes.  
Low memory available, stability problems may occur.

EDIT:

OK this is weird, its not working right on my Mac that I programmed it on but when moving to my laptop it works perfectly! spacebar works fine. I’ve restarted my mac but the problem persists… strange…
