summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2023-05-13 14:21:46 -0400
committerKjetil Orbekk <kj@orbekk.com>2023-05-13 14:21:46 -0400
commit3be2880e4efc7fefe573b98a8c60a47e09023882 (patch)
tree75a4be9accc9bee4fe8958b3e189b587fa438f21
parentc2315412f2565ab58f8b5594beedbb18b4f260bf (diff)
add combos
-rw-r--r--config/base.keymap119
-rw-r--r--config/corneish_zen.keymap4
-rwxr-xr-xconfig/gen_positions.sh17
-rw-r--r--config/reviung41.conf3
-rw-r--r--config/reviung41.keymap8
5 files changed, 115 insertions, 36 deletions
diff --git a/config/base.keymap b/config/base.keymap
index 761536c..148d89d 100644
--- a/config/base.keymap
+++ b/config/base.keymap
@@ -5,6 +5,8 @@
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/mouse.h>
+#define COMBO_TIMEOUT_MS 40
+
#define DV 0
#define QW 1
#define GAMING 2
@@ -18,17 +20,33 @@
#define SPACEKEY &layer_mo NAV SPACE
-#define HM1(k) hm LGUI k
-#define HM2(k) hm LALT k
-#define HM3(k) hm LCTL k
-#define HM4(k) hm LSHFT k
+#define HL1(k) hm_left LGUI k
+#define HL2(k) hm_left LALT k
+#define HL3(k) hm_left LCTL k
+#define HL4(k) hm_left LSHFT k
+#define HR1(k) hm_right LGUI k
+#define HR2(k) hm_right LALT k
+#define HR3(k) hm_right LCTL k
+#define HR4(k) hm_right LSHFT k
#include "extra_keys.h"
/ {
behaviors {
- hm: homerow_modifiers {
- label = "hmod";
+ hm_left: homerow_modifiers_left {
+ label = "hm_left";
+ compatible = "zmk,behavior-hold-tap";
+ flavor = "balanced";
+ #binding-cells = <2>;
+ tapping-term-ms = <280>;
+ quick-tap-ms = <175>;
+ global-quick-tap-ms = <150>;
+ bindings = <&kp>, <&kp>;
+ hold-trigger-key-positions = <RIGHT_KEYS THUMBS>;
+ hold-trigger-on-release;
+ };
+ hm_right: homerow_modifiers_right {
+ label = "hmod_right";
compatible = "zmk,behavior-hold-tap";
flavor = "balanced";
#binding-cells = <2>;
@@ -36,6 +54,7 @@
quick-tap-ms = <175>;
global-quick-tap-ms = <150>;
bindings = <&kp>, <&kp>;
+ hold-trigger-key-positions = <LEFT_KEYS THUMBS>;
hold-trigger-on-release;
};
layer_mo: layer_modifiers {
@@ -49,33 +68,63 @@
bindings = <&mo>, <&kp>;
hold-trigger-on-release;
};
- /* hm_slow: homerow_mods_slow { */
- /* bincompatible = "zmk,behavior-hold-tap"; */
- /* label = "HMOD_S"; */
- /* #binding-cells = <2>; */
- /* tapping-term-ms = <250>; */
- /* quick-tap-ms = <0>; */
- /* flavor = "tap-preferred"; */
- /* bindings = <&kp>, <&kp>; */
- /* }; */
- /* hm_med: homerow_mods_medium { */
- /* compatible = "zmk,behavior-hold-tap"; */
- /* label = "HMOD_M"; */
- /* #binding-cells = <2>; */
- /* tapping-term-ms = <200>; */
- /* quick-tap-ms = <0>; */
- /* flavor = "tap-preferred"; */
- /* bindings = <&kp>, <&kp>; */
- /* }; */
- /* hm_fast: homerow_mods_fast { */
- /* compatible = "zmk,behavior-hold-tap"; */
- /* label = "HMOD_F"; */
- /* #binding-cells = <2>; */
- /* tapping-term-ms = <160>; */
- /* quick-tap-ms = <0>; */
- /* flavor = "tap-preferred"; */
- /* bindings = <&kp>, <&kp>; */
- /* }; */
+ };
+
+ combos {
+ compatible = "zmk,combos";
+ combo_q_c_x {
+ timeout-ms = <COMBO_TIMEOUT_MS>;
+ global-quick-tap-ms = <100>;
+ key-positions = <LM1 LM2>;
+ layers = <QW>;
+ bindings = <&hm_left LA(LCTRL) LC(B)>;
+ };
+
+ combo_q_c_c {
+ timeout-ms = <COMBO_TIMEOUT_MS>;
+ global-quick-tap-ms = <100>;
+ key-positions = <LM3 LM2>;
+ layers = <QW>;
+ bindings = <&hm_left LA(LCTRL) LC(I)>;
+ };
+
+ combo_d_c_x {
+ timeout-ms = <COMBO_TIMEOUT_MS>;
+ global-quick-tap-ms = <100>;
+ key-positions = <LM1 LM2>;
+ layers = <DV>;
+ bindings = <&hm_left LA(LCTRL) LC(X)>;
+ };
+
+ combo_d_c_c {
+ timeout-ms = <COMBO_TIMEOUT_MS>;
+ global-quick-tap-ms = <100>;
+ key-positions = <LM3 LM2>;
+ layers = <DV>;
+ bindings = <&hm_left LA(LCTRL) LC(C)>;
+ };
+
+ combo_tab {
+ timeout-ms = <COMBO_TIMEOUT_MS>;
+ global-quick-tap-ms = <100>;
+ key-positions = <LT3 LT2>;
+ layers = <DV QW LOW UPR QVLOW>;
+ bindings = <&kp TAB>;
+ };
+ combo_bspc {
+ timeout-ms = <COMBO_TIMEOUT_MS>;
+ global-quick-tap-ms = <100>;
+ key-positions = <RT1 RT2>;
+ layers = <DV QW LOW UPR QVLOW>;
+ bindings = <&kp BSPC>;
+ };
+ combo_del {
+ timeout-ms = <COMBO_TIMEOUT_MS>;
+ global-quick-tap-ms = <100>;
+ key-positions = <RT2 RT3>;
+ layers = <DV QW LOW UPR QVLOW>;
+ bindings = <&kp DEL>;
+ };
};
conditional_layers {
@@ -102,7 +151,7 @@
// DV - Dvorak layer
bindings = <
R1X &kp SQT &kp COMMA &kp DOT &kp P &kp Y &kp F &kp G &kp C &kp R &kp L R1Z
- R2X &HM1(A) &HM2(O) &HM3(E) &HM4(U) &kp I &kp D &HM4(H) &HM3(T) &HM2(N) &HM1(S) R2Z
+ R2X &HL1(A) &HL2(O) &HL3(E) &HL4(U) &kp I &kp D &HR4(H) &HR3(T) &HR2(N) &HR1(S) R2Z
R3X &kp SEMI &kp Q &kp J &kp K &kp X &kp B &kp M &kp W &kp V &kp Z R3Z
R4X &kp LSHIFT &mo LOW SPACEKEY TX &mo UPR &kp LSHIFT R4Z
>;
@@ -114,7 +163,7 @@
// (with setxkbmap us -variant dvorak -option compose:ralt).
bindings = <
R1X &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P R1Z
- R2X &HM1(A) &HM2(S) &HM3(D) &HM4(F) &kp G &kp H &HM4(J) &HM3(K) &HM2(L) &HM1(SEMI) R2Z
+ R2X &HL1(A) &HL2(S) &HL3(D) &HL4(F) &kp G &kp H &HR4(J) &HR3(K) &HR2(L) &HR1(SEMI) R2Z
R3X &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH R3Z
R4X &kp LSHIFT &mo LOW SPACEKEY TX &mo UPR &kp LSHIFT R4Z
>;
diff --git a/config/corneish_zen.keymap b/config/corneish_zen.keymap
index cac421f..2dea08f 100644
--- a/config/corneish_zen.keymap
+++ b/config/corneish_zen.keymap
@@ -7,6 +7,10 @@
};
};
+#include "keypos_defs/keypos_36keys.h"
#define FUNC_KEYS &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR &none &none &none &none
+#define LEFT_KEYS LT0 LT1 LT2 LT3 LT4 LM0 LM1 LM2 LM3 LM4 LB0 LB1 LB2 LB3 LB4
+#define RIGHT_KEYS RT0 RT1 RT2 RT3 RT4 RM0 RM1 RM2 RM3 RM4 RB0 RB1 RB2 RB3 RB4
+#define THUMBS LH0 LH1 LH2 RH0 RH1 RH2
#include "base.keymap"
diff --git a/config/gen_positions.sh b/config/gen_positions.sh
new file mode 100755
index 0000000..b83ca9d
--- /dev/null
+++ b/config/gen_positions.sh
@@ -0,0 +1,17 @@
+#!bash
+
+if [[ $# -ne 1 ]]; then
+ echo "Usage: $0 <keypos file>" 1>&2
+fi
+
+f="$1"
+
+echo -n "#define LEFT"
+grep "#define " $f | awk '$2 ~ /^L[^H]/ { printf(" %s", $2) }'
+echo
+echo -n "#define RIGHT"
+grep "#define " $f | awk '$2 ~ /^R[^H]/ { printf(" %s", $2) }'
+echo
+echo -n "#define THUMBS"
+grep "#define " $f | awk '$2 ~ /^.H/ { printf(" %s", $2) }'
+echo
diff --git a/config/reviung41.conf b/config/reviung41.conf
index 3f627f2..1882b96 100644
--- a/config/reviung41.conf
+++ b/config/reviung41.conf
@@ -12,3 +12,6 @@ CONFIG_ZMK_MOUSE=y
# CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=10
# CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=10
# CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=0
+
+# Turn on logging, and set ZMK logging to debug output
+# CONFIG_ZMK_USB_LOGGING=y \ No newline at end of file
diff --git a/config/reviung41.keymap b/config/reviung41.keymap
index e0596bb..18f5bed 100644
--- a/config/reviung41.keymap
+++ b/config/reviung41.keymap
@@ -7,7 +7,13 @@
#define R3Z &none
// No extra space key.
#define TX
-#define FUNC_KEYS &none &none &none &none &none &none &none &none &none &none
+
+#include "keypos_defs/keypos_42keys.h"
+#define LEFT_KEYS LT0 LT1 LT2 LT3 LT4 LT5 LM0 LM1 LM2 LM3 LM4 LM5 LB0 LB1 LB2 LB3 LB4 LB5
+#define RIGHT_KEYS RT0 RT1 RT2 RT3 RT4 RT5 RM0 RM1 RM2 RM3 RM4 RM5 RB0 RB1 RB2 RB3 RB4 RB5
+#define THUMBS LH0 LH1 LH2 RH0 RH1 RH2
+
+#define FUNC_KEYS &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR &none &none &none &none
#include "base.keymap"