Skip to content

Commit 2c993d7

Browse files
drashnazykrah
authored andcommitted
Revert "Fix kinetic mouse mode (qmk#16951)" (qmk#17095)
1 parent 05443f7 commit 2c993d7

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

quantum/mousekey.c

+9-11
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,11 @@ uint8_t mk_time_to_max = MOUSEKEY_TIME_TO_MAX;
6767
/* milliseconds between the initial key press and first repeated motion event (0-2550) */
6868
uint8_t mk_wheel_delay = MOUSEKEY_WHEEL_DELAY / 10;
6969
/* 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;
7571
uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED;
7672
uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX;
7773

7874
# ifndef MK_COMBINED
79-
# ifndef MK_KINETIC_SPEED
8075

8176
static uint8_t move_unit(void) {
8277
uint16_t unit;
@@ -114,7 +109,8 @@ static uint8_t wheel_unit(void) {
114109
return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit));
115110
}
116111

117-
# else /* #ifndef MK_KINETIC_SPEED */
112+
# else /* #ifndef MK_COMBINED */
113+
# ifdef MK_KINETIC_SPEED
118114

119115
/*
120116
* Kinetic movement acceleration algorithm
@@ -134,7 +130,7 @@ const uint16_t mk_decelerated_speed = MOUSEKEY_DECELERATED_SPEED;
134130
const uint16_t mk_initial_speed = MOUSEKEY_INITIAL_SPEED;
135131

136132
static uint8_t move_unit(void) {
137-
float speed = (float)mk_initial_speed;
133+
float speed = mk_initial_speed;
138134

139135
if (mousekey_accel & ((1 << 0) | (1 << 2))) {
140136
speed = mousekey_accel & (1 << 2) ? mk_accelerated_speed : mk_decelerated_speed;
@@ -152,6 +148,8 @@ static uint8_t move_unit(void) {
152148
return speed > MOUSEKEY_MOVE_MAX ? MOUSEKEY_MOVE_MAX : speed;
153149
}
154150

151+
float mk_wheel_interval = 1000.0f / MOUSEKEY_WHEEL_INITIAL_MOVEMENTS;
152+
155153
static uint8_t wheel_unit(void) {
156154
float speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS;
157155

@@ -170,8 +168,7 @@ static uint8_t wheel_unit(void) {
170168
return 1;
171169
}
172170

173-
# endif /* #ifndef MK_KINETIC_SPEED */
174-
# else /* #ifndef MK_COMBINED */
171+
# else /* #ifndef MK_KINETIC_SPEED */
175172

176173
static uint8_t move_unit(void) {
177174
uint16_t unit;
@@ -209,7 +206,8 @@ static uint8_t wheel_unit(void) {
209206
return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit));
210207
}
211208

212-
# endif /* #ifndef MK_COMBINED */
209+
# endif /* #ifndef MK_KINETIC_SPEED */
210+
# endif /* #ifndef MK_COMBINED */
213211

214212
void mousekey_task(void) {
215213
// report cursor and scroll movement independently

0 commit comments

Comments
 (0)