home row mods!!

This commit is contained in:
Anish Lakhwara 2024-09-29 00:50:01 -07:00
parent 76f6fa04f0
commit e3015ce454
3 changed files with 80 additions and 11 deletions

View file

@ -9,12 +9,29 @@
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#include "zmk-helpers/helper.h"
#include "zmk-helpers/key-labels/42.h"
#include <dt-bindings/zmk/keys.h>
#define QUICK_TAP_MS 175
// Layer definitions
#define BASE 0
#define SYM 1
#define EXT 2
#define FNC 3
#define SETTINGS 6
#define SETTINGS 4
/* Homerow mods */
#define HM_TAPPING_TERM 300
#define HM_TAPPING_TERM_FAST 200
#define HM_PRIOR_IDLE 150
#define KEYS_L LT0 LT1 LT2 LT3 LT4 LM0 LM1 LM2 LM3 LM4 LB0 LB1 LB2 LB3 LB4 // left hand
#define KEYS_R RT0 RT1 RT2 RT3 RT4 RM0 RM1 RM2 RM3 RM4 RB0 RB1 RB2 RB3 RB4 // right hand
#define KEYS_T LH1 LH0 RH0 RH1 // thumbs on 34 keys
// -----------------
&sk {
@ -23,15 +40,59 @@
};
&mt {
&mt { // mode-tap config
flavor = "tap-preferred";
tapping_term_ms = <200>;
quick_tap_ms = <75>;
};
&lt { // layer-tap config
flavor = "balanced";
tapping-term-ms = <200>;
quick-tap-ms = <QUICK_TAP_MS>;
};
/ {
behaviors {
// Positional Homerow mods
// Homerow mods that prevent accidental activations when rolling keys,
// such as when typing `st` or `ne` on colemak-dh layouts or `as` on
// qwerty.
//
// Works by only allowing a mod to activate within tapping-term if
// it's on the opposite side of the keyboard or on the same side thumb
// keys.
// Further optimization using urob's timerless homerow mods method:
// https://github.com/urob/zmk-config#timeless-homerow-mods
hml: homerow_mods_left {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM>;
quick-tap-ms = <175>; // repeat on tap-into-hold
require-prior-idle-ms = <HM_PRIOR_IDLE>;
hold-trigger-key-positions = <KEYS_R KEYS_T>;
hold-trigger-on-release;
};
hmr: homerow_mods_right {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM>;
quick-tap-ms = <175>;
require-prior-idle-ms = <HM_PRIOR_IDLE>;
hold-trigger-key-positions = <KEYS_L KEYS_T>;
hold-trigger-on-release;
};
// Enables holding the first mod-tap key
// by performing a tap-release-hold sequence.
// To use it: "&qt KEYCODE1 KEYCODE2"
@ -84,7 +145,7 @@
label = "Base";
bindings = <
&kp DOT &kp COMMA &kp DOT &kp P &kp Y &kp F &kp G &kp C &kp R &kp L
&kp A &kp O &kp E &kp U &kp I &kp D &kp H &kp T &kp N &kp S
&hml LCTRL A &hml LALT O &hml LSHIFT E &hml LGUI U &kp I &kp D &hmr RGUI H &hmr RSHIFT T &hmr RALT N &hmr RCTRL S
&kp SCLN &kp Q &kp J &kp K &kp X &kp B &kp M &kp W &kp V &kp Z
&mt LALT SPC &mt LGUI TAB &mt LSHIFT RET &mt LCTRL BSPC
>;
@ -94,9 +155,9 @@
sym_layer {
label = "Sym.";
bindings = <
&kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0
&none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &kp N7 &kp N8 &kp N9 &none
&none &none &none &none &none &none &kp N4 &kp N5 &kp N6 &none
&none &none &none &none &none &kp N0 &kp N1 &kp N2 &kp N3 &none
&mo FNC &none &trans &trans
>;
};

View file

@ -6,6 +6,8 @@ manifest:
# kyek / duckyb
- name: duckyb
url-base: https://github.com/duckyb
- name: urob
url-base: https://github.com/urob
projects:
- name: zmk
remote: zmkfirmware
@ -14,5 +16,11 @@ manifest:
- name: urchin-zmk-module
remote: duckyb
revision: main
- name: zmk-helpers
remote: urob
revision: main
- name: zmk-auto-layer
remote: urob
revision: main
self:
path: config

View file

@ -33,7 +33,7 @@
shield = "urchin_%PART%";
zephyrDepsHash =
"sha256-9QwsEJAoMrTp4gHgCsSsrAiDC1JN3brLSINIxKJKq08=";
"sha256-DXOQ+Hu8p1qeLiB1loRmKG9YOVbkJWMOrDI/aVA472M=";
meta = {
description = "ZMK firmware";