Skip to content

Commit

Permalink
Add keymap drawer graph
Browse files Browse the repository at this point in the history
  • Loading branch information
urob committed Jan 12, 2025
1 parent baaa607 commit 4e21e16
Show file tree
Hide file tree
Showing 7 changed files with 1,420 additions and 14 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
.build
.direnv
.venv
.west
modules
firmware
zephyr
zmk
# Ignore keymap-drawer output for now
draw/base.svg
draw/base.yaml
3 changes: 2 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ clean-nix:
draw:
#!/usr/bin/env bash
set -euo pipefail
keymap -c "{{ draw }}/config.yaml" parse -z "{{ config }}/base.keymap" >"{{ draw }}/base.yaml"
keymap -c "{{ draw }}/config.yaml" parse -z "{{ config }}/base.keymap" --virtual-layers Combos >"{{ draw }}/base.yaml"
yq -Yi '.combos.[].l = ["Combos"]' "{{ draw }}/base.yaml"
keymap -c "{{ draw }}/config.yaml" draw "{{ draw }}/base.yaml" -k "ferris/sweep" >"{{ draw }}/base.svg"
# initialize west
Expand Down
12 changes: 6 additions & 6 deletions config/base.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ ZMK_CONDITIONAL_LAYER(sys, FN NUM, SYS) // FN + NUM --> SYS.
ZMK_LAYER(name, LT RT LM RM LB RB LH RH)
#endif

ZMK_BASE_LAYER(base,
ZMK_BASE_LAYER(Base,
//╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp Q &kp W &kp F &kp P &kp B , &kp J &kp L &kp U &kp Y &kp SQT ,
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
Expand All @@ -200,7 +200,7 @@ ZMK_BASE_LAYER(base,
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
)

ZMK_BASE_LAYER(nav,
ZMK_BASE_LAYER(Nav,
//╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
___ ___ &kp LS(TAB) &swapper ___ , &kp PG_UP NAV_BSPC NAV_UP NAV_DEL ___ ,
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
Expand All @@ -212,7 +212,7 @@ ZMK_BASE_LAYER(nav,
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
)

ZMK_BASE_LAYER(fn,
ZMK_BASE_LAYER(Fn,
//╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp F12 &kp F7 &kp F8 &kp F9 ___ , ___ &kp C_PREV &kp C_VOL_UP &kp C_NEXT ___ ,
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
Expand All @@ -224,7 +224,7 @@ ZMK_BASE_LAYER(fn,
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
)

ZMK_BASE_LAYER(num,
ZMK_BASE_LAYER(Num,
//╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
___ &kp N7 &kp N8 &kp N9 ___ , ___ ___ ___ ___ ___ ,
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
Expand All @@ -236,7 +236,7 @@ ZMK_BASE_LAYER(num,
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
)

ZMK_BASE_LAYER(sys,
ZMK_BASE_LAYER(Sys,
//╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
_BT_SEL_KEYS_ , ___ ___ ___ ___ ___ ,
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
Expand All @@ -248,7 +248,7 @@ ZMK_BASE_LAYER(sys,
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
)

ZMK_BASE_LAYER(mouse,
ZMK_BASE_LAYER(Mouse,
//╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
___ ___ ___ ___ ___ , ___ &kp PG_UP U_MS_U &kp PG_DN ___ ,
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
Expand Down
8 changes: 6 additions & 2 deletions config/combos.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

/* Horizontal combos - left hand */
ZMK_COMBO(esc, &kp ESC, LT3 LT2, DEF NAV NUM, COMBO_TERM_FAST, COMBO_IDLE_FAST)
ZMK_COMBO(ret, &kp RETURN, LT2 LT1, DEF NAV NUM, COMBO_TERM_FAST, COMBO_IDLE_FAST)
ZMK_COMBO(mouse, &smart_mouse, LT3 LT1, DEF NAV NUM, COMBO_TERM_FAST, COMBO_IDLE_FAST)
ZMK_COMBO(ret, &kp RET, LT2 LT1, DEF NAV NUM, COMBO_TERM_FAST, COMBO_IDLE_FAST)
ZMK_COMBO(mouse, &smart_mouse, LT2 LT1, DEF NAV NUM, COMBO_TERM_FAST, COMBO_IDLE_FAST)

// Combos overlapping HRMs are set up as hold-taps themselves to allow for instantaneous
// chording of mods. Custom hold-tap instances can be bootstrapped on the go using the
Expand All @@ -35,13 +35,17 @@ ZMK_COMBO(del, &kp DEL, RT2 RT3, DEF NAV NUM, COMBO_TERM_FAST, COMBO_

ZMK_COMBO(lpar, &lpar_lt, RM1 RM2, DEF NUM, COMBO_TERM_FAST, COMBO_IDLE_FAST, RS(LCTRL), KEYS_L)
ZMK_COMBO(rpar, &rpar_gt, RM2 RM3, DEF NUM, COMBO_TERM_FAST, COMBO_IDLE_FAST, RS(LALT), KEYS_L)
#ifndef KEYMAP_DRAWER
ZMK_COMBO(lt, &kp LT, RM1 RM2, NAV , COMBO_TERM_FAST, COMBO_IDLE_FAST)
ZMK_COMBO(gt, &kp GT, RM2 RM3, NAV , COMBO_TERM_FAST, COMBO_IDLE_FAST)
#endif

ZMK_COMBO(lbkt, &kp LBKT, RB1 RB2, DEF NUM, COMBO_TERM_FAST, COMBO_IDLE_FAST)
ZMK_COMBO(rbkt, &kp RBKT, RB2 RB3, DEF NUM, COMBO_TERM_FAST, COMBO_IDLE_FAST)
#ifndef KEYMAP_DRAWER
ZMK_COMBO(lbrc, &kp LBRC, RB1 RB2, NAV , COMBO_TERM_FAST, COMBO_IDLE_FAST)
ZMK_COMBO(rbrc, &kp RBRC, RB2 RB3, NAV , COMBO_TERM_FAST, COMBO_IDLE_FAST)
#endif

/* Vertical combos - left hand */
ZMK_COMBO(at, &kp AT, LT3 LM3, DEF NAV NUM, COMBO_TERM_SLOW, COMBO_IDLE_SLOW)
Expand Down
Loading

0 comments on commit 4e21e16

Please sign in to comment.