test macro from tap hold
This commit is contained in:
parent
971b018aec
commit
ddc022c291
5 changed files with 52 additions and 30 deletions
|
@ -72,6 +72,5 @@
|
|||
&kp TAB &none>;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
@ -8,25 +8,34 @@
|
|||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
|
||||
#define BASE 0
|
||||
#define RAISE 1
|
||||
|
||||
/ {
|
||||
macros {
|
||||
abc_macro: abc_macro {
|
||||
label = "ABCs";
|
||||
shift_layer_macro: shift_layer_macro {
|
||||
label = "SHIFT_LAYER_MACRO";
|
||||
compatible = "zmk,behavior-macro";
|
||||
#binding-cells = <0>;
|
||||
bindings = <&kp A &kp B &kp C>;
|
||||
wait-ms = <1>;
|
||||
bindings
|
||||
// tog doesn't work, the tog on release doesn't seem to fire
|
||||
= <¯o_press &mo RAISE &kp LSHFT>
|
||||
, <¯o_pause_for_release>
|
||||
, <¯o_release &mo RAISE &kp LSHFT>
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
hold_shift_macro: hold_shift_macro {
|
||||
label = "HOLD_SHFT";
|
||||
compatible = "zmk,behavior-macro";
|
||||
#binding-cells = <0>;
|
||||
bindings
|
||||
= <¯o_press &kp LSHFT>
|
||||
, <¯o_tap>
|
||||
, <&kp D &kp O &kp G>
|
||||
, <¯o_release &kp LSHFT>
|
||||
;
|
||||
|
||||
behaviors {
|
||||
mth: macro_tap_hold {
|
||||
compatible = "zmk,behavior-hold-tap";
|
||||
label = "MACRO_TAP_HOLD";
|
||||
#binding-cells = <2>;
|
||||
flavor = "tap-unless-interrupted";
|
||||
tapping-term-ms = <200>;
|
||||
bindings = <&shift_layer_macro>, <&kp>;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -34,18 +43,16 @@
|
|||
compatible = "zmk,keymap";
|
||||
label ="Default keymap";
|
||||
|
||||
default_layer {
|
||||
base_layer {
|
||||
bindings = <
|
||||
&abc_macro &mo 1
|
||||
&hold_shift_macro &custom_timing>;
|
||||
&mth A B &kp C
|
||||
&shift_layer_macro &kp D>;
|
||||
};
|
||||
|
||||
extra_layer {
|
||||
raise_layer {
|
||||
bindings = <
|
||||
&dual_sequence_macro &trans
|
||||
&kp TAB &none>;
|
||||
|
||||
&mth L M &kp N
|
||||
&kp O &kp P>;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
s/.*hid_listener_keycode/kp/p
|
||||
s/.*mo_keymap_binding/mo/p
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
kp_pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
mo_pressed: position 0 layer 1
|
||||
kp_pressed: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_pressed: usage_page 0x07 keycode 0x06 implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x06 implicit_mods 0x00 explicit_mods 0x00
|
||||
mo_released: position 0 layer 1
|
||||
kp_released: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00
|
||||
|
|
|
@ -7,8 +7,23 @@
|
|||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
#include "../behavior_keymap.dtsi"
|
||||
#include "behavior_keymap.dtsi"
|
||||
|
||||
&kscan {
|
||||
events = <ZMK_MOCK_PRESS(0,0,10) ZMK_MOCK_RELEASE(0,0,1000)>;
|
||||
events = <
|
||||
ZMK_MOCK_PRESS( 1,1,10)
|
||||
ZMK_MOCK_PRESS( 0,1,10)
|
||||
ZMK_MOCK_RELEASE(0,1,10)
|
||||
ZMK_MOCK_RELEASE(1,1,10)
|
||||
|
||||
//ZMK_MOCK_PRESS( 0,0,10)
|
||||
//ZMK_MOCK_PRESS( 0,1,10)
|
||||
//ZMK_MOCK_RELEASE(0,1,10)
|
||||
//ZMK_MOCK_RELEASE(0,0,10)
|
||||
//
|
||||
//ZMK_MOCK_PRESS( 1,0,10)
|
||||
//ZMK_MOCK_PRESS( 1,1,10)
|
||||
//ZMK_MOCK_RELEASE(1,1,10)
|
||||
//ZMK_MOCK_RELEASE(1,0,10)
|
||||
>;
|
||||
};
|
Loading…
Add table
Reference in a new issue