{"id":28142257,"url":"https://github.com/urob/zmk-leader-key","last_synced_at":"2025-10-18T19:14:48.690Z","repository":{"id":264577476,"uuid":"893717246","full_name":"urob/zmk-leader-key","owner":"urob","description":"A ZMK module adding a leader-key behavior","archived":false,"fork":false,"pushed_at":"2025-03-01T20:17:09.000Z","size":44,"stargazers_count":22,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T21:23:08.384Z","etag":null,"topics":["zmk","zmk-module"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/urob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-25T04:44:41.000Z","updated_at":"2025-03-01T20:17:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"f11fc152-db5a-4f85-a0e2-a6d915ac51ae","html_url":"https://github.com/urob/zmk-leader-key","commit_stats":null,"previous_names":["urob/zmk-leader-key"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urob%2Fzmk-leader-key","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urob%2Fzmk-leader-key/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urob%2Fzmk-leader-key/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urob%2Fzmk-leader-key/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urob","download_url":"https://codeload.github.com/urob/zmk-leader-key/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209843,"owners_count":22032898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["zmk","zmk-module"],"created_at":"2025-05-14T19:19:59.970Z","updated_at":"2025-10-18T19:14:48.683Z","avatar_url":"https://github.com/urob.png","language":"C","funding_links":[],"categories":["Community firmware Modules and Behaviors","Behaviors"],"sub_categories":["Custom Behaviors"],"readme":"# ZMK-LEADER-KEY\n\nThis module adds a `leader-key` behavior to ZMK. It is a reimplementation of\nNick Conway's [PR #1380](https://github.com/zmkfirmware/zmk/pull/1380). The most\nimportant differences are:\n\n- Works as a module without the need to patch ZMK.\n- Sequences are `keycode`-based instead of `position`-based.\n- Multiple leader-key instances with distinct sets of sequences are supported.\n- Key codes that terminate the behavior are bubbled to other behaviors.\n- Sequences inherit locality from the leader key (useful for `\u0026sys_reset` and\n  `\u0026bootloader`).\n- Strictly nested sequences are considered bad form and aren't supported.\n- The `timeout`, `immediate-trigger` and `layers` properties are removed as\n  their primary intend is to support nested sequences and to work around the\n  single-instance restriction of the original PR.\n\nA one-for-one port of the original PR version as a ZMK module is available in\nthe [`legacy`](https://github.com/urob/zmk-leader-key/tree/legacy) branch.\n\n## Usage\n\nTo load the module, add the following entries to `remotes` and `projects` in\n`config/west.yml`.\n\n```yaml\nmanifest:\n  remotes:\n    - name: zmkfirmware\n      url-base: https://github.com/zmkfirmware\n    - name: urob\n      url-base: https://github.com/urob\n  projects:\n    - name: zmk\n      remote: zmkfirmware\n      revision: v0.3\n      import: app/west.yml\n    - name: zmk-leader-key\n      remote: urob\n      revision: v0.3 # set to same as ZMK version above\n  self:\n    path: config\n```\n\nNote: This module uses a version scheme that is synchronized with upstream ZMK.\nTo ensure compatibility, I highly recommend setting the revision of this module\nto the same as ZMK's.\n\n## Configuration\n\n### Leader sequences\n\nLeader sequences are defined as child nodes of a leader-key instance. Each\nsequence takes two arguments `sequence` and `bindings`. Example:\n\n```c\n/ {\n    behaviors {\n        leader1: leader1 {\n            compatible = \"zmk,behavior-leader-key\";\n            #binding-cells = \u003c0\u003e;\n            usb { sequence = \u003cU S B\u003e; bindings = \u003c\u0026out OUT_USB\u003e; };\n            ble { sequence = \u003cB L E\u003e; bindings = \u003c\u0026out OUT_BLE\u003e; };\n            bt0 { sequence = \u003cB N0\u003e; bindings = \u003c\u0026bt BT_SEL 0\u003e; };\n            bt1 { sequence = \u003cB N1\u003e; bindings = \u003c\u0026bt BT_SEL 1\u003e; };\n            bt2 { sequence = \u003cB N2\u003e; bindings = \u003c\u0026bt BT_SEL 2\u003e; };\n            btc { sequence = \u003cC L E A R\u003e; bindings = \u003c\u0026bt BT_CLR\u003e; };\n            boot { sequence = \u003cB O O T\u003e; bindings = \u003c\u0026bootloader\u003e; };\n            reset { sequence = \u003cR E S E T\u003e; bindings = \u003c\u0026sys_reset\u003e; };\n        };\n\n        leader2: leader2 {\n            compatible = \"zmk,behavior-leader-key\";\n            #binding-cells = \u003c0\u003e;\n            de_ae { sequence = \u003cA E\u003e; bindings = \u003c\u0026de_ae\u003e; };\n            de_oe { sequence = \u003cO E\u003e; bindings = \u003c\u0026de_oe\u003e; };\n            de_ue { sequence = \u003cU E\u003e; bindings = \u003c\u0026de_ue\u003e; };\n        };\n    };\n};\n```\n\nThis sets up two leader key instances, `leader1` and `leader2`. The first one\nhas various system related sequences, the second one is for German umlauts (the\n`\u0026de_*` bindings must be defined elsewhere).\n\n**Note:** By default, modifiers in sequences are treated as a lower bound. For\nexample, holding `LSHFT` will trigger sequence `LS(A) LS(B)` as well as sequence\n`A B`, whereas not holding any modifier will only trigger `A B`. This is so that\ncase-sensitive behavior bindings work as expected.\n\n**Locality:** Sequence bindings inherit their locality from the position of the\nleader key. For example, on split keyboards, the `BOOT` and `RESET` sequences in\nthe example above will invoke the bootloader on the side on which `\u0026leader1` is\nbound. Tip: Add `\u0026leader1` to both sides to be able to reset either side.\n\n### Behavior properties\n\n**`ignore-keys`** (optional): If set to a list of key codes, these keys are\nignored when evaluating sequences. For instance, if\n`ignore-keys = \u003cLSHFT RSHFT\u003e`, \"shift\" is passed through without triggering or\nterminating sequences.\n\n### `Kconfig` options\n\n- `CONFIG_ZMK_LEADER_MAX_KEYS_PER_SEQUENCE`: Maximum number of keys in a\n  sequence. Default is 5.\n- `CONFIG_ZMK_LEADER_MAX_SEQUENCES`: Maximum number of sequences per leader key\n  instance. Default is 32.\n\n## References\n\n- The [legacy](https://github.com/urob/zmk-leader-key/tree/legacy) branch ports\n  Nick Conway's PR [#1380](https://github.com/zmkfirmware/zmk/pull/1380) as a\n  ZMK module.\n- My personal [zmk-config](https://github.com/urob/zmk-config) contains advanced\n  usage examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furob%2Fzmk-leader-key","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furob%2Fzmk-leader-key","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furob%2Fzmk-leader-key/lists"}