@@ -67,16 +67,11 @@ uint8_t mk_time_to_max = MOUSEKEY_TIME_TO_MAX;
67
67
/* milliseconds between the initial key press and first repeated motion event (0-2550) */
68
68
uint8_t mk_wheel_delay = MOUSEKEY_WHEEL_DELAY / 10 ;
69
69
/* milliseconds between repeated motion events (0-255) */
70
- # ifndef MK_KINETIC_SPEED
71
- uint8_t mk_wheel_interval = MOUSEKEY_WHEEL_INTERVAL ;
72
- # else /* #ifndef MK_KINETIC_SPEED */
73
- float mk_wheel_interval = 1000.0f / MOUSEKEY_WHEEL_INITIAL_MOVEMENTS ;
74
- # endif /* #ifndef MK_KINETIC_SPEED */
70
+ uint8_t mk_wheel_interval = MOUSEKEY_WHEEL_INTERVAL ;
75
71
uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED ;
76
72
uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX ;
77
73
78
74
# ifndef MK_COMBINED
79
- # ifndef MK_KINETIC_SPEED
80
75
81
76
static uint8_t move_unit (void ) {
82
77
uint16_t unit ;
@@ -114,7 +109,8 @@ static uint8_t wheel_unit(void) {
114
109
return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit ));
115
110
}
116
111
117
- # else /* #ifndef MK_KINETIC_SPEED */
112
+ # else /* #ifndef MK_COMBINED */
113
+ # ifdef MK_KINETIC_SPEED
118
114
119
115
/*
120
116
* Kinetic movement acceleration algorithm
@@ -134,7 +130,7 @@ const uint16_t mk_decelerated_speed = MOUSEKEY_DECELERATED_SPEED;
134
130
const uint16_t mk_initial_speed = MOUSEKEY_INITIAL_SPEED ;
135
131
136
132
static uint8_t move_unit (void ) {
137
- float speed = ( float ) mk_initial_speed ;
133
+ float speed = mk_initial_speed ;
138
134
139
135
if (mousekey_accel & ((1 << 0 ) | (1 << 2 ))) {
140
136
speed = mousekey_accel & (1 << 2 ) ? mk_accelerated_speed : mk_decelerated_speed ;
@@ -152,6 +148,8 @@ static uint8_t move_unit(void) {
152
148
return speed > MOUSEKEY_MOVE_MAX ? MOUSEKEY_MOVE_MAX : speed ;
153
149
}
154
150
151
+ float mk_wheel_interval = 1000.0f / MOUSEKEY_WHEEL_INITIAL_MOVEMENTS ;
152
+
155
153
static uint8_t wheel_unit (void ) {
156
154
float speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS ;
157
155
@@ -170,8 +168,7 @@ static uint8_t wheel_unit(void) {
170
168
return 1 ;
171
169
}
172
170
173
- # endif /* #ifndef MK_KINETIC_SPEED */
174
- # else /* #ifndef MK_COMBINED */
171
+ # else /* #ifndef MK_KINETIC_SPEED */
175
172
176
173
static uint8_t move_unit (void ) {
177
174
uint16_t unit ;
@@ -209,7 +206,8 @@ static uint8_t wheel_unit(void) {
209
206
return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit ));
210
207
}
211
208
212
- # endif /* #ifndef MK_COMBINED */
209
+ # endif /* #ifndef MK_KINETIC_SPEED */
210
+ # endif /* #ifndef MK_COMBINED */
213
211
214
212
void mousekey_task (void ) {
215
213
// report cursor and scroll movement independently
0 commit comments