diff --git a/app/boards/native_posix_64.overlay b/app/boards/native_posix_64.overlay index d0526ca38eb..2e571c4b71d 100644 --- a/app/boards/native_posix_64.overlay +++ b/app/boards/native_posix_64.overlay @@ -1,4 +1,4 @@ -#include + #include #include diff --git a/app/boards/shields/minivan_studio_tester/minivan_studio_tester.keymap b/app/boards/shields/minivan_studio_tester/minivan_studio_tester.keymap index 531d8e0ccad..307861ea39b 100644 --- a/app/boards/shields/minivan_studio_tester/minivan_studio_tester.keymap +++ b/app/boards/shields/minivan_studio_tester/minivan_studio_tester.keymap @@ -4,6 +4,8 @@ * SPDX-License-Identifier: MIT */ +#define ZMK_STUDIO_BEHAVIORS_KEEP_ALL 1 + #include #include diff --git a/app/dts/behaviors/backlight.dtsi b/app/dts/behaviors/backlight.dtsi index dd045effed3..da11e30880a 100644 --- a/app/dts/behaviors/backlight.dtsi +++ b/app/dts/behaviors/backlight.dtsi @@ -6,8 +6,11 @@ / { behaviors { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_BL) + /omit-if-no-ref/ +#endif // Behavior can be invoked on peripherals, so name must be <= 8 characters. - /omit-if-no-ref/ bl: bcklight { + bl: bcklight { compatible = "zmk,behavior-backlight"; #binding-cells = <2>; display-name = "Backlight"; diff --git a/app/dts/behaviors/bluetooth.dtsi b/app/dts/behaviors/bluetooth.dtsi index bece156f8fb..d5b1b5f087e 100644 --- a/app/dts/behaviors/bluetooth.dtsi +++ b/app/dts/behaviors/bluetooth.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ bt: bluetooth { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_BT) + /omit-if-no-ref/ +#endif + bt: bluetooth { compatible = "zmk,behavior-bluetooth"; #binding-cells = <2>; display-name = "Bluetooth"; diff --git a/app/dts/behaviors/caps_word.dtsi b/app/dts/behaviors/caps_word.dtsi index 05431bd8db2..5939b82a47f 100644 --- a/app/dts/behaviors/caps_word.dtsi +++ b/app/dts/behaviors/caps_word.dtsi @@ -6,9 +6,14 @@ #include +#define ZMK_STUDIO_BEHAVIORS_KEEP_CAPS_WORD BALES + / { behaviors { - /omit-if-no-ref/ caps_word: caps_word { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_CAPS_WORD) + /omit-if-no-ref/ +#endif + caps_word: caps_word { compatible = "zmk,behavior-caps-word"; #binding-cells = <0>; continue-list = ; diff --git a/app/dts/behaviors/gresc.dtsi b/app/dts/behaviors/gresc.dtsi index 2643a383d81..d64acc7a7e2 100644 --- a/app/dts/behaviors/gresc.dtsi +++ b/app/dts/behaviors/gresc.dtsi @@ -8,7 +8,10 @@ / { behaviors { - /omit-if-no-ref/ gresc: grave_escape { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_GRAVE_ESCAPE) + /omit-if-no-ref/ +#endif + gresc: grave_escape { compatible = "zmk,behavior-mod-morph"; #binding-cells = <0>; bindings = <&kp ESC>, <&kp GRAVE>; diff --git a/app/dts/behaviors/key_press.dtsi b/app/dts/behaviors/key_press.dtsi index 2435699b6ab..ffea2cc07ee 100644 --- a/app/dts/behaviors/key_press.dtsi +++ b/app/dts/behaviors/key_press.dtsi @@ -6,8 +6,10 @@ / { behaviors { - /* DEPRECATED: `cp` will be removed in the future */ - /omit-if-no-ref/ cp: kp: key_press { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_KEY_PRESS) + /omit-if-no-ref/ +#endif + kp: key_press { compatible = "zmk,behavior-key-press"; #binding-cells = <1>; display-name = "Key Press"; diff --git a/app/dts/behaviors/key_repeat.dtsi b/app/dts/behaviors/key_repeat.dtsi index cd5d3771dcb..4537cb9091c 100644 --- a/app/dts/behaviors/key_repeat.dtsi +++ b/app/dts/behaviors/key_repeat.dtsi @@ -8,7 +8,10 @@ / { behaviors { - /omit-if-no-ref/ key_repeat: key_repeat { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_KEY_REPEAT) + /omit-if-no-ref/ +#endif + key_repeat: key_repeat { compatible = "zmk,behavior-key-repeat"; #binding-cells = <0>; usage-pages = ; diff --git a/app/dts/behaviors/key_toggle.dtsi b/app/dts/behaviors/key_toggle.dtsi index a7b66aab1af..e2f17be3b71 100644 --- a/app/dts/behaviors/key_toggle.dtsi +++ b/app/dts/behaviors/key_toggle.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ kt: key_toggle { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_KEY_TOGGLE) + /omit-if-no-ref/ +#endif + kt: key_toggle { compatible = "zmk,behavior-key-toggle"; #binding-cells = <1>; display-name = "Key Toggle"; diff --git a/app/dts/behaviors/layer_tap.dtsi b/app/dts/behaviors/layer_tap.dtsi index 2858bf17bc5..39aa1e304ae 100644 --- a/app/dts/behaviors/layer_tap.dtsi +++ b/app/dts/behaviors/layer_tap.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ lt: layer_tap { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_LAYER_TAP) + /omit-if-no-ref/ +#endif + lt: layer_tap { compatible = "zmk,behavior-hold-tap"; #binding-cells = <2>; flavor = "tap-preferred"; diff --git a/app/dts/behaviors/mod_tap.dtsi b/app/dts/behaviors/mod_tap.dtsi index 0b46f77e739..741fb9d72e7 100644 --- a/app/dts/behaviors/mod_tap.dtsi +++ b/app/dts/behaviors/mod_tap.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ mt: mod_tap { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_MOD_TAP) + /omit-if-no-ref/ +#endif + mt: mod_tap { compatible = "zmk,behavior-hold-tap"; #binding-cells = <2>; flavor = "hold-preferred"; diff --git a/app/dts/behaviors/momentary_layer.dtsi b/app/dts/behaviors/momentary_layer.dtsi index cae08d5f101..6f3ba35d247 100644 --- a/app/dts/behaviors/momentary_layer.dtsi +++ b/app/dts/behaviors/momentary_layer.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ mo: momentary_layer { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_MOMENTARY_LAYER) + /omit-if-no-ref/ +#endif + mo: momentary_layer { compatible = "zmk,behavior-momentary-layer"; #binding-cells = <1>; display-name = "Momentary Layer"; diff --git a/app/dts/behaviors/mouse_key_press.dtsi b/app/dts/behaviors/mouse_key_press.dtsi index 975c24aaafb..872b43075ba 100644 --- a/app/dts/behaviors/mouse_key_press.dtsi +++ b/app/dts/behaviors/mouse_key_press.dtsi @@ -1,6 +1,9 @@ / { behaviors { - /omit-if-no-ref/ mkp: mouse_key_press { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_MOUSE_KEY_PRESS) + /omit-if-no-ref/ +#endif + mkp: mouse_key_press { compatible = "zmk,behavior-mouse-key-press"; #binding-cells = <1>; }; diff --git a/app/dts/behaviors/none.dtsi b/app/dts/behaviors/none.dtsi index a9a820c30b5..1e911696372 100644 --- a/app/dts/behaviors/none.dtsi +++ b/app/dts/behaviors/none.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ none: none { +#if !defined(ZMK_STUDIO_BUILD) + /omit-if-no-ref/ +#endif + none: none { compatible = "zmk,behavior-none"; #binding-cells = <0>; display-name = "None"; diff --git a/app/dts/behaviors/outputs.dtsi b/app/dts/behaviors/outputs.dtsi index 3047852adce..3760744a33b 100644 --- a/app/dts/behaviors/outputs.dtsi +++ b/app/dts/behaviors/outputs.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ out: outputs { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_OUT) + /omit-if-no-ref/ +#endif + out: outputs { compatible = "zmk,behavior-outputs"; #binding-cells = <1>; display-name = "Output Selection"; diff --git a/app/dts/behaviors/soft_off.dtsi b/app/dts/behaviors/soft_off.dtsi index a5c9d255bc1..4523b139f65 100644 --- a/app/dts/behaviors/soft_off.dtsi +++ b/app/dts/behaviors/soft_off.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ soft_off: z_so_off { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_SOFT_OFF) + /omit-if-no-ref/ +#endif + soft_off: z_so_off { compatible = "zmk,behavior-soft-off"; #binding-cells = <0>; split-peripheral-off-on-press; diff --git a/app/dts/behaviors/sticky_key.dtsi b/app/dts/behaviors/sticky_key.dtsi index 382a7254e7b..cc34b515e05 100644 --- a/app/dts/behaviors/sticky_key.dtsi +++ b/app/dts/behaviors/sticky_key.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ sk: sticky_key { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_STICKY_KEY) + /omit-if-no-ref/ +#endif + sk: sticky_key { compatible = "zmk,behavior-sticky-key"; #binding-cells = <1>; release-after-ms = <1000>; @@ -14,7 +17,10 @@ ignore-modifiers; display-name = "Sticky Key"; }; - /omit-if-no-ref/ sl: sticky_layer { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_STICKY_LAYER) + /omit-if-no-ref/ +#endif + sl: sticky_layer { compatible = "zmk,behavior-sticky-key"; #binding-cells = <1>; release-after-ms = <1000>; diff --git a/app/dts/behaviors/to_layer.dtsi b/app/dts/behaviors/to_layer.dtsi index 3c740209cb1..bce2711ce92 100644 --- a/app/dts/behaviors/to_layer.dtsi +++ b/app/dts/behaviors/to_layer.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ to: to_layer { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_TO_LAYER) + /omit-if-no-ref/ +#endif + to: to_layer { compatible = "zmk,behavior-to-layer"; #binding-cells = <1>; display-name = "To Layer"; diff --git a/app/dts/behaviors/toggle_layer.dtsi b/app/dts/behaviors/toggle_layer.dtsi index ea9b25b7c1d..597ce4f524b 100644 --- a/app/dts/behaviors/toggle_layer.dtsi +++ b/app/dts/behaviors/toggle_layer.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ tog: toggle_layer { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_TOGGLE_LAYER) + /omit-if-no-ref/ +#endif + tog: toggle_layer { compatible = "zmk,behavior-toggle-layer"; #binding-cells = <1>; display-name = "Toggle Layer"; diff --git a/app/dts/behaviors/transparent.dtsi b/app/dts/behaviors/transparent.dtsi index 03ec36a64e8..0ed28b0d188 100644 --- a/app/dts/behaviors/transparent.dtsi +++ b/app/dts/behaviors/transparent.dtsi @@ -6,7 +6,10 @@ / { behaviors { - /omit-if-no-ref/ trans: transparent { +#if !defined(ZMK_STUDIO_BEHAVIORS_KEEP_ALL) && !defined(ZMK_STUDIO_BEHAVIORS_KEEP_TRANS) + /omit-if-no-ref/ +#endif + trans: transparent { compatible = "zmk,behavior-transparent"; #binding-cells = <0>; display-name = "Transparent";