Skip to content

Commit

Permalink
Adding a binding for clearing the Bluetooth profiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
amacleod committed Oct 30, 2024
1 parent a16cf01 commit 2fe58b0
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions config/weejock.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
};
raise_layer { // layer 1
// ,-----------------------.
// |ZMKSt| | | |
// |ZMKSt| | |BTClr|
// | | | | |
// | | | | |
// | | | | |
// |#####| | : | Tab |
// `-----------------------'
bindings = <
&studio_unlock &trans &trans &trans
&studio_unlock &trans &trans &bt_hold_clear 0 BACKSPACE
&trans &trans &trans &trans
&trans &trans &trans &trans
&trans &trans &trans &trans
Expand All @@ -55,4 +55,24 @@
display-name = "Extra";
};
};

macros {
// Clear all BT profiles. This is needed because &bt cannot be used directly from hold-taps.
bluetooth_clear_all: bluetooth_clear_all {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&bt BT_CLEAR_ALL>;
};
};

behaviors {
// Hold a button for over a second to clear all BT profiles.
bt_hold_clear: bt_hold_clear {
compatible = "zmk,hold-tap";
#binding-cells = <2>;
flavor = "tap-preferred";
tapping-term-ms = <1000>;
bindings = <&bluetooth_clear_all>, <&kp>;
};
};
};

0 comments on commit 2fe58b0

Please sign in to comment.