summaryrefslogtreecommitdiff
path: root/config/includes
diff options
context:
space:
mode:
Diffstat (limited to 'config/includes')
-rw-r--r--config/includes/combos.dtsi.old183
-rw-r--r--config/includes/common.h67
-rw-r--r--config/includes/homerow.h22
-rw-r--r--config/includes/keypos_42keys.h62
-rw-r--r--config/includes/mouse_tp.dtsi4
-rw-r--r--config/includes/unicode.h85
6 files changed, 238 insertions, 185 deletions
diff --git a/config/includes/combos.dtsi.old b/config/includes/combos.dtsi.old
deleted file mode 100644
index f24cffb..0000000
--- a/config/includes/combos.dtsi.old
+++ /dev/null
@@ -1,183 +0,0 @@
-#define COMBO_TERM_FAST 35
-#define COMBO_TERM_SLOW 40
-#define COMBO_PRIOR_IDLE 100
-
-/ {
- combos {
- compatible = "zmk,combos";
-
- combo_bracket_v_round_l {
- timeout-ms = <COMBO_TERM_FAST>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LT1 LM1>;
- layers = <BASE BASE_QWERTY SYM NUM NUM_WORD>;
- bindings = <&kp LPAR>;
- };
-
- combo_bracket_v_round_r {
- timeout-ms = <COMBO_TERM_FAST>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <RT1 RM1>;
- layers = <BASE BASE_QWERTY SYM NUM NUM_WORD>;
- bindings = <&kp RPAR>;
- };
-
- combo_bracket_v_square_l {
- timeout-ms = <COMBO_TERM_SLOW>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LT2 LM2>;
- layers = <BASE BASE_QWERTY SYM NUM NUM_WORD>;
- bindings = <&kp LBKT>;
- };
-
- combo_bracket_v_square_r {
- timeout-ms = <COMBO_TERM_SLOW>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <RT2 RM2>;
- layers = <BASE BASE_QWERTY SYM NUM NUM_WORD>;
- bindings = <&kp RBKT>;
- };
-
- combo_bracket_v_curly_l {
- timeout-ms = <COMBO_TERM_SLOW>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LT3 LM3>;
- layers = <BASE BASE_QWERTY SYM NUM NUM_WORD>;
- bindings = <&kp LBRC>;
- };
-
- combo_bracket_v_curly_r {
- timeout-ms = <COMBO_TERM_SLOW>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <RT3 RM3>;
- layers = <BASE BASE_QWERTY SYM NUM NUM_WORD>;
- bindings = <&kp RBRC>;
- };
-
- combo_bracket_v_angled_l {
- timeout-ms = <COMBO_TERM_SLOW>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LM1 LB1>;
- layers = <BASE BASE_QWERTY SYM NUM NUM_WORD>;
- bindings = <&kp LT>;
- };
-
- combo_bracket_v_angled_r {
- timeout-ms = <COMBO_TERM_SLOW>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <RM1 RB1>;
- layers = <BASE BASE_QWERTY SYM NUM NUM_WORD>;
- bindings = <&kp GT>;
- };
-
- combo_capsword {
- timeout-ms = <COMBO_TERM_SLOW>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LM1 RM1>;
- layers = <BASE BASE_QWERTY>;
-
-#ifdef HAS_CAPSLOCK
- bindings = <&caps_word_capslock >;
-#else
- bindings = <&caps_word>;
-#endif
- };
-
- combo_return {
- timeout-ms = <COMBO_TERM_FAST>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LH2 LH1 LH0>;
- layers = <BASE BASE_QWERTY NAV NUM SYM>;
- bindings = <&kp RET>;
- };
-
- combo_bspc {
- timeout-ms = <COMBO_TERM_FAST>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LH1 LH0>;
- layers = <BASE BASE_QWERTY NAV NUM SYM>;
- bindings = <&kp BSPC>;
- };
-
- // combo_grave {
- // timeout-ms = <COMBO_TERM_SLOW>;
- // require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- // key-positions = <RM3 RM4>;
- // layers = <>;
- // bindings = <&kp GRAVE>;
- // };
-
- // combo_md_code_block {
- // timeout-ms = <COMBO_TERM_SLOW>;
- // require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- // key-positions = <RM2 RM3 RM4>;
- // layers = <>;
- // bindings = <&m_type_md_code_block>;
- // };
-
- combo_tog_nav_word {
- timeout-ms = <COMBO_TERM_SLOW>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LM3 LM2 LM1>;
- layers = <BASE BASE_QWERTY NUM NUM_WORD>;
-
- #ifdef HAS_UROB
- bindings = <&nav_word>;
- #else
- bindings = <&tog NAV_WORD>;
- #endif
-
- };
-
- combo_tog_num_word {
- timeout-ms = <COMBO_TERM_SLOW>;
- require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LB3 LB2 LB1>;
- layers = <BASE BASE_QWERTY NAV NAV_WORD>;
-
- #ifdef HAS_UROB
- bindings = <&num_word>;
- #else
- bindings = <&tog NUM_WORD>;
- #endif
-
- };
-
-#ifdef HAS_MOUSE_TP
- combo_tog_mouse_settings_l {
- timeout-ms = <COMBO_TERM_SLOW>;
- // require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LT2 LT3 LT4>;
- layers = <BASE BASE_QWERTY NAV NAV_WORD MOUSE_KEYS>;
- bindings = <&tog MOUSE_SET>;
- };
-
- combo_tog_mouse_settings_r {
- timeout-ms = <COMBO_TERM_SLOW>;
- // require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <RT2 RT3 RT4>;
- layers = <BASE BASE_QWERTY NAV NAV_WORD MOUSE_KEYS>;
- bindings = <&tog MOUSE_SET>;
- };
-#endif
-
-#ifdef HAS_MOUSE_KEYS
- combo_tog_mouse_keys_l {
- timeout-ms = <COMBO_TERM_SLOW>;
- // require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <LM2 LM3 LM4>;
- layers = <BASE BASE_QWERTY NAV NAV_WORD MOUSE_KEYS>;
- bindings = <&tog MOUSE_KEYS>;
- };
-
- combo_tog_mouse_keys_r {
- timeout-ms = <COMBO_TERM_SLOW>;
- // require-prior-idle-ms = <COMBO_PRIOR_IDLE>;
- key-positions = <RM2 RM3 RM4>;
- layers = <BASE BASE_QWERTY NAV NAV_WORD MOUSE_KEYS>;
- bindings = <&tog MOUSE_KEYS>;
- };
-#endif
-
- };
-};
diff --git a/config/includes/common.h b/config/includes/common.h
new file mode 100644
index 0000000..79528c8
--- /dev/null
+++ b/config/includes/common.h
@@ -0,0 +1,67 @@
+#define ___ &trans
+#define XXX &none
+
+#ifndef QUICK_TAP_MS
+ #define QUICK_TAP_MS 162
+#endif
+
+#define ZMK_HELPER_STRINGIFY(x) #x
+
+#define MO_TOG(layer) &mo_tog layer layer // Macro to apply momentary-layer-on-hold/toggle-layer-on-tap to a specific layer
+
+&sk { // sticky-key config
+ release-after-ms = <900>; // release after 0.6s
+ quick-release; // no double capitalization when rolling keys
+};
+
+&sl { // sticky-layer config
+ ignore-modifiers; // allow chording sticky mods & layers
+};
+
+&lt { // layer-tap config
+ flavor = "balanced";
+ tapping-term-ms = <200>;
+ quick-tap-ms = <QUICK_TAP_MS>;
+};
+
+
+// Some general behaviours that are slightly tweaked from the core
+/ {
+ behaviours {
+ kp_mo_tap: behavior_kp_mo_tap {
+ compatible = "zmk,behavior-hold-tap";
+ label = "kp_mo_tap";
+ #binding-cells = <2>;
+ flavor = "tap-preferred";
+ tapping-term-ms = <200>;
+ quick-tap-ms = <200>;
+ //require-prior-idle-ms = <140>;
+ bindings = <&mo>, <&kp>;
+ };
+ kp_mo_hold: behavior_kp_mo_hold {
+ compatible = "zmk,behavior-hold-tap";
+ label = "kp_mo_hold";
+ #binding-cells = <2>;
+ flavor = "hold-preferred";
+ tapping-term-ms = <200>;
+ quick-tap-ms = <200>;
+ //require-prior-idle-ms = <140>;
+ bindings = <&mo>, <&kp>;
+ };
+ kp_mt: behavior_kp_mt {
+ compatible = "zmk,behavior-hold-tap";
+ label = "kp_mt";
+ #binding-cells = <2>;
+ flavor = "tap-preferred";
+ tapping-term-ms = <QUICK_TAP_MS>;
+ quick-tap-ms = <QUICK_TAP_MS>;
+ //require-prior-idle-ms = <100>;
+ bindings = <&kp>, <&kp>;
+ };
+ };
+};
+
+
+#include "homerow.h"
+#include "unicode.h"
+
diff --git a/config/includes/homerow.h b/config/includes/homerow.h
new file mode 100644
index 0000000..c8fe06f
--- /dev/null
+++ b/config/includes/homerow.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#define MAKE_HRM(NAME, HOLD, TAP) \
+ / { \
+ behaviours { \
+ NAME: NAME { \
+ label = ZMK_HELPER_STRINGIFY(ZB_ ## NAME); \
+ compatible = "zmk,behavior-hold-tap"; \
+ #binding-cells = <2>; \
+ flavor = "balanced"; \
+ tapping-term-ms = <280>; \
+ quick-tap-ms = <QUICK_TAP_MS>; \
+ require-prior-idle-ms = <150>; \
+ bindings = <HOLD>, <TAP>; \
+ hold-trigger-on-release; \
+ }; \
+ }; \
+ };
+
+MAKE_HRM(hml, &kp, &kp)
+MAKE_HRM(hmr, &kp, &kp)
+
diff --git a/config/includes/keypos_42keys.h b/config/includes/keypos_42keys.h
new file mode 100644
index 0000000..21f7052
--- /dev/null
+++ b/config/includes/keypos_42keys.h
@@ -0,0 +1,62 @@
+// https://raw.githubusercontent.com/urob/zmk-nodefree-config/8506dbaaee9b46d200aa553a94b6dbca8560a5e1/keypos_def/keypos_42keys.h
+/* 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
+
diff --git a/config/includes/mouse_tp.dtsi b/config/includes/mouse_tp.dtsi
index 6345cf4..358a5f6 100644
--- a/config/includes/mouse_tp.dtsi
+++ b/config/includes/mouse_tp.dtsi
@@ -94,7 +94,7 @@
// How sensitive the TP is (Default: 128)
- tp-sensitivity = <135>;
+ tp-sensitivity = <205>;
// The maximum mouse movement speed the TP will accelarate to (Default: 97)
@@ -135,7 +135,7 @@
// How long to wait, after the last mouse movement, before deactivating
// the layer (Default: 250)
- layer-toggle-timeout-ms = <1000>;
+ layer-toggle-timeout-ms = <425>;
};
diff --git a/config/includes/unicode.h b/config/includes/unicode.h
new file mode 100644
index 0000000..df2b298
--- /dev/null
+++ b/config/includes/unicode.h
@@ -0,0 +1,85 @@
+#pragma once
+
+#define COMBO(name, POS, LAYERS, BINDINGS) \
+ / { \
+ combos { \
+ compatible = "zmk,combos"; \
+ name { \
+ timeout-ms = <50>; \
+ key-positions = <POS>; \
+ layers = <LAYERS>; \
+ bindings = <BINDINGS>; \
+ }; \
+ }; \
+ };
+
+/* ZMK_UNICODE */
+#define UC_LEAD_MACWIN &macro_press &kp LALT // macOS/Windows-Alt-Codes
+#define UC_LEAD_LINUX &macro_tap &kp LS(LC(U)) // Linux
+#define UC_LEAD_WINDOWS &macro_tap &kp RALT &kp U // Windows + WinCompose (default)
+
+#define UC_TRAIL_MACWIN &macro_release &kp LALT // macOS/Windows-Alt-Codes
+#define UC_TRAIL_LINUX &macro_tap &kp SPACE // Linux
+#define UC_TRAIL_WINDOWS &macro_tap &kp RET // Windows + WinCompose (default)
+
+#define UC_MACRO_LINUX(name, unicode_bindings) \
+ / { \
+ macros { \
+ name: name { \
+ compatible = "zmk,behavior-macro"; \
+ label = ZMK_HELPER_STRINGIFY(UC_MACRO_ ## name); \
+ wait-ms = <0>; \
+ tap-ms = <0>; \
+ #binding-cells = <0>; \
+ bindings = <UC_LEAD_LINUX>, <&macro_tap unicode_bindings>, <UC_TRAIL_LINUX>; \
+ }; \
+ }; \
+ };
+#define UC_MACRO_MACWIN(name, unicode_bindings) \
+ / { \
+ macros { \
+ name: name { \
+ compatible = "zmk,behavior-macro"; \
+ label = ZMK_HELPER_STRINGIFY(UC_MACRO_ ## name); \
+ wait-ms = <0>; \
+ tap-ms = <0>; \
+ #binding-cells = <0>; \
+ bindings = <UC_LEAD_MACWIN>, <&macro_tap unicode_bindings>, <UC_TRAIL_MACWIN>; \
+ }; \
+ }; \
+ };
+
+#define UC_MODMORPH(name, uc_binding, shifted_uc_binding) \
+ / { \
+ behaviors { \
+ name: name { \
+ compatible = "zmk,behavior-mod-morph"; \
+ label = ZMK_HELPER_STRINGIFY(UC_MORPH_ ## name); \
+ #binding-cells = <0>; \
+ bindings = <uc_binding>, <shifted_uc_binding>; \
+ mods = <(MOD_LSFT|MOD_RSFT)>; \
+ }; \
+ }; \
+ };
+
+#define ZMK_UNICODE_SINGLE(name, L0, L1, L2, L3) \
+ UC_MACRO(name ## _lower, &kp L0 &kp L1 &kp L2 &kp L3) \
+ UC_MODMORPH(name, &name ## _lower, &none)
+
+#define ZMK_UNICODE_PAIR_LINUX(name, L0, L1, L2, L3, U0, U1, U2, U3) \
+ UC_MACRO_LINUX(name ## _lower, &kp L0 &kp L1 &kp L2 &kp L3) \
+ UC_MACRO_LINUX(name ## _upper, &kp U0 &kp U1 &kp U2 &kp U3) \
+ UC_MODMORPH(name, &name ## _lower, &name ## _upper)
+
+#define ZMK_UNICODE_PAIR_MACWIN(name, L0, L1, L2, L3, U0, U1, U2, U3) \
+ UC_MACRO_MACWIN(name ## _lower, &kp L0 &kp L1 &kp L2 &kp L3) \
+ UC_MACRO_MACWIN(name ## _upper, &kp U0 &kp U1 &kp U2 &kp U3) \
+ UC_MODMORPH(name, &name ## _lower, &name ## _upper)
+
+ZMK_UNICODE_PAIR_MACWIN(mwn_no_ae, N0, N0, E, N6, N0, N0, C, N6)
+ZMK_UNICODE_PAIR_MACWIN(mwn_no_ao, N0, N0, E, N5, N0, N0, C, N5)
+ZMK_UNICODE_PAIR_MACWIN(mwn_no_oe, N0, N0, F, N8, N0, N0, D, N8)
+ZMK_UNICODE_PAIR_LINUX(lnx_no_ae, N0, N0, E, N6, N0, N0, C, N6)
+ZMK_UNICODE_PAIR_LINUX(lnx_no_ao, N0, N0, E, N5, N0, N0, C, N5)
+ZMK_UNICODE_PAIR_LINUX(lnx_no_oe, N0, N0, F, N8, N0, N0, D, N8)
+