|
| 1 | +#define ZMK_POINTING_DEFAULT_SCRL_VAL 150 |
| 2 | + |
1 | 3 | #include <behaviors.dtsi> |
2 | 4 | #include <dt-bindings/zmk/bt.h> |
3 | 5 | #include <dt-bindings/zmk/keys.h> |
4 | 6 | #include <dt-bindings/zmk/pointing.h> |
5 | | - |
6 | | -#define ZMK_POINTING_DEFAULT_SCRL_VAL 100 |
| 7 | +#include <dt-bindings/zmk/input_transform.h> |
| 8 | +#include <input/processors.dtsi> |
| 9 | +#include <zephyr/dt-bindings/input/input-event-codes.h> |
7 | 10 |
|
8 | 11 | &mt { |
9 | 12 | flavor = "balanced"; |
|
28 | 31 | // }; |
29 | 32 | }; |
30 | 33 |
|
| 34 | +&mmv { |
| 35 | + delay-ms = <20>; |
| 36 | + trigger-period-ms = <5>; |
| 37 | + time-to-max-speed-ms = <100>; |
| 38 | + acceleration-exponent = <2>; |
| 39 | +}; |
| 40 | + |
| 41 | +&msc { |
| 42 | + delay-ms = <3>; |
| 43 | + trigger-period-ms = <3>; |
| 44 | + time-to-max-speed-ms = <100>; |
| 45 | + acceleration-exponent = <0>; |
| 46 | +}; |
| 47 | + |
| 48 | +/ { |
| 49 | + input_processors { |
| 50 | + zip_wheel_scaler: zip_wheel_scaler { |
| 51 | + compatible = "zmk,input-processor-scaler"; |
| 52 | + #input-processor-cells = <2>; |
| 53 | + type = <INPUT_EV_REL>; |
| 54 | + codes = <INPUT_REL_WHEEL>; |
| 55 | + track-remainders; |
| 56 | + }; |
| 57 | + }; |
| 58 | +}; |
| 59 | + |
31 | 60 | / { |
32 | 61 | combos { |
33 | 62 | compatible = "zmk,combos"; |
|
77 | 106 | tapping-term-ms = <200>; |
78 | 107 | }; |
79 | 108 |
|
80 | | - scroll_encoder: scroll_encoder { |
81 | | - compatible = "zmk,behavior-sensor-rotate"; |
82 | | - #sensor-binding-cells = <0>; |
83 | | - bindings = <&msc SCRL_DOWN>, <&msc SCRL_UP>; |
| 109 | + sensor_rotate_kp: sensor_rotate_kp { |
| 110 | + compatible = "zmk,behavior-sensor-rotate-var"; |
| 111 | + #sensor-binding-cells = <2>; |
| 112 | + bindings = <&kp>, <&kp>; |
| 113 | + }; |
| 114 | + |
| 115 | + mouse_wheel_scroll: mouse_wheel_scroll { |
| 116 | + compatible = "zmk,behavior-sensor-rotate-var"; |
| 117 | + #sensor-binding-cells = <2>; |
| 118 | + bindings = <&msc>, <&msc>; |
84 | 119 | tap-ms = <20>; |
85 | 120 | }; |
86 | 121 | }; |
|
96 | 131 | &kp LCTRL &kp LEFT_WIN &kp LEFT_ALT <_to_layer_0 6 INT_HENKAN < 2 SPACE <_to_layer_0 3 INT_MUHENKAN &kp BACKSPACE < 1 ENTER &kp DEL |
97 | 132 | >; |
98 | 133 |
|
99 | | - sensor-bindings = <&scroll_encoder>; |
| 134 | + sensor-bindings = <&mouse_wheel_scroll SCRL_UP SCRL_DOWN>; |
100 | 135 | }; |
101 | 136 |
|
102 | 137 | FUNCTION { |
|
106 | 141 | &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp F11 |
107 | 142 | &trans &trans &trans &trans &trans &trans &trans &trans &kp F12 |
108 | 143 | >; |
| 144 | + |
| 145 | + sensor-bindings = <&sensor_rotate_kp C_VOLUME_DOWN C_VOLUME_UP>; |
109 | 146 | }; |
110 | 147 |
|
111 | 148 | NUM { |
|
124 | 161 | &kp LEFT_SHIFT &kp LG(LS(LEFT_ARROW)) &trans &kp LG(LS(RIGHT_ARROW)) &trans &trans &trans &trans &trans &trans &trans &trans |
125 | 162 | &trans &trans &trans &trans &trans &trans &trans &trans &trans |
126 | 163 | >; |
127 | | - |
128 | | - sensor-bindings = <&scroll_encoder>; |
129 | 164 | }; |
130 | 165 |
|
131 | 166 | MOUSE { |
|
0 commit comments