wip
This commit is contained in:
parent
42e92e10d8
commit
971b018aec
4 changed files with 72 additions and 0 deletions
51
app/tests/macros/from-tap-hold/behavior_keymap.dtsi
Normal file
51
app/tests/macros/from-tap-hold/behavior_keymap.dtsi
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/zmk/keys.h>
|
||||||
|
#include <behaviors.dtsi>
|
||||||
|
#include <dt-bindings/zmk/kscan_mock.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
macros {
|
||||||
|
abc_macro: abc_macro {
|
||||||
|
label = "ABCs";
|
||||||
|
compatible = "zmk,behavior-macro";
|
||||||
|
#binding-cells = <0>;
|
||||||
|
bindings = <&kp A &kp B &kp C>;
|
||||||
|
};
|
||||||
|
|
||||||
|
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>
|
||||||
|
;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
keymap {
|
||||||
|
compatible = "zmk,keymap";
|
||||||
|
label ="Default keymap";
|
||||||
|
|
||||||
|
default_layer {
|
||||||
|
bindings = <
|
||||||
|
&abc_macro &mo 1
|
||||||
|
&hold_shift_macro &custom_timing>;
|
||||||
|
};
|
||||||
|
|
||||||
|
extra_layer {
|
||||||
|
bindings = <
|
||||||
|
&dual_sequence_macro &trans
|
||||||
|
&kp TAB &none>;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
1
app/tests/macros/from-tap-hold/events.patterns
Normal file
1
app/tests/macros/from-tap-hold/events.patterns
Normal file
|
@ -0,0 +1 @@
|
||||||
|
s/.*hid_listener_keycode/kp/p
|
6
app/tests/macros/from-tap-hold/keycode_events.snapshot
Normal file
6
app/tests/macros/from-tap-hold/keycode_events.snapshot
Normal file
|
@ -0,0 +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
|
||||||
|
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
|
14
app/tests/macros/from-tap-hold/native_posix.keymap
Normal file
14
app/tests/macros/from-tap-hold/native_posix.keymap
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/zmk/keys.h>
|
||||||
|
#include <behaviors.dtsi>
|
||||||
|
#include <dt-bindings/zmk/kscan_mock.h>
|
||||||
|
#include "../behavior_keymap.dtsi"
|
||||||
|
|
||||||
|
&kscan {
|
||||||
|
events = <ZMK_MOCK_PRESS(0,0,10) ZMK_MOCK_RELEASE(0,0,1000)>;
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue