From 3adef750a258d528dd58a78c35cd3aee40bccfad Mon Sep 17 00:00:00 2001 From: Stas Prokofyev Date: Sat, 29 Jun 2024 18:30:08 +0300 Subject: [PATCH] Safeguard dangerous BT behaviors --- config/boards/arm/dao/dao.keymap | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/config/boards/arm/dao/dao.keymap b/config/boards/arm/dao/dao.keymap index 2ef702121..0c508ddce 100644 --- a/config/boards/arm/dao/dao.keymap +++ b/config/boards/arm/dao/dao.keymap @@ -674,6 +674,15 @@ delay-ms = <0>; trigger-period-ms = <8>; // 16 }; + + // Safety + sbt: safe_bt { + compatible = "zmk,behavior-hold-tap"; + flavor = "tap-preferred"; + tapping-term-ms = <2000>; + #binding-cells = <2>; + bindings = <&btmac>, <&none>; + }; }; // Mouse @@ -731,6 +740,11 @@ , <&bt BT_SEL MACRO_PLACEHOLDER> ; }; + btmac: bt_macro { + compatible = "zmk,behavior-macro-one-param"; + #binding-cells = <1>; + bindings = <¯o_param_1to1>, <&bt MACRO_PLACEHOLDER 0>; + }; }; combos { @@ -898,9 +912,9 @@ // | (0) | | | | | KRPT | (0) | // ╰───────┴───────┴───────╯ ╰───────┴───────┴───────╯ bindings = < - &bootloader &bt BT_CLR_ALL &none &out OUT_TOG &out OUT_BLE &out OUT_USB &kp C_STOP &kp C_PP &kp C_VOL_UP &none &none &bootloader - &bt BT_CLR &btsel 0 &btsel 1 &btsel 2 &btsel 3 &btsel 4 &none &kp C_PREV &kp C_VOL_DN &kp C_NEXT &kp C_AL_LOCK &none - &sys_reset &bt BT_DISC 0 &bt BT_DISC 1 &bt BT_DISC 2 &bt BT_DISC 3 &bt BT_DISC 4 &none &none &kp C_MUTE &none &none &sys_reset + &bootloader &sbt BT_CLR_ALL &none &out OUT_TOG &out OUT_BLE &out OUT_USB &kp C_STOP &kp C_PP &kp C_VOL_UP &none &none &bootloader + &sbt BT_CLR &btsel 0 &btsel 1 &btsel 2 &btsel 3 &btsel 4 &none &kp C_PREV &kp C_VOL_DN &kp C_NEXT &kp C_AL_LOCK &none + &sys_reset &bt BT_DISC 0 &bt BT_DISC 1 &bt BT_DISC 2 &bt BT_DISC 3 &bt BT_DISC 4 &none &none &kp C_MUTE &none &none &sys_reset &none &none &none &none &key_repeat &none >; };