This commit is contained in:
Chen Zeng
2024-09-06 21:50:01 +08:00
parent 22cf15c911
commit 68622dbe52
8 changed files with 69 additions and 33 deletions
+34 -4
View File
@@ -1,3 +1,5 @@
#define ZMK_MOUSE_DEFAULT_SCRL_VAL 35 // 10
#include <behaviors/mouse_keys.dtsi>
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/ext_power.h>
@@ -5,6 +7,18 @@
#include <dt-bindings/zmk/mouse.h>
#include <dt-bindings/zmk/rgb.h>
&msc {
acceleration-exponent = <0>; // 0
time-to-max-speed-ms = <0>; // 300
delay-ms = <0>; // 0
};
&mmv {
time-to-max-speed-ms = <400>;
acceleration-exponent = <1>;
};
/ {
macros {
flash_macro: flash_macro {
@@ -45,6 +59,20 @@
tapping-term-ms = <135>;
quick-tap-ms = <0>;
};
rgb_encoder: rgb_encoder {
compatible = "zmk,behavior-sensor-rotate";
label = "RGB_ENCODER";
#sensor-binding-cells = <0>;
bindings = <&rgb_ug RGB_BRI>, <&rgb_ug RGB_BRD>;
};
scroll_encoder: scroll_encoder {
compatible = "zmk,behavior-sensor-rotate";
#sensor-binding-cells = <0>;
bindings = <&msc SCRL_UP>, <&msc SCRL_DOWN>;
tap-ms = <30>;
};
};
keymap {
@@ -121,18 +149,20 @@
>;
label = "Rgb";
sensor-bindings = <&rgb_encoder &scroll_encoder>;
};
Mouse {
bindings = <
&trans &trans &trans &trans &trans &trans &kp UP_ARROW &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &kp DOWN &trans &trans &kp UP &trans &trans &trans
&trans &trans &trans &trans &trans &trans &kp LEFT &trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans
&trans &trans &trans &trans &trans &trans &kp RIGHT &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &mmv MOVE_UP &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &mmv MOVE_DOWN &trans &trans &mmv MOVE_UP &trans &trans &trans
&trans &trans &trans &trans &trans &trans &mmv MOVE_LEFT &trans &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_RIGHT &trans &trans
&trans &trans &trans &trans &trans &trans &mmv MOVE_RIGHT &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &mkp LCLK &mkp RCLK &to 0 &mkp LCLK &mkp RCLK &trans &trans &trans
>;
label = "Mouse";
sensor-bindings = <&scroll_encoder>;
};
};