Skip to content

Commit

Permalink
a bunch of changes, added combos for easier one shot symbol access
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicbuffalo committed Feb 26, 2024
1 parent b0a57b8 commit 7850657
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 22 deletions.
30 changes: 30 additions & 0 deletions config/combos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* Right hand combos */
ZMK_COMBO(lbrc, &kp LBRC, RT1 RT2, DEF SYM NUM)
ZMK_COMBO(lbkt, &kp LBKT, RM1 RM2, DEF SYM NUM)
ZMK_COMBO(lpar, &kp LPAR, RB1 RB2, DEF SYM NUM)
ZMK_COMBO(lbrc, &kp RBRC, RT2 RT3, DEF SYM NUM)
ZMK_COMBO(lbkt, &kp RBKT, RM2 RM3, DEF SYM NUM)
ZMK_COMBO(lpar, &kp RPAR, RB2 RB3, DEF SYM NUM)
ZMK_COMBO(at, &kp AT, RM1 RM3, DEF)
ZMK_COMBO(hash, &kp HASH, RB1 RB3, DEF)
ZMK_COMBO(grave, &kp GRAVE, RT1 RT3, DEF)

/* Left hand combos */
ZMK_COMBO(spectacle_full, SPC_FULL, LT2 LT1, NAV SYM)
ZMK_COMBO(spectacle_move, SPC_MVR, LB2 LB1, NAV SYM)

ZMK_COMBO(bang, &kp EXCL, LT2 LT1, DEF NUM)
ZMK_COMBO(equals, &kp EQUAL, LM2 LM1, DEF NUM)
ZMK_COMBO(amps, &kp AMPS, LB2 LB1, DEF NUM)
ZMK_COMBO(gt, &kp GT, LT3 LT2, DEF NUM)
ZMK_COMBO(plus, &kp PLUS, LM3 LM2, DEF NUM)
ZMK_COMBO(pipe, &kp PIPE, LB3 LB2, DEF NUM)
ZMK_COMBO(lt, &kp LT, LT3 LT1, DEF NUM)
ZMK_COMBO(minus, &kp MINUS, LM3 LM1, DEF NUM)
ZMK_COMBO(star, &kp STAR, LB3 LB1, DEF NUM)

/* Cross combos */

/* both home index fingers: shortcat */
ZMK_COMBO(shortcat, SHRTCAT, LM1 RM1, DEF)

18 changes: 17 additions & 1 deletion config/custom_behaviors.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ ZMK_BEHAVIOR(lt_spc, hold_tap,
flavor = "balanced";
tapping-term-ms = <200>;
quick-tap-ms = <QUICK_TAP_MS>;
require-prior-idle-ms = <150>;
bindings = <&mo>, <&spund>;
)
ZMK_BEHAVIOR(spund, mod_morph,
Expand Down Expand Up @@ -133,6 +134,13 @@ ZMK_BEHAVIOR(sticky_num_dance, tap_dance,
tapping-term-ms = <300>;
bindings = <&sk LSHFT>, <&sl NUM>; // reverse this for sticky-num on single tap
)
// tap: num word | double-tap: esc | hold: layer
ZMK_BEHAVIOR(numl_layer, hold_tap,
flavor = "balanced";
tapping-term-ms = <200>;
quick-tap-ms = <QUICK_TAP_MS>;
bindings = <&mo>, <&numl_dance>;
)
// tap: caps word | double-tap: caps lock | hold: layer
ZMK_BEHAVIOR(caps_layer, hold_tap,
flavor = "balanced";
Expand All @@ -146,6 +154,11 @@ ZMK_BEHAVIOR(caps_dance, tap_dance,
tapping-term-ms = <200>;
bindings = <&caps_word>, <&kp CAPS>;
)
// tap: num word | double-tap: esc
ZMK_BEHAVIOR(numl_dance, tap_dance,
tapping-term-ms = <200>;
bindings = <&num_word>, <&kp ESC>;
)
ZMK_BEHAVIOR(comma_space, macro,
bindings = <&macro_tap &kp COMMA &kp SPACE>;
)
Expand Down Expand Up @@ -211,14 +224,17 @@ ZMK_BEHAVIOR(comma_dance, tap_dance,
// Thumb keys
#define SPC_NAV &lt_spc NAV 0 // tap: space | shift + tap: underscore | hold: NAV layer
#define TAB_HYP &mt RHYP TAB // tap: tab | hold: HYPER key
#define ENTER_HYP &mt RHYP ENTER // tap: enter | hold: HYPER key
#define ESC_HYP &mt RHYP ESC // tap: escape | hold: HYPER key
/* #define RET_HYP &mt RHYP ENTER // tap: enter | hold: HYPER key */
#define BSPC_SYM &lt_del SYM 0 // tap: backspace | lshft + tap: delete | rshft + tap: shift-delete | hold: SYM layer
/* #define SHFT_MS &shift_num MS 0 // tap: sticky shift | double-tap: sticky num layer | hold: MS layer */
#define CAPS_MS &caps_layer MS 0 // tap: caps word | double-tap: caps lock | hold: MS layer
#define NUML_MS &numl_layer MS 0 // tap: num word | double-tap: esc | hold: MS layer
#define SHIFT_ESC &shift_esc // tap: sticky shift | double-tap: esc | hold: shift
#define SHRTCAT_FN &lt FN LA(LC(SPACE)) // tap: shortcat | hold: FN layer

#define SHRTCAT &kp LA(LC(SPACE))

/* #define MAKE_LONG_HOLD(NAME, HOLD) \ */
/* ZMK_BEHAVIOR(NAME, hold_tap, \ */
/* flavor = "tap-preferred"; \ */
Expand Down
7 changes: 7 additions & 0 deletions config/homerow_mods.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ MAKE_HRM(hmr, &kp, &kp, KEYS_L THUMBS) // right-hand
#define SYM_RBKT &hmr RCTRL RBKT
#define SYM_AT &hmr RALT AT
#define SYM_DOLLAR &hmr RGUI DOLLAR

#define NUML_N4 &hml LALT N4
#define NUML_N5 &hml LCTRL N5
#define NUML_N6 &hml LSHFT N6
#define NUMR_N4 &hmr RSHFT N4
#define NUMR_N5 &hmr RCTRL N5
#define NUMR_N6 &hmr RALT N6
26 changes: 14 additions & 12 deletions config/totem.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@

#define ___ &trans

#define COLEMAK 0
#define DEF 0 // Default colemak layer
#define NUM 1
#define SYM 2
#define FN 3
#define MOD 4
#define MS 5
#define NAV 6

#include "combos.h"

/* Global settings */
#include "general.h"

Expand All @@ -56,9 +58,9 @@
// ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫
A_LGUI R_LALT S_LCTRL T_LSHFT &kp G &lt MOD M N_RSHFT E_RCTRL I_RALT O_RGUI
// ┏━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┓
ESC_HYP &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &comma_morph &dot_morph &qexcl TAB_HYP
ESC_HYP &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &comma_morph &dot_morph &kb FSLH ENTER_HYP
// ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛
CAPS_MS &lt NUM ENTER SPC_NAV BSPC_SYM SHIFT_ESC SHRTCAT_FN
NUML_MS &lt NUM TAB SPC_NAV BSPC_SYM SHIFT_ESC SHRTCAT_FN
// ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛
>;
};
Expand All @@ -71,13 +73,13 @@
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
bindings = <
// ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
&kp HASH &kp LT &kp GT &kp EXCL &kp SEMI &kp QMARK &kp N7 &kp N8 &kp N9 &kp N0
&kp N0 &kp N7 &kp N8 &kp N9 &kp SEMI &kp QMARK &kp N7 &kp N8 &kp N9 &kp N0
// ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫
SYM_CARET SYM_MINUS SYM_PLUS SYM_EQUAL &kp PRCNT ___ &kp N4 &kp N5 &kp N6 SYM_DOLLAR
SYM_CARET NUML_N4 NUML_N5 NUML_N6 &kp PRCNT ___ NUMR_N4 NUMR_N5 NUMR_N6 SYM_DOLLAR
// ┏━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┓
&kp LEFT &kp BSLH &kp STAR &kp PIPE &kp AMPS &kp TILDE &dot_morph &kp N1 &kp N2 &kp N3 &kp FSLH &kp RIGHT
&kp LEFT &kp BSLH &kp N1 &kp N2 &kp N3 &kp TILDE &dot_morph &kp N1 &kp N2 &kp N3 ___ &kp RIGHT
// ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛
&kp ENTER ___ &kp SPACE &kp SPACE &comma_morph ___
&kp ESC ___ ___ &kp BSPC ___ ___
// ┗━━━━━━━━━━━━━┻━━━━━━^━━━━━━┻━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛
>;
};
Expand All @@ -93,9 +95,9 @@
// ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫
SYM_CARET SYM_MINUS SYM_PLUS SYM_EQUAL &kp PRCNT ___ SYM_LBKT SYM_RBKT SYM_AT SYM_DOLLAR
// ┏━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┓
&kp LEFT &kp BSLH &kp STAR &kp PIPE &kp AMPS &kp TILDE &dot_morph &kp LPAR &kp RPAR &dot_morph &kp FSLH &kp RIGHT
&kp LEFT &kp BSLH &kp STAR &kp PIPE &kp AMPS &kp TILDE &dot_morph &kp LPAR &kp RPAR &dot_morph ___ &kp RIGHT
// ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛
___ ___ &comma_dance ___ ___ ___
___ ___ ___ ___ ___ ___
// ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛ ┗━━━━━━^━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛
>;
};
Expand Down Expand Up @@ -161,13 +163,13 @@
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
bindings = <
// ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
PREV_WINDOW NEXT_WINDOW PREV_TAB SPC_DOWN NEXT_TAB CMD_PASTE &kp PG_DN &kp PG_UP COPY_CUT CMD_UNDO
PREV_WINDOW NEXT_WINDOW PREV_TAB NEXT_TAB ___ CMD_PASTE &kp PG_DN &kp PG_UP COPY_CUT CMD_UNDO
// ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫
SYM_CARET ___ ___ ___ ___ &kp LEFT &kp DOWN &kp UP &kp RIGHT SYM_DOLLAR
// ┏━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┓
___ &kp BSLH ___ SWAP_PREV &swapper ___ &kp LS(TAB) &kp TAB &kp ESC ___ &kp FSLH ___
___ &kp BSLH ___ SWAP_PREV &swapper CMD_PASTE ___ ___ ___ ___ ___ ___
// ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛
___ ___ ___ &kp BSPC &kp ENTER ___
___ ___ ___ &bs_del ___ ___
// ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━^━━━━━━┛ ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛
>;
};
Expand Down
33 changes: 24 additions & 9 deletions config/zmk_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,27 @@
#define ZMK_BEHAVIOR_CORE_tri_state compatible = "zmk,behavior-tri-state"; #binding-cells = <0>

#define ZMK_BEHAVIOR(name, type, ...) \
/ { \
behaviors { \
name: name { \
label = ZMK_HELPER_STRINGIFY(ZB_ ## name); \
ZMK_BEHAVIOR_CORE_ ## type; \
__VA_ARGS__ \
}; \
}; \
};
/ { \
behaviors { \
name: name { \
label = ZMK_HELPER_STRINGIFY(ZB_ ## name); \
ZMK_BEHAVIOR_CORE_ ## type; \
__VA_ARGS__ \
}; \
}; \
};


#define ZMK_COMBO(name, combo_bindings, keypos, combo_layers) \
/ { \
combos { \
compatible = "zmk,combos"; \
combo_ ## name { \
timeout-ms = <30>; \
bindings = <combo_bindings>; \
key-positions = <keypos>; \
layers = <combo_layers>; \
require-prior-idle-ms = <150>; \
}; \
}; \
};

0 comments on commit 7850657

Please sign in to comment.