-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlittle_wing.keymap
109 lines (97 loc) · 4.1 KB
/
little_wing.keymap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#include <behaviors.dtsi>
#include <input/processors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/mouse.h>
#include <dt-bindings/zmk/input_transform.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#define QWERTY 0
#define MOUSE 1
#define SCROLL 2
#ifndef MOVE_Y
#define MOVE_Y(n) (0)
#endif
#ifndef MOVE_X
#define MOVE_X(n) (0)
#endif
#define U_MOUSE_MOVE_MAX 1700
#define MM_U MOVE_Y(-U_MOUSE_MOVE_MAX)
#define MM_D MOVE_Y(U_MOUSE_MOVE_MAX)
#define MM_L MOVE_X(-U_MOUSE_MOVE_MAX)
#define MM_R MOVE_X(U_MOUSE_MOVE_MAX)
/ {
to_wheel: to_wheel {
compatible = "zmk,input-processor-code-mapper";
#input-processor-cells = <0>;
type = <INPUT_EV_REL>;
map = <INPUT_REL_X INPUT_REL_HWHEEL>
, <INPUT_REL_Y INPUT_REL_WHEEL>;
};
trackball_listener {
compatible = "zmk,input-listener";
device = <&trackball>;
input-processors = <&zip_xy_scaler 1 7>, <&zip_temp_layer MOUSE 1200>;
scroll {
layers = <SCROLL>;
input-processors = <&zip_xy_scaler 1 18>, <&to_wheel>, <&zip_scroll_transform (INPUT_TRANSFORM_Y_INVERT)>;
};
};
behaviors {
// keys to a fake mouse input device
mm: mouse_move {
compatible = "zmk,behavior-input-two-axis";
#binding-cells = <1>;
trigger-period-ms = <12>;
x-input-code = <INPUT_REL_X>;
y-input-code = <INPUT_REL_Y>;
time-to-max-speed-ms = <10>;
acceleration-exponent = <1>;
};
};
// mapping the fake keys to mouse device tack to the layers
mmv_input_listener {
compatible = "zmk,input-listener";
device = <&mm>;
input-processors = <&zip_xy_scaler 1 1>, <&zip_temp_layer MOUSE 1200>;
scroll {
inherit;
layers = <MOUSE>;
input-processors = <&zip_xy_scaler 1 7>, <&to_wheel>;
};
};
keymap {
compatible = "zmk,keymap";
qwerty_layer {
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 < SCROLL SEMI
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA < SCROLL DOT &kp FSLH
&kp BSPC &kp SPACE &kp ENTER
>;
};
mouse_layer {
bindings = <
&none &none &none &none &none &none &none &mm MM_U &none &none
&none &none &none &none &none &none &mkp LCLK &mm MM_D &mkp RCLK &mo SCROLL
&none &none &none &none &none &none &none &mkp MCLK &none &none
&none &none &none
>;
};
scroll_layer {
bindings = <
&none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &mkp LCLK &none &mkp RCLK &none
&none &none &none &none &none &none &none &mkp MCLK &none &none
&none &none &none
>;
};
empty_layer {
bindings = <
&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 &none
>;
};
};
};