feat(combos): initial implementation

closes #45
This commit is contained in:
Okke Formsma
2020-12-11 23:24:44 +01:00
committed by Pete Johanson
parent 90c2c6672f
commit feb0d5b90c
55 changed files with 1528 additions and 1 deletions

View File

@@ -0,0 +1 @@
s/.*hid_listener_keycode_//p

View File

@@ -0,0 +1,4 @@
pressed: usage_page 0x07 keycode 0x04 mods 0x00
pressed: usage_page 0x07 keycode 0x05 mods 0x00
released: usage_page 0x07 keycode 0x04 mods 0x00
released: usage_page 0x07 keycode 0x05 mods 0x00

View File

@@ -0,0 +1,40 @@
#include <dt-bindings/zmk/keys.h>
#include <behaviors.dtsi>
#include <dt-bindings/zmk/kscan-mock.h>
/ {
combos {
compatible = "zmk,combos";
combo_one {
timeout-ms = <30>;
key-positions = <0 1>;
bindings = <&kp C>;
};
combo_two {
timeout-ms = <120>;
key-positions = <0 1 2>;
bindings = <&kp C>;
};
};
keymap {
compatible = "zmk,keymap";
label ="Default keymap";
default_layer {
bindings = <
&kp A &kp B
&none &none
>;
};
};
};
&kscan {
events = <
ZMK_MOCK_PRESS(0,0,100)
ZMK_MOCK_PRESS(0,1,10)
ZMK_MOCK_RELEASE(0,0,10)
ZMK_MOCK_RELEASE(0,1,10)
>;
};