This commit is contained in:
Jamie Ding 2022-03-20 01:16:31 +00:00
parent 42e92e10d8
commit 971b018aec
4 changed files with 72 additions and 0 deletions

View 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
= <&macro_press &kp LSHFT>
, <&macro_tap>
, <&kp D &kp O &kp G>
, <&macro_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>;
};
};
};

View file

@ -0,0 +1 @@
s/.*hid_listener_keycode/kp/p

View 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

View 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)>;
};