I recently acquired a Glove80. A cool ergo keyboard that uses ZMK Firmware. Luckily, if you want to make your own layout, MoErgo has a really nice visual editor. It can do most things, however, some behavior requires custom definitions. They are not hard; but they can be intimidating, especially if you don’t program. Ideally, you should read the layout manual and user guide as well as the zmk docs! But that is a lot of words to read and worst yet, it doesn’t have the most minimal setup for given examples. Replacing that many words with this “short” post is not going to be enough. But it should be a good starting point.

This guide is focused on MoErgo, their editor, and not general ZMK firmware.

Update Keyboard with new Layout

Updating your keyboard with a new layout is really easy. You will select the layout you want to load onto your keyboard, and click on “build firmware”. It will take some time, but after about a minute, a file will be downloaded onto your computer.
Now update each half. First, plug in the right half (RH) and put it in bootloader mode. This is done through the magic layer (default is magic + ' for RH). An “eternal drive” should pop up. All you need to do now, is drag the downloaded file into this drive. You do not need to rename it or anything. The RH will process the file and auto close the drive.
Now do the same thing for the left side. Bootloader default is magic + esc.
There is a shorter way but this method is easiest to explain and also safer.

If bootloader isn’t working through the magic key, do it manually as seen in this guide. If the manual is updated, it might not be on the page I send you to. Just search for “bootload”

Loading a layout can not kill the board

Stack Keys (Control + ALT + Delete)

No custom behavior is needed here. You can stack modifier keys together in a single key press. Helpful for shortcuts but also for symbols if you use a different language. Here is a full list of modifiers. This will work will all versions of the names that say XX(code).

Control + A would look like: LC(A)
Control + ALT + Delete: LC(LA(DEL))

However, you don’t just type it like that. Select the behavior of the key to be &kp and then select the first modifier function you want to use. For example LC. After selecting it, your editor should show something like LC( ⊘ ). And if you click on the , you will be able to select the next key.

Note for non en-US users

There are symbols defined under things like Dollar. However, they are deprecated because it secretly is doing LS(4). If your language has it somewhere else, you will need to define your symbols with stacked keys and not just $.

Double Tap Behavior (tap-dance)

ZMK has a thing called tap-dance. With it, you can specify different behavior based on how many times you tap a key. I will be implementing the simple example they give; have a look at this simplified layout.

Tap the left pointer finger once, twice, or three times in quick succession. The number of taps will show up. The specified behavior is found in the Custom Defined Behaviors section. There is also the J key if you want to experiment with an interrupt key.

behaviors {
    td0: tap_dance_0 {
        compatible = "zmk,behavior-tap-dance";
        #binding-cells = <0>;
        tapping-term-ms = <200>;
        bindings = <&kp N1>, <&kp N2>, <&kp N3>;
    };
};

I will not just rehash what is said in the docs. Please read it if you can. The example layout is just to show you how to implement it in the MoErgo editor.

A Simple Macro

The macro behavior allows configuring a list of other behaviors to invoke when the macro is pressed and/or released. For a full explanation, read the docs.

To make a macro, you will need to define a few things

macros {
    zed_em_kay: zed_em_kay {
        compatible = "zmk,behavior-macro";
        #binding-cells = <0>;
        bindings
            = <&macro_press &kp LSHFT>
            , <&macro_tap &kp Z &kp M &kp K>
            , <&macro_release &kp LSHFT>
            ;
    };
};
  • compatible is defining what type of behavior this block should take
  • binding-cells is the amount of parameters the macro takes (you can make dynamic macros)
  • bindings is a queue of instructions to take.

An example of this in action

Intro to Home Row Mods

The very rough idea, is that you can make keys hold multiple uses. The “home row” (asdf/jkl;) requires the least amount of effort to move hit. When holding down these keys, make them do something else, like SHIFT or ALT or go to a new layer. That is the rough idea.
For an extensive look into home row mods, read this

Home row mods is achieved through custom behavior. An example of what one of these behaviors might look like:

homey_right: home_row_mods_right_hand {
    compatible = "zmk,behavior-hold-tap";
    label = "HOME_ROW_MODS_RIGHT_HAND";
    flavor = "balanced";
    hold-trigger-key-positions = <LEFT_HAND_KEYS THUMB_KEYS>;
    hold-trigger-on-release; // wait for other home row mods
    tapping-term-ms = <280>;
    require-prior-idle-ms = <150>;
    #binding-cells = <2>;
    bindings = <&kp>, <&kp>;
};

Very scary looking stuff. Luckily, you don’t have to invent the wheel. Plenty of people who use Glove80 also use home row mods (and plenty don’t.) Have a look at the search section of the editor to see examples. Or just use one that someone made.

For a really high quality layout that has everything you could ever need, have a look at Sunaku’s work.