SOCD cleaner for ZMK.
Edit zmk-config/config/west.yml.
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
+ - name: nguyendown
+ url-base: https://github.com/nguyendown
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
+ - name: zmk-behavior-socd
+ remote: nguyendown
+ revision: main
self:
path: config&socd is the default SOCD instance.
It is Last Input Priority (LIP) and uses key press binding &kp.
Add this to .keymap to use &socd.
#include <behaviors.dtsi>
+#include <behaviors/socd.dtsi>
#include <dt-bindings/zmk/keys.h>The following keymap prevents A and D from overlapping each other.
/ {
keymap {
default_layer {
bindings = <
&kp Q &kp W &kp E
&socd A &kp S &socd D>;
};
};
};
For W and S, create a new SOCD instance. See Multiple instances
When first-input-priority is set,
SOCD behavior will switch to First Input Priority (FIP).
&socd {
first-input-priority;
};
/ {
keymap {
...
};
};
The following example gives &socd A absolute priority.
&socd {
absolute-priority = <A>;
};
When no-resume is set, SOCD behavior will not resume the remaining pressed key.
When neutral is set, pressing two keys at the same time
results in no input being registered.
This also overrides all the properties mentioned above.
The behavior does not prioritize any input,
whether it is FIP, LIP or absolute priority.
The remaining pressed key always resumes even if no-resume is set.
The following example creates a new SOCD instance that works separately from the default &socd.
/ {
behaviors {
socd2: socd2 {
compatible = "zmk,behavior-socd";
#binding-cells = <1>;
bindings = <&kp>;
};
};
keymap {
default_layer {
bindings = <
&kp Q &socd2 W &kp E
&socd A &socd2 S &socd D>;
};
};
};
cd /path/to/zmk/app
ZMK_EXTRA_MODULES="/path/to/zmk-behavior-socd" west test /path/to/zmk-behavior-socd/testsFor a specific test case.
ZMK_EXTRA_MODULES="/path/to/zmk-behavior-socd" west test /path/to/zmk-behavior-socd/tests/socd/last-input-priority