Skip to content

Commit

Permalink
Added Urob's ZMK HRM's
Browse files Browse the repository at this point in the history
Added Urob's ZMK HRM's as per:
https://lemmy.world/post/206636
  • Loading branch information
Patches-weaver committed Dec 18, 2023
1 parent 205dcb8 commit 961b9bb
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 3 deletions.
107 changes: 107 additions & 0 deletions config/includes/behaviours_homerow_mods.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// Make sure settings.dtsi is included before this file

#include "../../zmk-nodefree-config/keypos_def/keypos_36keys.h"
#define KEYS_L LT0 LT1 LT2 LT3 LT4 LM0 LM1 LM2 LM3 LM4 LB0 LB1 LB2 LB3 LB4
#define KEYS_R RT0 RT1 RT2 RT3 RT4 RM0 RM1 RM2 RM3 RM4 RB0 RB1 RB2 RB3 RB4
#define KEYS_T LH2 LH1 LH0 RH0 RH1 RH2

#define HM_TAPPING_TERM 300
#define HM_TAPPING_TERM_FAST 200

/ {

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
hm_l: homerow_mods_left {
compatible = "zmk,behavior-hold-tap";
label = "HOMEROW_MODS_LEFT";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;

flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM>;
quick-tap-ms = <175>; // repeat on tap-into-hold
global-quick-tap-ms = <150>; // requires PR #1387
hold-trigger-key-positions = <KEYS_R KEYS_T>;
hold-trigger-on-release; // requires PR #1423
};

hm_r: homerow_mods_right {
compatible = "zmk,behavior-hold-tap";
label = "HOMEROW_MODS_RIGHT";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;

flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM>;
quick_tap_ms = <175>;
global-quick-tap-ms = <150>; // requires PR #1387
hold-trigger-key-positions = <KEYS_L KEYS_T>;
hold-trigger-on-release; // requires PR #1423
};


// Positional Homerow mods for shift
// Use faster tapping term and disable some features that may
// cause false negatives.
hm_shift_l: hm_shift_l {
compatible = "zmk,behavior-hold-tap";
label = "HOMEROW_MODS_FAST_LEFT";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;

flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM_FAST>;
quick_tap_ms = <175>;
// global-quick-tap-ms = <150>; // requires PR #1387
hold-trigger-key-positions = <KEYS_R KEYS_T>;
// hold-trigger-on-release; // requires PR #1423
};

hm_shift_r: hm_shift_r {
compatible = "zmk,behavior-hold-tap";
label = "HOMEROW_MODS_FAST_RIGHT";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;

flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM_FAST>;
quick_tap_ms = <175>;
// global-quick-tap-ms = <150>; // requires PR #1387
hold-trigger-key-positions = <KEYS_L KEYS_T>;
// hold-trigger-on-release; // requires PR #1423
};

/*
* Non-Positional Homerow Mods
* Used for &mm_grescm_gui behavior on left hand.
*
* Usage: &hm LSHFT T
* Tap: T
* Tap-Tap-Hold: Repeat T
* Hold: LSHIFT
*/
hm: homerow_mods {
compatible = "zmk,behavior-hold-tap";
label = "HOMEROW_MODS";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;

flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM>;
quick_tap_ms = <200>;
};

};
};
6 changes: 3 additions & 3 deletions config/west.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
- name: urob
url-base: https://github.com/urob
projects:
- name: zmk
remote: zmkfirmware
remote: urob
revision: main
import: app/west.yml
self:
Expand Down

0 comments on commit 961b9bb

Please sign in to comment.