### Manual Installation of ZMK-Helpers Source: https://github.com/urob/zmk-helpers/blob/main/README.md Demonstrates manual installation methods for ZMK-Helpers. This includes copying the 'zmk-helpers' directory into the 'config' directory or using git submodules. ```sh cd /path/to/zmk-config/ git submodule add -b v2 -- https://github.com/urob/zmk-helpers config/zmk-helpers-repo ln -s zmk-helpers-repo/include/zmk-helpers config/zmk-helpers ``` -------------------------------- ### Basic ZMK Keymap Setup with ZMK Helpers Source: https://context7.com/urob/zmk-helpers/llms.txt This C code demonstrates the basic setup for a ZMK keymap file using ZMK Helpers. It includes necessary headers for behaviors, key labels, and unicode characters, along with custom layer definitions. ```c #include #include #include "zmk-helpers/helper.h" #include "zmk-helpers/key-labels/34.h" #include "zmk-helpers/unicode-chars/german.dtsi" #define DEF 0 #define NAV 1 #define NUM 2 ``` -------------------------------- ### Install ZMK-Helpers using west.yml Source: https://github.com/urob/zmk-helpers/blob/main/README.md This snippet shows how to add ZMK-Helpers as a module to your ZMK project's west.yml file. It involves defining remotes and projects to fetch the helper repository. ```yaml manifest: remotes: - name: zmkfirmware url-base: https://github.com/zmkfirmware - name: urob url-base: https://github.com/urob projects: - name: zmk remote: zmkfirmware revision: v0.3 # Set to desired ZMK release. import: app/west.yml - name: zmk-helpers remote: urob revision: v0.3 # Should match ZMK release. self: path: config ``` -------------------------------- ### Configure Custom Unicode Input for ZMK Helpers Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Defines custom sequences for initializing and terminating Unicode input for ZMK helpers on non-default operating systems or input channels. This example uses Ctrl+Shift+U to initialize and Space to terminate. ```c #define OS_UNICODE_LEAD ¯o_press &kp LCTRL &kp LSHFT ¯o_tap &kp U #define OS_UNICODE_TRAIL ¯o_tap &kp SPACE ¯o_release &kp LCTRL &kp LSHFT #include "zmk-helpers/helper.h" ``` -------------------------------- ### ZMK Combo Configuration using Key-labels (C) Source: https://github.com/urob/zmk-helpers/blob/main/docs/key_labels.md This example shows how to define ZMK combos using standardized key-labels. It configures 'copy' and 'paste' actions triggered by specific key combinations on the left bottom row, active on all layers. ```c ZMK_COMBO(copy, &kp LC(C), LB2 LB3, ALL) ZMK_COMBO(paste, &kp LC(V), LB1 LB2, ALL) ``` -------------------------------- ### Include ZMK Helper and German Language File (Windows) Source: https://github.com/urob/zmk-helpers/blob/main/README.md This C code snippet demonstrates how to include the main ZMK helper file and a specific language file (German) for Windows. It assumes WinCompose is installed on the system. ```c #include "zmk-helpers/helper.h" #include "zmk-helpers/unicode-chars/german.dtsi" ``` -------------------------------- ### Update C Include Paths for ZMK Helpers Source: https://github.com/urob/zmk-helpers/blob/main/docs/migration-to-v2.md This snippet demonstrates how to update C preprocessor include paths when migrating from an older zmk-nodefree-config to the new zmk-helpers library. It shows the transformation of direct and sub-directory includes to use the new library's structure. ```c // old: #include "../zmk-nodefree-config/helper.h" #include "../zmk-nodefree-config/keypos_def/keypos_34keys.h" #include "../zmk-nodefree-config/international_chars/german.dtsi" // new: #include "zmk-helpers/helper.h" #include "zmk-helpers/key-labels/34.h" #include "zmk-helpers/unicode-chars/german.dtsi" ``` -------------------------------- ### Install ZMK Helpers as Zephyr Module Source: https://context7.com/urob/zmk-helpers/llms.txt This snippet shows how to add ZMK Helpers as a module to your ZMK firmware project by modifying the `config/west.yml` file. It involves defining remotes and projects for the ZMK firmware and the zmk-helpers repository. ```yaml manifest: remotes: - name: zmkfirmware url-base: https://github.com/zmkfirmware - name: urob url-base: https://github.com/urob projects: - name: zmk remote: zmkfirmware revision: v0.3 import: app/west.yml - name: zmk-helpers remote: urob revision: v0.3 self: path: config ``` -------------------------------- ### Configure keymap-drawer for ZMK Additional Includes with Local Path (YAML) Source: https://github.com/urob/zmk-helpers/blob/main/docs/keymap_drawer.md This configuration snippet demonstrates how to specify a local path to the zmk-helpers include directory within the keymap-drawer configuration file. This is useful when zmk-helpers is not installed as a Zephyr module but is available at a known location on the filesystem. ```yaml parse_config: zmk_additional_includes: ["/path/to/zmk-helpers/include"] ``` -------------------------------- ### Define and Add ZMK Layers to Keymap Source: https://context7.com/urob/zmk-helpers/llms.txt The ZMK_LAYER macro is used to define custom keyboard layers. Layers are ordered by their call sequence in the keymap. The macro allows for complex key assignments, including transparent keys (`&trans`) and modifier combinations. The example shows definitions for a default layer and a navigation layer. ```c #define DEF 0 #define NAV 1 #define NUM 2 #define ___ &trans ZMK_LAYER(default_layer, // ๐žพบ๏ธโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จโ€๐Ÿ’จ ``` -------------------------------- ### Include ZMK-Helpers in Keymap Source: https://github.com/urob/zmk-helpers/blob/main/README.md Shows how to include the main ZMK-Helpers header file and optional language-specific or key-label files in your ZMK keymap. This makes the helper macros available for use. ```c #include "zmk-helpers/helper.h" // Source desired key-position labels #include "zmk-helpers/key-labels/glove80.h" // Source unicode-chars for desired languages #include "zmk-helpers/unicode-chars/german.dtsi" ``` -------------------------------- ### ZMK Keymap Configuration Source: https://context7.com/urob/zmk-helpers/llms.txt This C code defines a complete ZMK keymap, including custom behaviors, layers, and combos. It utilizes ZMK's macros and behavioral definitions to create advanced key functionalities. Dependencies include ZMK's standard behavior headers and custom helper files. ```c #include #include #include "zmk-helpers/helper.h" #include "zmk-helpers/key-labels/34.h" #include "zmk-helpers/unicode-chars/german.dtsi" #define ___ &trans #define DEF 0 #define NAV 1 #define NUM 2 #define GER 3 // Define key groups for positional homerow mods #define KEYS_L LT0 LT1 LT2 LT3 LT4 LM0 LM1 LM2 LM3 LM4 LB0 LB1 LB2 LB3 LB4 #define KEYS_R RT0 RT1 RT2 RT3 RT4 RM0 RM1 RM2 RM3 RM4 RB0 RB1 RB2 RB3 RB4 #define THUMBS LH1 LH0 RH0 RH1 // Homerow mods with opposite-hand trigger ZMK_HOLD_TAP(hml, flavor = "balanced"; tapping-term-ms = <280>; require-prior-idle-ms = <150>; hold-trigger-key-positions = ; hold-trigger-on-release; bindings = <&kp>, <&kp>; ) ZMK_HOLD_TAP(hmr, flavor = "balanced"; tapping-term-ms = <280>; require-prior-idle-ms = <150>; hold-trigger-key-positions = ; hold-trigger-on-release; bindings = <&kp>, <&kp>; ) // Custom behaviors ZMK_TAP_DANCE(copy_cut, tapping-term-ms = <200>; bindings = <&kp LC(INS)>, <&kp LC(X)>; ) ZMK_MOD_MORPH(bs_del_num, bindings = << NUM BSPC>, <&kp DEL>; mods = <(MOD_LSFT|MOD_RSFT)>; ) ZMK_MACRO(win_sleep, wait-ms = <100>; tap-ms = <5>; bindings = <&kp LG(X) &kp U &kp S>; ) ZMK_UNICODE_SINGLE(euro_sign, N2, N0, A, C) // Tri-layer: NAV + NUM = GER ZMK_CONDITIONAL_LAYER(ger, NAV NUM, GER) // Combos ZMK_COMBO(sleep, &win_sleep, RT3 RT4, NAV) ZMK_COMBO(copy_cut, ©_cut, LB2 LB3, ALL) ZMK_COMBO(paste, &kp LS(INS), LB1 LB2, ALL) // Layers ZMK_LAYER(default_layer, &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SQT &hml LGUI A &hml LALT R &hml LCTRL S &hml LSHFT T &kp G &kp M &hmr RSHFT N &hmr LCTRL E &hmr LALT I &hmr LGUI O &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp SEMI < NAV SPACE &kp RET &bs_del_num &sk LSHFT ) ZMK_LAYER(nav_layer, ___ ___ ___ ___ ___ &kp PG_UP &kp HOME &kp UP &kp END ___ &sk LGUI &sk LALT &sk LCTRL &sk LSHFT ___ &kp PG_DN &kp LEFT &kp DOWN &kp RIGHT ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ) ZMK_LAYER(num_layer, &kp ESC &kp N7 &kp N8 &kp N9 ___ ___ ___ ___ ___ ___ &kp TAB &kp N4 &kp N5 &kp N6 ___ ___ &sk RSHFT &sk LCTRL &sk LALT &sk LGUI ___ &kp N1 &kp N2 &kp N3 ___ ___ ___ ___ ___ ___ &kp N0 ___ ___ ___ ) ZMK_LAYER(german_layer, ___ ___ ___ ___ ___ ___ ___ &de_ue ___ ___ &de_ae ___ &de_eszett ___ ___ ___ ___ &euro_sign ___ &de_oe ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ) ``` -------------------------------- ### Custom Unicode Input Configuration (ZMK) Source: https://github.com/urob/zmk-helpers/blob/main/README.md This C code snippet demonstrates a custom configuration for ZMK's Unicode input. It defines macros for initiating and terminating the Unicode sequence using specific key combinations before including the helper and language files. ```c #define OS_UNICODE_LEAD ¯o_press &kp LCTRL &kp LSHFT ¯o_tap &kp U #define OS_UNICODE_TRAIL ¯o_tap &kp SPACE ¯o_release &kp LCTRL &kp LSHFT #include "zmk-helpers/helper.h" #include "zmk-helpers/unicode-chars/german.dtsi" ``` -------------------------------- ### Configure Linux HOST_OS for ZMK Unicode Helpers Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Sets the HOST_OS to 1 for Linux systems to enable ZMK's Unicode helper functionality. This should be done before including the helper.h file. Note that alternative configurations might be necessary for non-default Linux Unicode input methods. ```c #define HOST_OS 1 #include "zmk-helpers/helper.h" ``` -------------------------------- ### Configure macOS HOST_OS for ZMK Unicode Helpers Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Sets the HOST_OS to 2 for macOS systems to enable ZMK's Unicode helper functionality. This should be done before including the helper.h file. Ensure 'Unicode Hex Input' is enabled in system preferences. ```c #define HOST_OS 2 #include "zmk-helpers/helper.h" ``` -------------------------------- ### Include ZMK Helper and German Language File (Linux) Source: https://github.com/urob/zmk-helpers/blob/main/README.md This C code snippet shows how to include ZMK helper and German language files for Linux. It requires setting the HOST_OS macro to 1 before including the files. ```c #define HOST_OS 1 #include "zmk-helpers/helper.h" #include "zmk-helpers/unicode-chars/german.dtsi" ``` -------------------------------- ### Include ZMK Helper and German Language File (macOS) Source: https://github.com/urob/zmk-helpers/blob/main/README.md This C code snippet illustrates including ZMK helper and German language files for macOS. It requires setting the HOST_OS macro to 2, assuming Unicode Hex Input is enabled in system preferences. ```c #define HOST_OS 2 #include "zmk-helpers/helper.h" #include "zmk-helpers/unicode-chars/german.dtsi" ``` -------------------------------- ### Configure keymap-drawer for ZMK Additional Includes (YAML) Source: https://github.com/urob/zmk-helpers/blob/main/docs/keymap_drawer.md This configuration snippet shows how to add the 'zmk-helpers/include' directory to the list of ZMK additional includes for keymap-drawer. This is necessary for keymap-drawer to correctly parse ZMK keymaps when zmk-helpers is used as a Zephyr module. ```yaml parse_config: zmk_additional_includes: ["zmk-helpers/include"] ``` -------------------------------- ### Include Key-Labels for Keyboard Layouts (C) Source: https://context7.com/urob/zmk-helpers/llms.txt The Key-Labels system provides standardized, human-readable names for key positions, simplifying keymap definitions. It uses a convention `` and requires including specific header files based on the keyboard's key count. This system enhances readability and maintainability of keymap configurations. ```c // Include key-labels for your keyboard #include "zmk-helpers/key-labels/34.h" // 34-key boards (Sweep, Ferris) #include "zmk-helpers/key-labels/36.h" // 36-key boards (5-col Corne) #include "zmk-helpers/key-labels/42.h" // 42-key boards (Corne) #include "zmk-helpers/key-labels/glove80.h" // Glove80 /* 34 KEY MATRIX / LAYOUT MAPPING โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚ 0 1 2 3 4 โ”‚ 5 6 7 8 9 โ”‚ โ”‚ LT4 LT3 LT2 LT1 LT0 โ”‚ RT0 RT1 RT2 RT3 RT4 โ”‚ โ”‚ 10 11 12 13 14 โ”‚ 15 16 17 18 19 โ”‚ โ”‚ LM4 LM3 LM2 LM1 LM0 โ”‚ RM0 RM1 RM2 RM3 RM4 โ”‚ โ”‚ 20 21 22 23 24 โ”‚ 25 26 27 28 29 โ”‚ โ”‚ LB4 LB3 LB2 LB1 LB0 โ”‚ RB0 RB1 RB2 RB3 RB4 โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ 30 31 โ”‚ 32 33 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ LH1 LH0 โ”‚ RH0 RH1 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ Label convention: - L/R = Left/Right side - T/M/B = Top/Middle/Bottom row - N = Number row (above T) - H = Thumb row - 0-4 = Column (0=index finger home, numbered inside-out) */ // Define key groups for positional behaviors #define KEYS_L LT0 LT1 LT2 LT3 LT4 LM0 LM1 LM2 LM3 LM4 LB0 LB1 LB2 LB3 LB4 #define KEYS_R RT0 RT1 RT2 RT3 RT4 RM0 RM1 RM2 RM3 RM4 RB0 RB1 RB2 RB3 RB4 #define THUMBS LH1 LH0 RH0 RH1 // Use labels in combos (much clearer than numeric positions) ZMK_COMBO(copy, &kp LC(C), LB2 LB3, ALL) // Left bottom row, fingers 2 and 3 ZMK_COMBO(paste, &kp LC(V), LB1 LB2, ALL) // Left bottom row, fingers 1 and 2 ``` -------------------------------- ### ZMK_COMBO: Define Key Combos Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Creates a combo that triggers a specified binding when a combination of keys is pressed simultaneously. Supports defining key positions, active layers, timeouts, and prior idle requirements. Can utilize key-labels for easier definition on specific layouts. ```c++ ZMK_COMBO(esc, &kp ESC, 0 1, ALL, 25) ``` ```c++ #include "zmk-helpers/key-labels/34.h" // replace with layout file for your keyboard ZMK_COMBO(copy, &kp LC(C), LB2 LB3) ZMK_COMBO(paste, &kp LC(V), LB1 LB2) ``` -------------------------------- ### Enable Submodule for GitHub Actions Build Source: https://github.com/urob/zmk-helpers/blob/main/README.md This YAML snippet shows how to modify a GitHub Actions workflow file to enable building with submodules. It replaces the default 'build.yml' with 'build-user-config.yml@build-with-submodules'. ```yaml on: [push, pull_request, workflow_dispatch] jobs: build: uses: urob/zmk/.github/workflows/build-user-config.yml@build-with-submodules ``` -------------------------------- ### ZMK_BEHAVIOR: Create Custom Key Behaviors Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Defines a custom behavior instance of a specified type and makes it accessible via a given name. Supports various behavior types like hold_tap, tap_dance, and macro. Requires a unique name, behavior type, and behavior-specific configuration. ```c ZMK_BEHAVIOR(hrm, hold_tap, flavor = "balanced"; tapping-term-ms = <280>; quick-tap-ms = <125>; bindings = <&kp>, <&kp>; ) ``` ```c ZMK_BEHAVIOR(ss_cw, tap_dance, tapping-term-ms = <200>; bindings = <&sk LSHFT>, <&caps_word>; ) ``` ```c++ ZMK_BEHAVIOR(win_sleep, macro, wait-ms = <100>; tap-ms = <5>; bindings = <&kp LG(X) &kp U &kp S>; ) ``` -------------------------------- ### Create a ZMK Layer with ZMK_LAYER Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Defines a new layer for the ZMK keymap. This macro takes a unique name, the layer's layout (bindings), and optionally sensor specifications. Multiple layers can be defined sequentially, with the first defined layer being the lowest. ```C++ ZMK_LAYER(base, // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SQT // โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค &hrm LGUI A &hrm LALT R &hrm LCTRL S &hrm LSHFT T &kp G &kp M &hrm RSHFT N &hrm LCTRL E &hrm LALT I &hrm LGUI O // โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp SEMI // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค &kp ESC < NAV SPACE &kp TAB &kp RET &ss_cw &bs_del_num // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ ) ``` -------------------------------- ### Define Generic ZMK Behaviors with ZMK_BEHAVIOR Source: https://context7.com/urob/zmk-helpers/llms.txt The ZMK_BEHAVIOR macro allows for the creation of custom behavior instances in ZMK firmware. It supports various behavior types like hold-tap, tap-dance, and macros, enabling complex key functionalities with simplified syntax. ```c // Create a custom homerow mod with &hrm // Usage in keymap: &hrm LSHIFT T (yields T on tap, LSHIFT on hold) ZMK_BEHAVIOR(hrm, hold_tap, flavor = "balanced"; tapping-term-ms = <280>; quick-tap-ms = <125>; bindings = <&kp>, <&kp>; ) // Create a tap-dance: sticky-shift on tap, caps-word on double-tap ZMK_BEHAVIOR(ss_cw, tap_dance, tapping-term-ms = <200>; bindings = <&sk LSHFT>, <&caps_word>; ) // Create a Windows sleep macro accessible via &win_sleep ZMK_BEHAVIOR(win_sleep, macro, wait-ms = <100>; tap-ms = <5>; bindings = <&kp LG(X) &kp U &kp S>; ) ``` -------------------------------- ### Define German Umlauts with ZMK Unicode Helper Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Creates macros for German umlauts (รค/ร„, รถ/ร–, รผ/รœ) using the ZMK_UNICODE_PAIR macro. This allows for easy mapping of these characters to key combinations. ```c++ // name unshifted shifted ZMK_UNICODE_PAIR( de_ae, N0, N0, E, N4, N0, N0, C, N4 ) ZMK_UNICODE_PAIR( de_oe, N0, N0, F, N6, N0, N0, D, N6 ) ZMK_UNICODE_PAIR( de_ue, N0, N0, F, C, N0, N0, D, C ) ``` -------------------------------- ### Define Euro Sign with ZMK Unicode Helper Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Creates a macro for the Euro sign (โ‚ฌ) using the ZMK_UNICODE_SINGLE macro. This macro can then be assigned to a key in the ZMK keymap. ```c++ ZMK_UNICODE_SINGLE(euro_sign, N2, N0, A, C) ``` -------------------------------- ### Define Leader Key Sequences (C) Source: https://context7.com/urob/zmk-helpers/llms.txt The ZMK_LEADER_SEQUENCE macro defines sequences that are triggered after pressing a designated leader key followed by a specific key sequence. This feature requires the leader-key module to be enabled. Sequences can be defined globally or be layer-specific, and can include options like immediate triggering. ```c // Define sequences triggered by &leader followed by key positions ZMK_LEADER_SEQUENCE(vim_save, &kp COLON &kp W &kp RET, 0 1) // leader + keys 0,1 = :w ZMK_LEADER_SEQUENCE(vim_quit, &kp COLON &kp Q &kp RET, 0 2) // leader + keys 0,2 = :q // Layer-specific leader sequences ZMK_LEADER_SEQUENCE(screenshot, &kp LG(LS(N4)), 1 2, NAV) // Only on NAV layer // With extra options ZMK_LEADER_SEQUENCE(immediate, &kp ESC, 0, ALL, immediate-trigger;) ``` -------------------------------- ### Define Tap-Dance Behaviors with ZMK_TAP_DANCE Source: https://context7.com/urob/zmk-helpers/llms.txt The ZMK_TAP_DANCE macro simplifies the creation of tap-dance behaviors, allowing different actions to be triggered based on the number of taps. This is useful for creating shortcuts or layered inputs with a single key. ```c // Single tap: copy, double tap: cut ZMK_TAP_DANCE(copy_cut, tapping-term-ms = <200>; bindings = <&kp LC(INS)>, <&kp LC(X)>; ) // Single tap: sticky shift, double tap: caps word ZMK_TAP_DANCE(ss_cw, tapping-term-ms = <200>; bindings = <&sk LSHFT>, <&caps_word>; ) ``` -------------------------------- ### Include ZMK Key-labels Header Source: https://github.com/urob/zmk-helpers/blob/main/docs/key_labels.md This C code snippet demonstrates how to include a specific keyboard's layout header from the ZMK key-labels directory. This allows the use of standardized key-labels in your keymap configuration. ```c #include "zmk-helpers/key-labels/34.h" // replace by the correct header for your keyboard ``` -------------------------------- ### Define LILY58 Standard Labels (ZMK) Source: https://github.com/urob/zmk-helpers/blob/main/README.md This C code snippet shows how to define the LILY58_STANDARD_LABELS flag before including the lily58.h header. This ensures standard key label conventions are used, as required for historical reasons. ```c #define LILY58_STANDARD_LABELS #include ``` -------------------------------- ### Define Macro Behaviors with ZMK_MACRO Source: https://context7.com/urob/zmk-helpers/llms.txt The ZMK_MACRO macro is used to define sequences of key presses that can be triggered by a single key. This is useful for automating repetitive tasks or creating complex shortcuts. ```c // Windows sleep macro: Win+X, U, S ZMK_MACRO(win_sleep, wait-ms = <100>; tap-ms = <5>; bindings = <&kp LG(X) &kp U &kp S>; ) // Type "Hello World" ZMK_MACRO(hello, wait-ms = <30>; tap-ms = <30>; bindings = <&kp H &kp E &kp L &kp L &kp O &kp SPACE &kp W &kp O &kp R &kp L &kp D>; ) ``` -------------------------------- ### Define Unicode Characters with ZMK_UNICODE_SINGLE and ZMK_UNICODE_PAIR Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Creates Unicode characters for use in the ZMK keymap. ZMK_UNICODE_SINGLE creates a single character, while ZMK_UNICODE_PAIR creates both unshifted and shifted versions. These helpers are deprecated in favor of the zmk-unicode module. ```C++ ZMK_UNICODE_SINGLE(name, L0, L1, L2, L3) ZMK_UNICODE_PAIR(name, L0, L1, L2, L3, U0, U1, U2, U3) ``` -------------------------------- ### Define ZMK Combos for Simultaneous Key Presses Source: https://context7.com/urob/zmk-helpers/llms.txt The ZMK_COMBO macro allows defining custom behaviors triggered by pressing multiple keys simultaneously within a specified timeout. It supports various configurations, including simple key presses, layer-specific activations, and combinations with idle time or sticky key behavior. The `COMBO_TERM` can be globally adjusted. ```c // Set global combo timeout (default is 30ms) #undef COMBO_TERM #define COMBO_TERM 50 // Include key-labels for readable combo definitions #include "zmk-helpers/key-labels/34.h" // Simple combo: Escape when keys 0 and 1 pressed within 25ms ZMK_COMBO(esc, &kp ESC, 0 1, ALL, 25) // Copy combo: middle + ring finger on left bottom row ZMK_COMBO(copy, &kp LC(C), LB2 LB3, ALL) // Paste combo: index + middle finger on left bottom row ZMK_COMBO(paste, &kp LC(V), LB1 LB2, ALL) // Layer-specific combo: Windows sleep (only on NAV layer) ZMK_COMBO(sleep, &win_sleep, RT3 RT4, NAV) // With require-prior-idle: combo only triggers if no key pressed in 150ms ZMK_COMBO(enter, &kp RET, RM1 RM2, ALL, COMBO_TERM, 150) // With extra options: slow-release for sticky behavior ZMK_COMBO(shift, &sk LSHFT, LH0 RH0, ALL, COMBO_TERM, 0, slow-release;) ``` -------------------------------- ### Define Unicode Pairs with Shift Modifiers (C) Source: https://context7.com/urob/zmk-helpers/llms.txt The ZMK_UNICODE_PAIR macro creates pairs of Unicode characters (lowercase and uppercase) that respond to the shift modifier. This is useful for language-specific characters. It requires no external dependencies beyond the ZMK build system. ```c // German umlauts - press for lowercase, shift+press for uppercase ZMK_UNICODE_PAIR(de_ae, N0, N0, E, N4, N0, N0, C, N4) // รค/ร„ ZMK_UNICODE_PAIR(de_oe, N0, N0, F, N6, N0, N0, D, N6) // รถ/ร– ZMK_UNICODE_PAIR(de_ue, N0, N0, F, C, N0, N0, D, C) // รผ/รœ ZMK_UNICODE_PAIR(de_eszett, N0, N0, D, F, N1, E, N9, E) // รŸ/แบž // Usage in keymap: &de_ae outputs รค, Shift+&de_ae outputs ร„ // Pre-defined language files available: #include "zmk-helpers/unicode-chars/german.dtsi" #include "zmk-helpers/unicode-chars/french.dtsi" #include "zmk-helpers/unicode-chars/spanish.dtsi" #include "zmk-helpers/unicode-chars/swedish.dtsi" // ... and more in unicode-chars directory ``` -------------------------------- ### ZMK Positional Homerow Mods with Key-labels (C) Source: https://github.com/urob/zmk-helpers/blob/main/docs/key_labels.md This C code illustrates the use of ZMK's positional hold-tap feature combined with key-labels for advanced homerow modifier configurations. It defines left-hand, right-hand, and thumb keys, then sets up homerow mods that trigger only with opposite-hand keys. ```c /* define left and right hand keys */ #include "zmk-helpers/key-labels/36.h" // replace with correct key-labels header #define KEYS_L LT0 LT1 LT2 LT3 LT4 LM0 LM1 LM2 LM3 LM4 LB0 LB1 LB2 LB3 LB4 // left-hand keys #define KEYS_R RT0 RT1 RT2 RT3 RT4 RM0 RM1 RM2 RM3 RM4 RB0 RB1 RB2 RB3 RB4 // right-hand keys #define THUMBS LH2 LH1 LH0 RH0 RH1 RH2 // thumb keys /* left-hand HRMs */ ZMK_HOLD_TAP(hml, flavor = "balanced"; tapping-term-ms = <280>; bindings = <&kp>, <&kp>; hold-trigger-key-positions = ; ) /* right-hand HRMs */ ZMK_HOLD_TAP(hmr, flavor = "balanced"; tapping-term-ms = <280>; bindings = <&kp>, <&kp>; hold-trigger-key-positions = ; ) ``` -------------------------------- ### Define Conditional Layer with ZMK_CONDITIONAL_LAYER Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Sets up a conditional layer that activates a specified layer when a set of other layers are simultaneously active. This macro requires a unique name, a list of triggering layers, and the layer to be activated. The activated layer should typically have a higher number than the triggering layers. ```C++ ZMK_CONDITIONAL_LAYER(its_magic, 1 2, 3) ``` -------------------------------- ### ZMK_APPLY_MATRIX_TRANSFORM: Apply Matrix Transformation Source: https://github.com/urob/zmk-helpers/blob/main/docs/core_helpers.md Applies a non-default matrix transformation to the keymap. This is useful for keyboards with non-standard physical layouts. It takes the node name of a valid matrix_transform as input. ```c ZMK_APPLY_MATRIX_TRANSFORM(five_column_transform) ``` -------------------------------- ### Define Mod-Morph Behaviors with ZMK_MOD_MORPH Source: https://context7.com/urob/zmk-helpers/llms.txt ZMK_MOD_MORPH enables the creation of behaviors that change their output based on held modifiers. This allows a single key to perform different actions when tapped alone, tapped with a specific modifier, or held. ```c // Tap: backspace | Shift+tap: delete | Hold: activate NUM layer ZMK_MOD_MORPH(bs_del_num, bindings = << NUM BSPC>, <&kp DEL>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // Tap: comma | Shift+tap: semicolon ZMK_MOD_MORPH(comma_semi, bindings = <&kp COMMA>, <&kp SEMI>; mods = <(MOD_LSFT|MOD_RSFT)>; ) ``` -------------------------------- ### C Macro for Key-label Standardization Source: https://github.com/urob/zmk-helpers/blob/main/docs/key_labels.md This C macro defines the standard format for key-labels in ZMK, consisting of side, row, and column. It serves as a foundational element for creating portable keymaps across different keyboards. ```c #define KEY_LABEL_FORMAT "" // e.g., LT0 or RB1 ```