Skip to content

Commit

Permalink
feat(sweep): bluetooth, power, names
Browse files Browse the repository at this point in the history
  • Loading branch information
JJGadgets committed Mar 8, 2024
1 parent ba81258 commit 3c1ef12
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 27 deletions.
11 changes: 11 additions & 0 deletions config/cradio.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CONFIG_ZMK_KEYBOARD_NAME="JJGadgets"
CONFIG_ZMK_BLE=y
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_TIMEOUT=120000
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000
CONFIG_ZMK_EXT_POWER=y
CONFIG_ZMK_BLE_PASSKEY_ENTRY=y
CONFIG_ZMK_USB_BOOT=y
CONFIG_USB_DEVICE_MANUFACTURER="JJGadgets"
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y
91 changes: 64 additions & 27 deletions config/cradio.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// https://github.com/zmkfirmware/zmk/tree/main/app/dts/behaviors
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/ext_power.h>

// Home row mods macro
#define HRML(k1,k2,k3,k4) &ht LSHFT k1 &ht LALT k2 &ht LCTRL k3 &ht LGUI k4
Expand All @@ -18,36 +20,86 @@
#define FN 3

/ {
behaviors {
//mm: mod_morph {
// compatible = "zmk,behavior-mod-morph";
// #binding-cells = <0>;
// bindings = <&kp>, <&kp>;
// mods = <(MOD_RALT)>;
//};
mmleft: mod_morph_left {
compatible = "zmk,behavior-mod-morph";
#binding-cells = <0>;
bindings = <&kp N>, <&kp LEFT>;
mods = <(MOD_RALT)>;
};
mmdown: mod_morph_down {
compatible = "zmk,behavior-mod-morph";
#binding-cells = <0>;
bindings = <&kp E>, <&kp DOWN>;
mods = <(MOD_RALT)>;
};
mmup: mod_morph_up {
compatible = "zmk,behavior-mod-morph";
#binding-cells = <0>;
bindings = <&kp I>, <&kp UP>;
mods = <(MOD_RALT)>;
};
mmright: mod_morph_right {
compatible = "zmk,behavior-mod-morph";
#binding-cells = <0>;
bindings = <&kp O>, <&kp RIGHT>;
mods = <(MOD_RALT)>;
};
mmab: mod_morph_apostrophe_backspace {
compatible = "zmk,behavior-mod-morph";
#binding-cells = <0>;
bindings = <&kp BACKSPACE>, <&kp APOSTROPHE>;
mods = <(MOD_RALT)>;
};
mmds: mod_morph_delete_semicolon {
compatible = "zmk,behavior-mod-morph";
#binding-cells = <0>;
bindings = <&kp SEMICOLON>, <&kp DELETE>;
mods = <(MOD_RALT)>;
};
mto: mod_to_layer { // tap for layer, hold for modifier
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
flavor = "hold-preferred";
tapping-term-ms = <200>;
bindings = <&kp>, <&to>;
};
};
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
//╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮
//│ Q │ W │ F │ P │ G │ │ J │ L │ U │ Y │ '"<BSPC>│
&kp Q &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &mm APOS BSPC
&kp Q &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &mmab
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ A │ R │ S │ T │ D │ │ H │ N │ E │ I │ O │
&kp A &kp R &kp S &kp T &kp D &kp H &mm LEFT N &mm DOWN E &mm UP I &mm RIGHT O
&kp A &kp R &kp S &kp T &kp D &kp H &mmleft &mmdown &mmup &mmright
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ Z │ X │ C │ V │ B │ │ K │ M │ ,< │ .> │ /? │
&kp Z &mt LCTRL X &mt RALT C &mt LGUI V &lt NAVI B &kp K &mt LGUI M &mt LALT COMMA &mt LCTRL DOT &kp FSLH
//╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯
&mt LCTRL ENTER &mt LSHFT SPACE &gresc &mto RALT 1
&mt LCTRL ENTER &mt LSHFT SPACE &gresc &mto RALT 1 // devicetree error: <Node /pin-controller/uart0_default in '/tmp/zmk-config/zephyr/misc/empty_file.c'> lacks #binding-cells
// ╰──────────┴──────────╯ ╰──────────┴──────────╯
>;
};

num_layer {
bindings = < // TODO: Layer 2
//╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮
//│ PLAY │ 1 │ 2 │ 3 │ =+ │ │ Fn Layer │ [{ │ ]} │ \| │ ;: │
&kp C_PP &kp N1 &kp N2 &kp N3 &kp EQUAL &to FN &kp RBKT &kp BSLH &kp &mm DEL SEMI
&kp C_PP &kp N1 &kp N2 &kp N3 &kp EQUAL &to FN &kp LBKT &kp RBKT &kp BSLH &mmds
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ DELETE │ 4 │ 5 │ 6 │ 0 │ │ PSCRN │ LEFT │ DOWN │ UP │ RIGHT │
&kp DEL &kp N4 &kp N5 &kp N6 &kp N0 &kp PSCRN &kp LEFT &kp DOWN &kp UP &kp RIGHT
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ ` ESC │ 7 │ 8 │ 9 │ -_ │ │ TAB │ HOME │ PG_UP │ PG_DOWN │ END │
&gresc &kp N7 &kp N8 &kp N9 &kp MINUS &kp TAB &kp HOME &kp PG_UP &kp PG_DOWN &kp END
//│ ` ESC │ 7 │ 8 │ 9 │ -_ │ │ TAB │ HOME │ PG_UP │ PG_DN │ END │
&gresc &kp N7 &kp N8 &kp N9 &kp MINUS &kp TAB &kp HOME &kp PG_UP &kp PG_DN &kp END
//╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯
&to 0 &mt LSHFT SPACE &mt LCTRL ENTER &kp RALT
// ╰──────────┴──────────╯ ╰──────────┴──────────╯
Expand All @@ -56,14 +108,14 @@
navi_layer {
bindings = <
//╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮
//│ HOME │ PG_DOWN │ PG_UP │ END │ PSCRN │ │ │ │ │ │ │
&kp HOME &kp PG_DOWN &kp PG_UP &kp END &kp PSCRN &trans &trans &trans &trans &trans
//│ HOME │ PG_DN │ PG_UP │ END │ PSCRN │ │ │ │ │ │ │
&kp HOME &kp PG_DN &kp PG_UP &kp END &kp PSCRN &trans &trans &bt BT_CLR &bt BT_CLR_ALL &trans
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ LEFT │ DOWN │ UP │ RIGHT │ Default │ │ │ │ │ │ │
&kp LEFT &kp DOWN &kp UP &kp RIGHT &to NUM &trans &trans &trans &trans &trans
//│ LEFT │ DOWN │ UP │ RIGHT │ Default │ │ │TODO:BTDSC│ │ │ │
&kp LEFT &kp DOWN &kp UP &kp RIGHT &to NUM &out OUT_TOG &trans &bt BT_PRV &bt BT_NXT &ext_power EP_TOG
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ LCTRL │ TAB │ LALT │ LGUI │ │ │ │ │ │ │ │
&kp LCTRL &kp TAB &kp LALT &kp LGUI &trans &trans &trans &trans &trans &trans
&kp LCTRL &kp TAB &kp LALT &kp LGUI &trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4
//╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯
&trans &trans &trans &trans
// ╰──────────┴──────────╯ ╰──────────┴──────────╯
Expand All @@ -87,21 +139,6 @@
};
// TODO: mouse layer
};
behaviors {
/omit-if-no-ref/ mm: mod_morph {
compatible = "zmk,behavior-mod-morph";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
mods = <(MOD_RALT)>;
};
/omit-if-no-ref/ mto: mod_to_layer { // tap for layer, hold for modifier
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
flavor = "hold-preferred";
tapping-term-ms = <200>;
bindings = <&kp>, <&to>;
};
};
// hold: hold_tap {
// compatible = "zmk,behavior-hold-tap";
// #binding-cells = <2>;
Expand Down

0 comments on commit 3c1ef12

Please sign in to comment.