Skip to content

Commit

Permalink
Use urob mouse config
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbUk committed Feb 13, 2024
1 parent b1d8640 commit 78f492b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 10 deletions.
14 changes: 4 additions & 10 deletions config/m60.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/mouse.h>
#include "mouse.dtsi"

#define none &none
#define ____ &trans
Expand All @@ -20,12 +20,6 @@
#define _(KEY) &kp KEY
// Key tap macro
#define __(KEY, TAP) &mt KEY TAP
// Mouse Mouvement macro
#define MV(KEY) &mmv KEY
// Mouse Click macro
#define MC(KEY) &mkp KEY
// Mouse Scroll macro
#define MS(KEY) &msc KEY
// Layer macro
#define MO(LAYER) &mo LAYER

Expand Down Expand Up @@ -123,9 +117,9 @@ ____ ____ ____ ____
alt_layer {
bindings = <
none none none none none none none none none none _(C_ASPECT) _(C_BRI_DEC) _(C_BRI_INC) &sys_reset
none MC(LCLK) MV(MOVE_UP) MC(RCLK) none none none MC(LCLK) MV(MOVE_UP) MC(RCLK) none none none none
none none none none none none MS(SCROLL_UP) MV(MOVE_LEFT) MV(MOVE_DOWN) MV(MOVE_RIGHT) none none none
none none none none none &bootloader MS(SCROLL_DOWN) none none none none none
none U_BTN1 U_MS_U U_BTN2 none none none U_BTN1 U_MS_U U_BTN2 none none none none
none U_MS_L U_MS_D U_MS_R none none U_WH_U U_MS_L U_MS_D U_MS_R none none none
none none none none none &bootloader U_WH_D none none none none none
none none none none none none none none
>;
};
Expand Down
46 changes: 46 additions & 0 deletions config/mouse.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include <dt-bindings/zmk/mouse.h>

&mmv {
acceleration-exponent = <1>; // 1
time-to-max-speed-ms = <1500>; // 40
delay-ms = <0>; // 0
};

&msc {
acceleration-exponent = <1>; // 0
time-to-max-speed-ms = <5000>; // 40
delay-ms = <0>; // 10
};

#define U_MOUSE_MOVE_MAX 1250 // 600
#define U_MOUSE_SCROLL_MAX 100 // 10

#undef MOVE_UP
#undef MOVE_DOWN
#undef MOVE_LEFT
#undef MOVE_RIGHT
#define MOVE_UP MOVE_Y(-U_MOUSE_MOVE_MAX)
#define MOVE_DOWN MOVE_Y(U_MOUSE_MOVE_MAX)
#define MOVE_LEFT MOVE_X(-U_MOUSE_MOVE_MAX)
#define MOVE_RIGHT MOVE_X(U_MOUSE_MOVE_MAX)

#undef SCROLL_UP
#undef SCROLL_DOWN
#undef SCROLL_LEFT
#undef SCROLL_RIGHT
#define SCROLL_UP SCRL_Y(U_MOUSE_SCROLL_MAX)
#define SCROLL_DOWN SCRL_Y(-U_MOUSE_SCROLL_MAX)
#define SCROLL_LEFT SCRL_X(-U_MOUSE_SCROLL_MAX)
#define SCROLL_RIGHT SCRL_X(U_MOUSE_SCROLL_MAX)

#define U_BTN1 &mkp MB1
#define U_BTN2 &mkp MB2
#define U_BTN3 &mkp MB3
#define U_MS_U &mmv MOVE_UP
#define U_MS_D &mmv MOVE_DOWN
#define U_MS_L &mmv MOVE_LEFT
#define U_MS_R &mmv MOVE_RIGHT
#define U_WH_U &msc SCROLL_UP
#define U_WH_D &msc SCROLL_DOWN
#define U_WH_L &msc SCROLL_LEFT
#define U_WH_R &msc SCROLL_RIGHT

0 comments on commit 78f492b

Please sign in to comment.