Squashed helper-macro branch
commit 62e33866ccc009c645adda95297e147a6bb1b5d4 Author: urob <978080+urob@users.noreply.github.com> Date: Wed Jul 13 16:00:08 2022 -0400 Move helper.dtsi to subtree commit 635cffa0c1c0a87dadd929701225d30c119a1a9f Merge: d8dfef3 41c9041 Author: urob <978080+urob@users.noreply.github.com> Date: Wed Jul 13 16:56:44 2022 -0400 Merge commit '41c9041ccc102d7acbc4882434fa5780050a9455' as 'zmk-nodefree-config' commit 41c9041ccc102d7acbc4882434fa5780050a9455 Author: urob <978080+urob@users.noreply.github.com> Date: Wed Jul 13 16:56:44 2022 -0400 Squashed 'zmk-nodefree-config/' content from commit c7dc05e git-subtree-dir: zmk-nodefree-config git-subtree-split: c7dc05eb52b14b69ea48059ff418edad6484500e commit d8dfef3849436176bba1ff3da25ae59d1fa92abe Author: urob <978080+urob@users.noreply.github.com> Date: Mon Jul 11 23:15:51 2022 -0400 Convenience macros for a cleaner keymap config
This commit is contained in:
parent
308fcb8401
commit
17737c8672
5 changed files with 290 additions and 106 deletions
32
zmk-nodefree-config/helper.dtsi
Normal file
32
zmk-nodefree-config/helper.dtsi
Normal file
|
@ -0,0 +1,32 @@
|
|||
/* helper.dtsi: convenience macros simplifying ZMK's keymap configuration */
|
||||
|
||||
#define ZMK_HELPER_CORE_caps_word compatible = "zmk,behavior-caps-word"; #binding-cells = <0>
|
||||
#define ZMK_HELPER_CORE_hold_tap compatible = "zmk,behavior-hold-tap"; #binding-cells = <2>
|
||||
#define ZMK_HELPER_CORE_key_repeat compatible = "zmk,behavior-key-repeat"; #binding-cells = <0>
|
||||
#define ZMK_HELPER_CORE_macro compatible = "zmk,behavior-macro"; #binding-cells = <0>
|
||||
#define ZMK_HELPER_CORE_mod_morph compatible = "zmk,behavior-mod-morph"; #binding-cells = <0>
|
||||
#define ZMK_HELPER_CORE_sticky_key compatible = "zmk,behavior-sticky-key"; #binding-cells = <1>
|
||||
#define ZMK_HELPER_CORE_tap_dance compatible = "zmk,behavior-tap-dance"; #binding-cells = <0>
|
||||
|
||||
#define ZMK_BEHAVIOR_STRINGIFY(x) #x
|
||||
#define ZMK_BEHAVIOR(name, type, ...) \
|
||||
/ { \
|
||||
behaviors { \
|
||||
name: name { \
|
||||
label = ZMK_BEHAVIOR_STRINGIFY(ZB_ ## name); \
|
||||
ZMK_HELPER_CORE_ ## type; \
|
||||
__VA_ARGS__ \
|
||||
}; \
|
||||
}; \
|
||||
};
|
||||
|
||||
#define ZMK_LAYER(name, layout) \
|
||||
/ { \
|
||||
keymap { \
|
||||
compatible = "zmk,keymap"; \
|
||||
name { \
|
||||
bindings = <layout>; \
|
||||
}; \
|
||||
}; \
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue