Skip to content

Commit

Permalink
Matching mouse.dtsi to current Totem's settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ldebritto committed Feb 18, 2025
1 parent a978d2a commit 18256e8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 49 deletions.
68 changes: 20 additions & 48 deletions config/cradio.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
#include <behaviors/num_word.dtsi> // requires auto-layer module (https://github.com/urob/zmk-auto-layer)
#include "mouse.dtsi"
#include <dt-bindings/zmk/mouse.h>

// Layer defines

#define DEF 0
#define MOU 1
#define MDM 2
#define NUM 3
#define NAV 4
#define SYM 5
#define FUN 6
#define AOE 7 // AOE 2 layers with easier access for default shortcuts on main layer
#define AGS 8
#define ABS 9
#define NUM 1
#define NAV 2
#define SYM 3
#define FUN 4
#define MOU 5
#define AOE 6 // AOE 2 layers with easier access for default shortcuts on main layer
#define AGS 7
#define ABS 8

#include "mouse.dtsi" // Needts to be bellow the layer defines to work

#define HYPR LG(LS(LC(LALT))) // HYPR key
#define HP(k1) LG(LS(LC(LA(k1)))) // HYPR mod shorthand
Expand Down Expand Up @@ -310,25 +310,6 @@
<&macro_release &lc NAV>;
};

// Mouse dragging macros (see combos above)

initdrag: initiate_drag_for_mouse_click {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_press &mkp LCLK>,
<&macro_tap &tog MDM>;
};

enddrag: finish_drag_for_mouse_click {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_release &mkp LCLK>,
<&macro_tap &tog MDM>;
};


};

conditional_layers {
Expand All @@ -347,29 +328,11 @@
bindings = <
&ltl MOU Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&hrml LCTRL A &hrml LALT S &hrml LSHFT D &hrml LGUI F &hrml HYPR G &hrmr HYPR H &hrmr RGUI J &hrmr LSHFT K &hrmr RALT L &hrmr RCTRL SQT
&hrml GLOBE Z &kp X &kp C &ltl NUM V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SEMI
&hrml GLOBE Z &kp X &ltl MOU C &ltl NUM V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SEMI
&lc NAV &kp RSHFT &kp SPACE &lc SYM
>;
};

MOU {
bindings = <
&kp TAB &kp LC(UP) &kp LS(LC(TAB)) &kp LC(TAB) &kp LG(RBKT) &msc SCRL_DOWN &msc SCRL_RIGHT &mmv MOVE_UP &msc SCRL_LEFT &kp BSPC
&kp LCTRL &kp LALT &kp LSHFT &kp LGUI &kp LG(LBKT) &msc SCRL_UP &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_RIGHT &kp ENTER
&hrml GLOBE LG(Z) &kp LG(X) &kp LG(C) &kp LG(V) &kp F18 &playnp &mkp MCLK &vb_dn &vb_up &kp DEL
&mnav &kp SPACE &mkp LCLK &mkp RCLK
>;
};

MDM {
bindings = <
&kp TAB &kp LC(UP) &kp LS(LC(TAB)) &kp LC(TAB) &kp LG(RBKT) &msc SCRL_DOWN &msc SCRL_RIGHT &mmv MOVE_UP &msc SCRL_LEFT &kp BSPC
&kp LCTRL &kp LALT &kp LSHFT &kp LGUI &kp LG(LBKT) &msc SCRL_UP &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_RIGHT &kp ENTER
&hrml GLOBE LG(Z) &kp LG(X) &kp LG(C) &kp LG(V) &kp F18 &playnp &mkp MCLK &vb_dn &vb_up &kp DEL
&mnav &kp SPACE &mkp LCLK &mkp RCLK
>;
};

NUM { // keypad is almost mirrored to allow for use with and without a mouse
bindings = <
&trans &trans &trans &trans &trans &kp PLUS &kp N7 &kp N8 &kp N9 &kp ASTRK
Expand Down Expand Up @@ -406,6 +369,15 @@
>;
};

MOU {
bindings = <
&kp TAB &kp LC(UP) &kp LS(LC(TAB)) &kp LC(TAB) &kp LG(RBKT) &msc SCRL_DOWN &msc SCRL_RIGHT &mmv MOVE_UP &msc SCRL_LEFT &kp BSPC
&kp LCTRL &kp LALT &kp LSHFT &kp LGUI &kp LG(LBKT) &msc SCRL_UP &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_RIGHT &kp ENTER
&hrml GLOBE LG(Z) &kp LG(X) &kp LG(C) &kp LG(V) &kp F18 &playnp &mkp MCLK &vb_dn &vb_up &kp DEL
&mnav &kp SPACE &mkp LCLK &mkp RCLK
>;
};

AOE {
bindings = <
&kp Q &kp W &kp E &kp R &kp T &trans &trans &trans &trans &trans
Expand Down
16 changes: 15 additions & 1 deletion config/mouse.dtsi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was copied from urob's repo

// Settings tuned up for 3840 x 2160 display resolution
#define ZMK_POINTING_DEFAULT_MOVE_VAL 900 // 600
#define ZMK_POINTING_DEFAULT_MOVE_VAL 1500 // 600
#define ZMK_POINTING_DEFAULT_SCRL_VAL 20 // 10

#include <dt-bindings/zmk/pointing.h>
Expand All @@ -20,6 +20,20 @@
delay-ms = <0>; // 0
};

&mmv_input_listener {
precision {
layers = <NAV>;
input-processors = <&zip_xy_scaler 1 4>;
};
};

&msc_input_listener {
turbo {
layers = <NAV>;
input-processors = <&zip_scroll_scaler 3 1>;
};
};

// Add these lines to cradio.conf
// # Mouse config
// CONFIG_ZMK_MOUSE=y
Expand Down

0 comments on commit 18256e8

Please sign in to comment.