From b5d36d0d1f6a3006f7c5edcc3be54f6ab147e494 Mon Sep 17 00:00:00 2001 From: daniel2887 Date: Sun, 18 Aug 2024 13:07:51 -0700 Subject: [PATCH] HSV: customize keymap --- config/hillside_view.keymap | 465 +++++++++++++++++++++++++++++++----- 1 file changed, 411 insertions(+), 54 deletions(-) diff --git a/config/hillside_view.keymap b/config/hillside_view.keymap index aa29304..ff1f5c6 100644 --- a/config/hillside_view.keymap +++ b/config/hillside_view.keymap @@ -1,64 +1,421 @@ -#include "common_keymap.dtsi" +#include +#include +#include +//#include +#include +#include + +#include +#include + +#define DEFAULT 0 +#define GAME 1 +#define NAV 2 +#define SYMB 3 +#define NUM 4 +#define MEDIA 5 +#define ARROWS 6 +#define FN 7 +#define UNI_NAV 8 // navigation-like unicode characters (e.g., arrows) +#define UNI_MATH 9 // math related unicode characters (e.g., approximately equals) +#define G_NUM 10 // Numbers (1-5) accessible from the GAME layer +#define MOUSE 11 + + // Key numbers + // ----------------------------------------------------------------------------------------- + // | NONE | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | NONE | + // | NONE | 13 | 14 | 15 | 16 | 17 | | 18 | 19 | 20 | 21 | 22 | NONE | + // | NONE | 25 | 26 | 27 | 28 | 29 | | 30 | 31 | 32 | 33 | 34 | NONE | + // | 36 | | 37 | + // | 38 | 39 | 40 | 41 | | 42 | 43 | 44 | 45 | + +&caps_word { + continue-list = ; + timeout = <3>; + break-on-mod; /* stop caps_word when pressing a modifier */ +}; / { - keymap { - compatible = "zmk,keymap"; - - default_layer { - display-name = "DEFAULT"; - bindings = < - __________DEF_L1__________ __________DEF_R1__________ - __________DEF_L2__________ __________DEF_R2__________ - __________DEF_L3__________ __________DEF_R3__________ - &trans &trans - _________THUMB_DEF_L_______ _________THUMB_DEF_R_______ - >; - sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; - }; + /* assign `input-listener` to all pointing devices */ + /* &glidepoint0 on central, &glidepoint1 on peripheral */ + tpad_central_listener { + compatible = "zmk,input-behavior-listener"; + device = <&glidepoint0>; + y-invert; + scale-multiplier = <2>; + // xy-swap; + // x-invert; + }; - number_layer { - display-name = "NUMBER"; - bindings = < - __________NUM_L1__________ __________NUM_R1__________ - __________NUM_L2__________ __________NUM_R2__________ - __________NUM_L3__________ __________NUM_R3__________ - &trans &trans - _________THUMB_NUM_L_______ _________THUMB_NUM_R_______ - >; - }; + tpad_peripheral_listener { + compatible = "zmk,input-behavior-listener"; + device = <&glidepoint1>; + layers = ; + y-invert; + scale-multiplier = <2>; + /* NOTE: do NOT override event code here, */ + /* let Cirque glidepoint reports click from taps */ + // evt-type = ; + // x-input-code = ; + // y-input-code = ; + }; - symbol_layer { - display-name = "SYMBOL"; - bindings = < - __________SYM_L1__________ __________SYM_R1__________ - __________SYM_L2__________ __________SYM_R2__________ - __________SYM_L3__________ __________SYM_R3__________ - &trans &trans - _________THUMB_SYM_L_______ _________THUMB_SYM_R_______ - >; - }; + tpad_peripheral_scroll { + compatible = "zmk,input-behavior-listener"; + device = <&glidepoint1>; + layers = ; + /* NOTE: only apply input-code overriding for INPUT_EV_REL */ + evt-type = ; + x-input-code = ; + y-input-code = ; + bindings = <&ib_wheel_scaler 1 8>; + }; - navigation_layer { - display-name = "NAVIGATION"; - bindings = < - __________NAV_L1__________ __________NAV_R1__________ - __________NAV_L2__________ __________NAV_R2__________ - __________NAV_L3__________ __________NAV_R3__________ - &trans &trans - _________THUMB_NAV_L_______ _________THUMB_NAV_R_______ - >; - }; + ib_wheel_scaler: ib_wheel_scaler { + compatible = "zmk,input-behavior-scaler"; + #binding-cells = <2>; + evt-type = ; + input-code = ; + }; +}; + +/ { + conditional_layers { + compatible = "zmk,conditional-layers"; + tri_layer_numbers { + if-layers =