You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> We recommend to pin the version of the modules as shown in the example above.
34
+
> We recommend to pin the version of the module as shown in the example above.
40
35
> Nevertheless, you can also use directly `main`.
41
36
37
+
To override the required modules, please check the [documentation page].
38
+
42
39
To build locally, check the [ZMK documentation to build with external modules](https://zmk.dev/docs/development/local-toolchain/build-flash#building-with-external-modules).
43
40
44
41
### Basic usage
45
42
46
43
> [!NOTE]
47
-
> The full documentation can be found on the [documentation page](https://github.com/magicDGS/zmk-keymap-utils/blob/main/docs/README.md).
44
+
> The full documentation can be found on the [documentation page].
48
45
49
46
Define the `OPERATING_SYSTEM` variable with the operating system you intend to use with this keymap: `L`for Linux (default if not provided), `W` for Windows, `M` for MacOS.
50
47
51
48
- `#define OPERATING_SYSTEM "L"`for Linux (default if none provided)
52
49
- `#define OPERATING_SYSTEM "W"`for Windows
53
50
- `#define OPERATING_SYSTEM "M"`for MacOS
54
51
55
-
Source the `init.h` header before using any of the features of the `zmk-keymap-utils` module on your `.keymap` file to provide the initial keycodes and shortcuts for the specified OS.
52
+
Source the `shortcuts.h` header before using any of the features of the `zmk-keymap-utils` module on your `.keymap` file to provide the initial keycodes and shortcuts for the specified OS.
56
53
57
54
```c
58
55
// #define OPERATING_SYSTEM "L" // Linux (default) - uncomment to override with explicit values: L, W, M
59
-
#include <zmk-keymap-utils/init.h>
56
+
#include <zmk-keymap-utils/shortcuts.h>
60
57
```
61
58
62
59
Then include any extra functionality you need:
63
60
64
61
```c
65
62
// select-word macros based on the Sunaku's implementation of Pascal Getreuer's Select Word macro from QMK
66
-
#include <zmk-keymap-utils/select_word.dtsi>
63
+
#include <behaviors/select_word.dtsi>
67
64
// timeless home-row mods based on urob's implementation
68
-
#include <zmk-keymap-utils/hrm/timeless.dtsi>
65
+
#include <zmk-keymap-utils/hrm/timeless.h>
69
66
```
70
67
71
-
## Inspiration
72
-
73
68
# License
74
69
75
70
This project is released under the [ISC License](LICENSE).
@@ -84,3 +79,7 @@ It also contains copied or modified code from other Open Sourcethird-party proje
84
79
In adition to the projects mentioned in the License, this project is inspired by other zmk-config projects and their configuration:
85
80
86
81
- [urob/zmk-config](https://github.com/urob/zmk-config), where it was firs described the configuration to implement [Timeless homerow mods](https://github.com/urob/zmk-config?tab=readme-ov-file#timeless-homerow-mods).
You can also import it with a different version, remote or path for the required modules.
26
+
For example, a west configuration with the main version of the module and its [zmk-helpers](https://github.com/urob/zmk-helpers) (Version 2) requirement
27
+
that is located on the `modules` path:
11
28
12
29
```yaml
13
30
manifests:
@@ -20,13 +37,11 @@ manifests:
20
37
projects:
21
38
# zmk and other projects might be configured
22
39
- name: zmk-helpers
23
-
remote-name: urob
24
-
# pin version of the module
25
-
revision: v0.1
40
+
remote: urob
41
+
path: modules/zmk-helpers
26
42
- name: zmk-keymap-utils
27
-
remote-name: magicDGS
28
-
# pin version of the module
29
-
revision: v0.3
43
+
remote: magicDGS
44
+
path: modules/zmk-keymap-utils
30
45
```
31
46
32
47
> [!TIP]
@@ -41,25 +56,23 @@ Define the `OPERATING_SYSTEM` variable with the operating system you intend to u
41
56
- `#define OPERATING_SYSTEM "W"`for Windows
42
57
- `#define OPERATING_SYSTEM "M"`for MacOS
43
58
44
-
Source the `init.h` header before using any of the features of the `zmk-keymap-utils` module on your `.keymap` file to provide the initial keycodes and shortcuts for the specified OS.
59
+
It is important to define the `OPERATING_SYSTEM` before including any of the features from the `zmk-keymap-utils` module to have the proper configuration for your operating system.
45
60
46
-
```c
47
-
#include "zmk-keymap-utils/init.h"
48
-
```
49
-
50
-
> [!CAUTION]
51
-
> Including the `init.h` header includes also the `zmk-helpers` module.
52
-
> Please, check the [README](https://github.com/urob/zmk-helpers/blob/main/README.md) of the `zmk-helpers` module for more information.
61
+
## Shortcuts and modifiers
53
62
54
-
## Definitions and behaviors
63
+
The shortcuts and modifieres are provided with the `shortcuts.h` header, which can be used with `&kp` or any other behaviors.
64
+
They are implemented on an OS-agnostic way, by either adding aliases for keycodes or using shortcuts/macros (if keycodes are not available).
55
65
56
-
The `zmk-keymap-utils` module provides definitions and behaviors that can be used on an OS-agnostic way to configure the keymap, by adding aliases for the keycodes or using shortcuts/macros if they are not possible.
66
+
To use this definitions, source the shortcuts.h header:
57
67
58
-
Nevertheless, some behaviors are not available on all OS, and will be marked in the tables below with `❌` or `❓` to indicate that they are not available or they are unknown.
68
+
```c
69
+
#include <zmk-keymap-utils/shortcuts.h>
70
+
```
59
71
60
-
### Core definitions
72
+
> [!TIP]
73
+
> We recommend to import the shortcuts before any other behavior, as some of them would use them. They would be imported by default if not provided.
61
74
62
-
The core definitions are provided by default by the intial setup (including the `init.h` header on the `.keymap` file), which can be used with `&kp` or any other behavior:
75
+
Provided shortcuts include (note that `❌` or `❓` indicates that the shortcut is no available or has unknown behavior on the OS):
@@ -101,24 +114,32 @@ Other definitons might be used on different behaviors and are not intended to be
101
114
102
115
## Select Word
103
116
104
-
The `select_word.dtsi` include file provides support for extend/select behaviors for for the specified OS.
117
+
The `select_word.dtsi` behaviors dtsi file provides support for extend/select behaviors for for the specified OS.
105
118
They are based on the [Pascal Getreuer's Select Word macro from QMK](https://getreuer.info/posts/keyboards/select-word/index.html) implementation for ZMK by [Sunaku](https://github.com/sunaku/glove80-keymaps).
106
119
107
120
To use the default configuration, import with:
108
121
109
122
```c
110
123
// select-word macros based on the Sunaku's implementation of Pascal Getreuer's Select Word macro from QMK
111
-
#include "zmk-keymap-utils/select_word.h"
124
+
#include <behaviors/select_word.h>
112
125
```
113
126
127
+
> [!CAUTION]
128
+
> Including the `select_word.h` behavior includes also `zmk-helpers` module.
129
+
> Please, check the [README](https://github.com/urob/zmk-helpers/blob/main/README.md) of the `zmk-helpers` module for more information.
130
+
131
+
> [!CAUTION]
132
+
> The `select_word.h` behavior would source, if not already included, the `shortcuts.h` header.
133
+
> We recommend to import it beforehand to ensure that the the configuration is explicit.
134
+
114
135
To use a different delay, the `SELECT_WORD_DELAY` property can be used before import (default is `1`).
115
136
This configuration defines how long the macro waits (in ms) after moving the cursor before it selects a word.
116
137
A larger delay may allow th"macro to move to the next word upon each invocation.
117
138
For example:
118
139
119
140
```c
120
141
#define SELECT_WORD_DELAY 50
121
-
#include "zmk-keymap-utils/select_word.h"
142
+
#include <zmk-keymap-utils/select_word.h>
122
143
```
123
144
124
145
The behaviors provided after import are the following:
@@ -133,7 +154,7 @@ The behaviors provided after import are the following:
133
154
| `&extend_line` | Extend current selection by one line |
134
155
135
156
> [!TIP]
136
-
> The behaviors are implemented in such a way that using them with the shift modifier active selects/extends in the t
157
+
> The behaviors are implemented in such a way that using them with the shift modifier active selects/extends in the oposite direction.
137
158
138
159
## Home-Row Mods
139
160
@@ -159,17 +180,21 @@ Here we provide a basic function to define your HRM behaviors with ease.
159
180
To use the default configuration, import with:
160
181
161
182
```c
162
-
// select-word macros based on the Sunaku's implementation of Pascal Getreuer's Select Word macro from QMK
163
-
#include "zmk-keymap-utils/hrm/timeless.dtsi.h"
183
+
// timeless home-row mods based on urob's implementation
184
+
#include <zmk-keymap-utils/hrm/timeless.h>
164
185
```
165
186
187
+
> [!CAUTION]
188
+
> Including the `hrm/timeless.h` header includes also the `zmk-helpers` module.
189
+
> Please, check the [README](https://github.com/urob/zmk-helpers/blob/main/README.md) of the `zmk-helpers` module for more information.
190
+
166
191
To use a different `tapping-term-ms`, the `TIMELESS_HRM_QUICK_TAP_MS` property can be used before import (default is `175`).
167
192
This configuration can be tweak to support mod+alpha combinations in the same hand, and modifier press without other keys.
168
193
For example:
169
194
170
195
```c
171
196
#define TIMELESS_HRM_QUICK_TAP_MS 280
172
-
#include "zmk-keymap-utils/hrm/timeless.dtsi.h"
197
+
#include <zmk-keymap-utils/hrm/timeless.h>
173
198
```
174
199
175
200
After import, you can define your HRMs using the `MAKE_TIMELESS_HRM` function.
@@ -189,7 +214,7 @@ A clear example on how to use this function is a refactor of the [Urob's Persona
189
214
> This snippet uses the standard key-labels from `urob/zmk-helpers` (see [its README](https://github.com/urob/zmk-helpers?tab=readme-ov-file#key-labels-collection) for more details).
0 commit comments