Skip to content

Commit

Permalink
Just trying to get it to build
Browse files Browse the repository at this point in the history
- Strip down most layers and features
- Combined the mouse stuff with general
- Focusing on one hold tap for now to see
where I have to place defines
  • Loading branch information
t4corun committed Aug 18, 2023
1 parent d25e1eb commit cc83655
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 96 deletions.
36 changes: 29 additions & 7 deletions config/user/general.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,37 @@
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/mouse.h>

// Layer Definitions out toggle
#define QWERTY 0
#define COLEMAK 1
#define NUMBER 2
#define NAVI 3
#define SYMBOL 4
#define MOUSE 5
#define CONFIG 6
//#define COLEMAK 1
#define NUMBER 1
#define NAVI 2
#define SYMBOL 3
#define MOUSE 4
#define CONFIG 5

//Feature Configuration
#define TAPPING_TERM 200
#define QUICK_TAP_TERM 125
#define STICKYKEY_TIMEOUT 3000

#define U_MOUSE_MOVE_DELAY 0
#define U_MOUSE_MOVE_EXPONENT 1
#define U_MOUSE_MOVE_TIME 750

#define U_MOUSE_SCROLL_DELAY 0
#define U_MOUSE_SCROLL_EXPONENT 1
#define U_MOUSE_SCROLL_TIME 0

//new stuff
#define MOU(keycode) &lt MOUSE keycode
#define NAV(keycode) &lt NAVI keycode

//To Layer
#define DEFAULT &to QWERTY
#define CLMAKDH &to COLEMAK
//#define CLMAKDH &to COLEMAK

//Shortcuts
#define W_UNDO &kp LC(Z)
Expand Down Expand Up @@ -55,4 +64,17 @@

&caps_word {
continue-list = <UNDER MINUS BSPC DEL>;
};

&mmv {
delay-ms = <U_MOUSE_MOVE_DELAY>;
acceleration-exponent = <U_MOUSE_MOVE_EXPONENT>;
time-to-max-speed-ms = <U_MOUSE_MOVE_TIME>;
};


&mwh {
delay-ms = <U_MOUSE_SCROLL_DELAY>;
acceleration-exponent = <U_MOUSE_SCROLL_EXPONENT>;
time-to-max-speed-ms = <U_MOUSE_SCROLL_TIME>;
};
21 changes: 7 additions & 14 deletions config/user/holdtap.dtsi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*#define HOLD_TAP(NAME, FLAVOR, TAP, HOLD) \
#define HOLD_TAP(NAME, FLAVOR, TAP, HOLD) \
NAME: hold_tap_##NAME { \
compatible = "zmk,behavior-hold-tap"; \
label = ZMK_MACRO_STRINGIFY(NAME); \
Expand All @@ -8,21 +8,13 @@
#binding-cells = <2>; \
bindings = <HOLD>, <TAP>; \
};
*/

Bleh: hold_tap_Bleh {
compatible = "zmk,behavior-hold-tap";
label = "Bleh";
flavor = "tap-preferred";
tapping-term-ms = <200>;
quick-tap-ms = <125>;
#binding-cells = <2>;
bindings = <&kp LPAR &kp RPAR &kp LEFT>, <&kp>;
};


/*

HOLD_TAP(ht, tap_preferred, TAPPING_TERM, QUICK_TAP_TERM, &kp, &kp)

/*
HOLD_TAP(dt, tap_preferred, TAPPING_TERM, QUICK_TAP_TERM, &kp, &kp &kp)
HOLD_TAP(dtl, tap_preferred, TAPPING_TERM, QUICK_TAP_TERM, &kp, &kp &kp &kp LEFT)
HOLD_TAP(dts, tap_preferred, TAPPING_TERM, QUICK_TAP_TERM, &kp, &kp SPACE &kp &kp &kp SPACE)
Expand All @@ -46,9 +38,11 @@ HOLD_TAP(lrbkt, tap_preferred, &kp, &kp LBKT &kp RBKT &kp LEFT)
HOLD_TAP(lrpar, tap_preferred, &kp, &kp LPAR &kp RPAR &kp LEFT)
HOLD_TAP(ltgt, tap_preferred, &kp, &kp LT &kp RT &kp LEFT)
HOLD_TAP(ne, tap_preferred, &kp, &kp SPACE &kp EXCL &kp EQUAL &kp SPACE)

*/

#define HT(holdkey, tapkey) &ht holdkey, tapkey

/*
#define DT(keycode) &dt keycode, keycode
#define DTL(keycode) &dtl keycode, keycode
#define DTS(keycode) &dts keycode, keycode
Expand All @@ -62,4 +56,3 @@ HOLD_TAP(ne, tap_preferred, &kp, &kp SPACE &kp EXCL &kp EQUAL &kp SPACE)

*/

#define NE(keycode) &bleh &none, keycode
48 changes: 14 additions & 34 deletions config/user/mouse.dtsi
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#include <dt-bindings/zmk/mouse.h>
inc_dec_mwh: behavior_sensor_rotate_mouse_wheel {
compatible = "zmk,behavior-sensor-rotate-var";
label = "ENC_MOUSE_WHEEL";
#sensor-binding-cells = <2>;
bindings = <&mwh>, <&mwh>;
};

//Inspired by miroyku
/*
inc_dec_mmv: behavior_sensor_rotate_mouse_movement {
compatible = "zmk,behavior-sensor-rotate-var";
label = "ENC_MOUSE_MOVEMENT";
#sensor-binding-cells = <2>;
bindings = <&mmv>, <&mmv>;
};
*/

#define U_MOUSE_MOVE_MAX 3000
#define U_MOUSE_MOVE_DELAY 0
#define U_MOUSE_MOVE_EXPONENT 1
#define U_MOUSE_MOVE_TIME 750

#define U_MOUSE_SCROLL_MAX 100
#define U_MOUSE_SCROLL_DELAY 0
#define U_MOUSE_SCROLL_EXPONENT 1
#define U_MOUSE_SCROLL_TIME 0

#undef MOVE_UP
#undef MOVE_DOWN
Expand Down Expand Up @@ -42,28 +47,3 @@
#define MWH_L &mwh SCROLL_LEFT
#define MWH_R &mwh SCROLL_RIGHT

inc_dec_mwh: behavior_sensor_rotate_mouse_wheel {
compatible = "zmk,behavior-sensor-rotate-var";
label = "ENC_MOUSE_WHEEL";
#sensor-binding-cells = <2>;
bindings = <&mwh>, <&mwh>;
};

inc_dec_mmv: behavior_sensor_rotate_mouse_movement {
compatible = "zmk,behavior-sensor-rotate-var";
label = "ENC_MOUSE_MOVEMENT";
#sensor-binding-cells = <2>;
bindings = <&mmv>, <&mmv>;
};

&mmv {
delay-ms = <U_MOUSE_MOVE_DELAY>;
acceleration-exponent = <U_MOUSE_MOVE_EXPONENT>;
time-to-max-speed-ms = <U_MOUSE_MOVE_TIME>;
};

&mwh {
delay-ms = <U_MOUSE_SCROLL_DELAY>;
acceleration-exponent = <U_MOUSE_SCROLL_EXPONENT>;
time-to-max-speed-ms = <U_MOUSE_SCROLL_TIME>;
};
52 changes: 11 additions & 41 deletions config/user/t4corun.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/ {
#include "combos.dtsi"
#include "tapdance.dtsi"
//#include "tapdance.dtsi"
#include "holdtap.dtsi"
#include "mouse.dtsi"

Expand Down Expand Up @@ -38,44 +38,14 @@

bindings = <
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L DTL(SQT)
MOU(Z) &kp X &kp C &kp V &kp B &kp N &kp M HT(LPAR, COMMA) HT(RPAR,DOT) HT(UNDER, MINUS)
&kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SQT
MOU(Z) &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT HT(UNDER, MINUS)
&none &mo NUMBER &shftcaps &kp SPACE NAV(0) &kp C_MUTE
>;

sensor-bindings = <&inc_dec_mwh SCROLL_RIGHT SCROLL_LEFT &inc_dec_mwh SCROLL_UP SCROLL_DOWN>;
};

/*
*
* ,----------------------------------. ,----------------------------------.
* | Q | W | F | P | B | | J | L | U | Y | ' |
* +------+------+------+------+------| +------+------+------+------+------+
* | A | R | S | T | G | | M | N | E | I | O |
* +------+------+------+------+------| +------+------+------+------+------+
* | MOUZ | X | C | D | V | | K | H | , | . | - |
* `------+------+------+------+------+ +------+------+------+------+------'
* | | NUM | Lsft | | Spc | NAV | |
* `------+------+------' `------+------+------'
*
* Encoder Left: Scroll Left <-> Scroll Right
* Encoder Right: Scroll Down <-> Scroll Up
*/

colemakdh_layer {

label = "ColmakDH";

bindings = <
&kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y DTL(SQT)
&kp A &kp R &kp S &kp T &kp G &kp M &kp N &kp E &kp I &kp O
MOU(Z) &kp X &kp C &kp D &kp V &kp K &kp H HT(LPAR, COMMA) HT(RPAR,DOT) HT(UNDER, MINUS)
&none &mo NUMBER &shftcaps &kp SPACE NAV(0) &kp C_MUTE
>;

sensor-bindings = <&inc_dec_mwh SCROLL_RIGHT SCROLL_LEFT &inc_dec_mwh SCROLL_UP SCROLL_DOWN>;
};

/*
*
* ,----------------------------------. ,----------------------------------.
Expand All @@ -97,9 +67,9 @@
label = "Numbers";

bindings = <
&kp ESC W_SNIP W_FILE &none TRI(GRAVE) DTS(EQUAL) &kp N7 &kp N8 &kp N9 &kp TAB
&sk LGUI &sk LALT &sk LCTRL &sk LSHFT HT(COLON, SEMI) &kp BSPC &kp N4 &kp N5 &kp N6 &kp DOT
W_UNDO W_CUT W_COPY W_PASTE W_REDO &none &kp N1 &kp N2 &kp N3 HT(UNDER, MINUS)
&kp ESC W_SNIP W_FILE &none &none &none &kp N7 &kp N8 &kp N9 &kp TAB
&sk LGUI &sk LALT &sk LCTRL &sk LSHFT &none &kp BSPC &kp N4 &kp N5 &kp N6 &kp DOT
W_UNDO W_CUT W_COPY W_PASTE W_REDO &none &kp N1 &kp N2 &kp N3 &none
&none &trans &none &kp SPACE &trans &kp C_MUTE
>;

Expand Down Expand Up @@ -161,10 +131,10 @@
label = "Symbol";

bindings = <
&kp PRCNT &kp CARET &kp DLLR &kp PLUS TRI(GRAVE) DTS(EQUAL) DT(HASH) &kp STAR DTS(PIPE) DT(DQT)
DTS(AMPS) LRBRC(LBRC) &kp RBRC &kp AT HT(COLON, SEMI) &kp BSPC &kp QMARK LRBKT(LBKT) &kp RBKT DT(SQT)
&none LGT(LT) &kp GT DT(BSLH) NE(EXCL) DT(MINUS) DT(FSLH) LRPAR(LPAR) &kp RPAR HT(UNDER, MINUS)
&none &trans &none &none &trans &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 &none &none &none &none &none
&none &trans &none &none &trans &none
>;

sensor-bindings = <&inc_dec_kp &none &none &inc_dec_kp &none &none>;
Expand Down Expand Up @@ -220,7 +190,7 @@
label = "Config";

bindings = <
&kp SLCK &kp F7 &kp F8 &kp F9 &kp F10 DEFAULT CLMAKDH BTClear &out OUT_TOG &trans
&kp SLCK &kp F7 &kp F8 &kp F9 &kp F10 DEFAULT &none BTClear &out OUT_TOG &trans
&kp PSCRN &kp F4 &kp F5 &kp F6 &kp F11 &kp CAPS &kp RSHFT &kp RCTRL &kp RALT &kp RGUI
&kp PAUSE_BREAK &kp F1 &kp F2 &kp F3 &kp F12 BT0 BT1 BT2 BT3 &trans
&none &bootloader &reset &reset &bootloader &none
Expand Down

0 comments on commit cc83655

Please sign in to comment.