Skip to content

Commit

Permalink
improve home row
Browse files Browse the repository at this point in the history
  • Loading branch information
wochap committed May 10, 2024
1 parent 9f1f366 commit 8fd411a
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 4 deletions.
27 changes: 23 additions & 4 deletions config/corne.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#include "keypos_42keys.h"

// C Macros
#define C_HM_L(k1, k2, k3, k4) &c_hm LGUI k1 &c_hm LALT k2 &c_hm LCTRL k3 &c_hm LSHIFT k4
#define C_HM_R(k1, k2, k3, k4) &c_hm RSHIFT k1 &c_hm RCTRL k2 &c_hm RALT k3 &c_hm RGUI k4
#define C_HM_L(k1, k2, k3, k4) &c_hm_l LGUI k1 &c_hm_l LALT k2 &c_hm_l LCTRL k3 &c_hm_l LSHIFT k4
#define C_HM_R(k1, k2, k3, k4) &c_hm_r RSHIFT k1 &c_hm_r RCTRL k2 &c_hm_r RALT k3 &c_hm_r RGUI k4
#define C_LT(l1, k1) &c_lt l1 k1
#define XXXXXX &none
#define ______ &trans
#define KEYS_L LT4 LT3 LT2 LT1 LT0 LM4 LM3 LM2 LM1 LM0 LB4 LB3 LB2 LB1 LB0 // left-hand keys
#define KEYS_R RT0 RT1 RT2 RT3 RT4 RM0 RM1 RM2 RM3 RM4 RB0 RB1 RB2 RB3 RB4 // right-hand keys
#define KEYS_T LH2 LH1 LH0 RH0 RH1 RH2 // thumb keys

// Layers
#define COLEMAK_DH 0
Expand All @@ -27,13 +31,28 @@
/ {
// docs: https://zmk.dev/docs/behaviors/hold-tap
behaviors {
c_hm: homerow_mod {
c_hm_l: homerow_mod {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
quick-tap-ms = <150>;
tapping-term-ms = <220>;
require-prior-idle-ms = <120>; // tap if prev non modifier key was pressed within that time
flavor = "tap-preferred";
bindings = <&kp>, <&kp>;
hold-trigger-key-positions = <KEYS_R KEYS_T>;
hold-trigger-on-release; // delay positional check until key-release
};

c_hm_r: homerow_mod {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
quick-tap-ms = <150>;
tapping-term-ms = <220>;
require-prior-idle-ms = <120>; // tap if prev non modifier key was pressed within that time
flavor = "tap-preferred";
bindings = <&kp>, <&kp>;
hold-trigger-key-positions = <KEYS_L KEYS_T>;
hold-trigger-on-release; // delay positional check until key-release
};

c_lt: layer_tab {
Expand Down Expand Up @@ -149,4 +168,4 @@
};
};

// vim: ft=c
// vim: ft=c
60 changes: 60 additions & 0 deletions config/keypos_42keys.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* 42 KEY MATRIX / LAYOUT MAPPING
╭────────────────────────┬────────────────────────╮ ╭─────────────────────────┬─────────────────────────╮
│ 0 1 2 3 4 5 │ 6 7 8 9 10 11 │ │ LT5 LT4 LT3 LT2 LT1 LT0 │ RT0 RT1 RT2 RT3 RT4 RT5 │
│ 12 13 14 15 16 17 │ 18 19 20 21 22 23 │ │ LM5 LM4 LM3 LM2 LM1 LM0 │ RM0 RM1 RM2 RM3 RM4 RM5 │
│ 24 25 26 27 28 29 │ 30 31 32 33 34 35 │ │ LB5 LB4 LB3 LB2 LB1 LB0 │ RB0 RB1 RB2 RB3 RB4 RB5 │
╰───────────╮ 36 37 38 │ 39 40 41 ╭───────────╯ ╰───────────╮ LH2 LH1 LH0 │ RH0 RH1 RH2 ╭───────────╯
╰────────────┴────────────╯ ╰─────────────┴─────────────╯ */

#pragma once

#define LT0 5 // left-top row
#define LT1 4
#define LT2 3
#define LT3 2
#define LT4 1
#define LT5 0

#define RT0 6 // right-top row
#define RT1 7
#define RT2 8
#define RT3 9
#define RT4 10
#define RT5 11

#define LM0 17 // left-middle row
#define LM1 16
#define LM2 15
#define LM3 14
#define LM4 13
#define LM5 12

#define RM0 18 // right-middle row
#define RM1 19
#define RM2 20
#define RM3 21
#define RM4 22
#define RM5 23

#define LB0 29 // left-bottom row
#define LB1 28
#define LB2 27
#define LB3 26
#define LB4 25
#define LB5 24

#define RB0 30 // right-bottom row
#define RB1 31
#define RB2 32
#define RB3 33
#define RB4 34
#define RB5 35

#define LH0 38 // left thumb keys
#define LH1 37
#define LH2 36

#define RH0 39 // right thumb keys
#define RH1 40
#define RH2 41

0 comments on commit 8fd411a

Please sign in to comment.