From 72b2851a2e7cd06cb58b1195456985bf9c0af774 Mon Sep 17 00:00:00 2001 From: ldebritto Date: Sat, 19 Oct 2024 11:55:13 -0300 Subject: [PATCH] Bringing my own keymap --- .gitignore | 1 + config/cradio.conf | 12 ++ config/cradio.json | 48 +++++++ config/cradio.keymap | 324 ++++++++++++++++++++++++++++++++++--------- config/west.yml | 8 ++ readme.md | 87 ++++++++++++ 6 files changed, 412 insertions(+), 68 deletions(-) create mode 100644 .gitignore create mode 100644 config/cradio.json create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/config/cradio.conf b/config/cradio.conf index e69de29..11c5d4a 100644 --- a/config/cradio.conf +++ b/config/cradio.conf @@ -0,0 +1,12 @@ +# Name +CONFIG_ZMK_KEYBOARD_NAME="Black Sweep" + +# Sleep after 90 minutes +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=5400000 +CONFIG_ZMK_SLEEP=y + +# Improve range of BT radio, thus reducing interference when halves are spread apart +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y + +# BLE connection improvements +CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y \ No newline at end of file diff --git a/config/cradio.json b/config/cradio.json new file mode 100644 index 0000000..d2b4afa --- /dev/null +++ b/config/cradio.json @@ -0,0 +1,48 @@ +{ "id": "ferris_sweep", + "name": "Sweep", + "layouts": { + "3x5": { + "name": "3x5", + "layout": [ + { "row": 0, "col": 1, "x": 0, "y": 0.675 }, + { "row": 0, "col": 2, "x": 1, "y": 0.225 }, + { "row": 0, "col": 3, "x": 2, "y": 0 }, + { "row": 0, "col": 4, "x": 3, "y": 0.225 }, + { "row": 0, "col": 5, "x": 4, "y": 0.35 }, + { "row": 0, "col": 7, "x": 8, "y": 0.35 }, + { "row": 0, "col": 8, "x": 9, "y": 0.225 }, + { "row": 0, "col": 9, "x": 10, "y": 0 }, + { "row": 0, "col": 10, "x": 11, "y": 0.225 }, + { "row": 0, "col": 11, "x": 12, "y": 0.675 }, + + { "row": 1, "col": 1, "x": 0, "y": 1.675 }, + { "row": 1, "col": 2, "x": 1, "y": 1.225 }, + { "row": 1, "col": 3, "x": 2, "y": 1 }, + { "row": 1, "col": 4, "x": 3, "y": 1.225 }, + { "row": 1, "col": 5, "x": 4, "y": 1.35 }, + { "row": 1, "col": 7, "x": 8, "y": 1.35 }, + { "row": 1, "col": 8, "x": 9, "y": 1.225 }, + { "row": 1, "col": 9, "x": 10, "y": 1 }, + { "row": 1, "col": 10, "x": 11, "y": 1.225 }, + { "row": 1, "col": 11, "x": 12, "y": 1.675 }, + + { "row": 2, "col": 1, "x": 0, "y": 2.675 }, + { "row": 2, "col": 2, "x": 1, "y": 2.225 }, + { "row": 2, "col": 3, "x": 2, "y": 2 }, + { "row": 2, "col": 4, "x": 3, "y": 2.225 }, + { "row": 2, "col": 5, "x": 4, "y": 2.35 }, + { "row": 2, "col": 7, "x": 8, "y": 2.35 }, + { "row": 2, "col": 8, "x": 9, "y": 2.225 }, + { "row": 2, "col": 9, "x": 10, "y": 2 }, + { "row": 2, "col": 10, "x": 11, "y": 2.225 }, + { "row": 2, "col": 11, "x": 12, "y": 2.675 }, + + { "row": 3, "col": 4, "x": 2.48, "y": 3.225, "r": 15, "rx": 2.98, "ry": 7.895 }, + { "row": 3, "col": 5, "x": 2.48, "y": 3.3 , "r": 30, "rx": 2.98, "ry": 7.895 }, + { "row": 3, "col": 7, "x": 9.52, "y": 3.3 , "r": -30, "rx": 10.02, "ry": 7.895 }, + { "row": 3, "col": 8, "x": 9.52, "y": 3.225, "r": -15, "rx": 10.02, "ry": 7.895 } + ] + } + }, + "sensors": [] +} \ No newline at end of file diff --git a/config/cradio.keymap b/config/cradio.keymap index ab952fb..2a2d521 100644 --- a/config/cradio.keymap +++ b/config/cradio.keymap @@ -1,103 +1,291 @@ -// Copyright (c) 2022 The ZMK Contributors -// SPDX-License-Identifier: MIT - +#include // reqquires auto-layer module (https://github.com/urob/zmk-auto-layer) #include -#include #include +#include + +#define DEF 0 +#define NMT 1 // No-mod-taps for if I regret setting mod-taps and can't access my code or can't update my firmware on the keyboard +#define NUM 2 +#define NAV 3 +#define SYM 4 +#define FUN 5 + +#define HYPER LG(LC(LA(LSHFT))) -// Home row mods macro -#define HRML(k1,k2,k3,k4) &ht LSHFT k1 &ht LALT k2 &ht LCTRL k3 &ht LGUI k4 -#define HRMR(k1,k2,k3,k4) &ht RGUI k1 &ht RCTRL k2 &ht RALT k3 &ht RSHFT k4 +&sk { + quick-release; // Avoids "THis" problem (double capitalization) + release-after-ms = <86400000>;// Default is 1000 ms, raised to 1 day to emulate Callum's behavior that requires canceling on layer key. +}; + +&caps_word { continue-list = ; }; // K_CANCEL is for &lc macro, LSHFT is for PT-BR diacriticals on ^`~" keys. +&mt { flavor = "balanced"; }; // Using these for GLOBE keys and faster window management with Swish app as well as AOE layers / { + combos { + compatible = "zmk,combos"; + + left_hand_esc { + bindings = <&kp ESCAPE>; + key-positions = <0 10>; + require-prior-idle-ms = <200>; + }; + + left_hand_enter { + bindings = <&kp ENTER>; + key-positions = <3 13>; + require-prior-idle-ms = <200>; + }; + + left_hand_backspace { + bindings = <&kp BSPC>; + key-positions = <4 14>; + require-prior-idle-ms = <200>; + }; + + sticky_sym_layer_for_one_handed_typing { + key-positions = <32 33>; + bindings = <&sl SYM>; + layers = ; + require-prior-idle-ms = <200>; + }; + + toggle_mod_taps { + key-positions = <14 15>; + bindings = <&tog NMT>; + require-prior-idle-ms = <200>; + }; + + toggle_nav_layer_for_extended_edits_or_mouse_usage { + key-positions = <30 31>; + bindings = <&tog NAV>; + require-prior-idle-ms = <200>; + }; + + toggle_num_word { + key-positions = <12 30>; + bindings = <&num_word NUM>; // requires auto-layer module (https://github.com/urob/zmk-auto-layer) + layers = ; + }; + require-prior-idle-ms = <200>; + + toggle_caps_word { + key-positions = <12 17>; + bindings = <&caps_word>; + layers = ; + require-prior-idle-ms = <200>; + }; + + sys_bootloader { + key-positions = <20 21>; + bindings = <&bootloader>; + layers = ; + require-prior-idle-ms = <200>; + }; + + sys_connect_to_bt0 { + key-positions = <3 4>; + bindings = <&bt BT_SEL 0>; + layers = ; + }; + + sys_connect_to_bt1 { + key-positions = <13 14>; + bindings = <&bt BT_SEL 1>; + layers = ; + }; + + sys_connect_to_bt2 { + key-positions = <23 24>; + bindings = <&bt BT_SEL 2>; + layers = ; + }; + + sys_clear_current_bluetooth_profile { + key-positions = <28 29>; + bindings = <&bt BT_CLR>; + layers = ; + require-prior-idle-ms = <200>; + }; + + + }; + behaviors { - ht: hold_tap { + playnp: play_next_previous_media_key { + compatible = "zmk,behavior-tap-dance"; + #binding-cells = <0>; + tapping-term-ms = <300>; + bindings = + <&mt C_MUTE C_PLAY_PAUSE>, + <&kp C_NEXT>, + <&kp C_PREVIOUS>; + }; + + vb_up: volume_brightness_up_on_control { + compatible = "zmk,behavior-mod-morph"; + #binding-cells = <0>; + bindings = <&kp C_VOL_UP>, <&kp C_BRI_UP>; + mods = <(MOD_LCTL)>; + }; + + vb_dn: volume_brightness_down_on_control { + compatible = "zmk,behavior-mod-morph"; + #binding-cells = <0>; + bindings = <&kp C_VOL_DN>, <&kp C_BRI_DN>; + mods = <(MOD_LCTL)>; + }; + + swapper: swapper_for_apple_cmd_tab { + compatible = "zmk,behavior-tri-state"; // requires tri-state module (https://github.com/urob/zmk-tri-state) + #binding-cells = <0>; + bindings = <&kt RGUI>, <&kp TAB>, <&kt RGUI>; + ignored-key-positions = <7 16 17 18 9 19 29>;// Arrows and BSPC, ENTER and DEL + }; + + hrml: hrml { compatible = "zmk,behavior-hold-tap"; + label = "HRML"; + bindings = <&kp>, <&kp>; + #binding-cells = <2>; - flavor = "tap-preferred"; - tapping-term-ms = <220>; - quick-tap-ms = <150>; - require-prior-idle-ms = <100>; + hold-trigger-key-positions = <5 6 7 8 9 15 16 17 18 19 25 26 27 28 29 30 31 32 33>; // right-side + thumbs + flavor = "balanced"; + tapping-term-ms = <280>; + hold-trigger-on-release; + quick-tap-ms = <175>; + require-prior-idle-ms = <175>; + }; + + hrmr: hrmr { + compatible = "zmk,behavior-hold-tap"; + label = "HRMR"; bindings = <&kp>, <&kp>; + + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + hold-trigger-key-positions = <0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 30 31 32 33>; // left-side + thumbs + hold-trigger-on-release; + quick-tap-ms = <175>; + require-prior-idle-ms = <175>; + }; + + // Layer-tap variants for urob's hrm + + ltl: ltl { + compatible = "zmk,behavior-hold-tap"; + label = "LC_TAP_L"; + bindings = <&lc>, <&kp>; + + #binding-cells = <2>; + hold-trigger-key-positions = <5 6 7 8 9 15 16 17 18 19 25 26 27 28 29 30 31 32 33>; // right-side + thumbs + flavor = "balanced"; + tapping-term-ms = <280>; + hold-trigger-on-release; + quick-tap-ms = <175>; + require-prior-idle-ms = <175>; + }; + + ltr: ltr { + compatible = "zmk,behavior-hold-tap"; + label = "LC_TAP_R"; + bindings = <&lc>, <&kp>; + + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + hold-trigger-key-positions = <0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 30 31 32 33>; // left-side + thumbs + hold-trigger-on-release; + quick-tap-ms = <175>; + require-prior-idle-ms = <175>; + }; + + }; + + macros { + lc: mo_layer_switch_with_an_embeded_cancel_tap_for_clearing_any_queued_sticky_mods_on_layer_activation { + compatible = "zmk,behavior-macro-one-param"; + label = "mo_layer/cancel"; + wait-ms = <0>; + tap-ms = <0>; + #binding-cells = <1>; + bindings = + <¯o_tap>, + <&kp K_CANCEL ¯o_param_1to1>, + <¯o_press>, + <&mo MACRO_PLACEHOLDER>, + <¯o_pause_for_release>, + <¯o_param_1to1>, + <¯o_release>, + <&mo MACRO_PLACEHOLDER>; }; }; conditional_layers { compatible = "zmk,conditional-layers"; - tri_layer { - if-layers = <1 2>; - then-layer = <3>; + + tri_layer_for_function_and_number_row_keys { + if-layers =