diff options
Diffstat (limited to 'tmk_core/common/mousekey.c')
-rw-r--r-- | tmk_core/common/mousekey.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tmk_core/common/mousekey.c b/tmk_core/common/mousekey.c index 390c74e0f..ef18bcf1a 100644 --- a/tmk_core/common/mousekey.c +++ b/tmk_core/common/mousekey.c | |||
@@ -33,8 +33,8 @@ inline int8_t times_inv_sqrt2(int8_t x) { | |||
33 | 33 | ||
34 | static report_mouse_t mouse_report = {0}; | 34 | static report_mouse_t mouse_report = {0}; |
35 | static void mousekey_debug(void); | 35 | static void mousekey_debug(void); |
36 | static uint8_t mousekey_accel = 0; | 36 | static uint8_t mousekey_accel = 0; |
37 | static uint8_t mousekey_repeat = 0; | 37 | static uint8_t mousekey_repeat = 0; |
38 | static uint8_t mousekey_wheel_repeat = 0; | 38 | static uint8_t mousekey_wheel_repeat = 0; |
39 | 39 | ||
40 | #ifndef MK_3_SPEED | 40 | #ifndef MK_3_SPEED |
@@ -225,7 +225,6 @@ void mousekey_on(uint8_t code) { | |||
225 | mousekey_accel |= (1 << 1); | 225 | mousekey_accel |= (1 << 1); |
226 | else if (code == KC_MS_ACCEL2) | 226 | else if (code == KC_MS_ACCEL2) |
227 | mousekey_accel |= (1 << 2); | 227 | mousekey_accel |= (1 << 2); |
228 | |||
229 | } | 228 | } |
230 | 229 | ||
231 | void mousekey_off(uint8_t code) { | 230 | void mousekey_off(uint8_t code) { |
@@ -284,10 +283,10 @@ uint16_t w_intervals[mkspd_COUNT] = {MK_W_INTERVAL_UNMOD, MK_W_INTERVAL_0 | |||
284 | void mousekey_task(void) { | 283 | void mousekey_task(void) { |
285 | // report cursor and scroll movement independently | 284 | // report cursor and scroll movement independently |
286 | report_mouse_t const tmpmr = mouse_report; | 285 | report_mouse_t const tmpmr = mouse_report; |
287 | mouse_report.x = 0; | 286 | mouse_report.x = 0; |
288 | mouse_report.y = 0; | 287 | mouse_report.y = 0; |
289 | mouse_report.v = 0; | 288 | mouse_report.v = 0; |
290 | mouse_report.h = 0; | 289 | mouse_report.h = 0; |
291 | 290 | ||
292 | if ((tmpmr.x || tmpmr.y) && timer_elapsed(last_timer_c) > c_intervals[mk_speed]) { | 291 | if ((tmpmr.x || tmpmr.y) && timer_elapsed(last_timer_c) > c_intervals[mk_speed]) { |
293 | mouse_report.x = tmpmr.x; | 292 | mouse_report.x = tmpmr.x; |
@@ -421,10 +420,10 @@ void mousekey_send(void) { | |||
421 | } | 420 | } |
422 | 421 | ||
423 | void mousekey_clear(void) { | 422 | void mousekey_clear(void) { |
424 | mouse_report = (report_mouse_t){}; | 423 | mouse_report = (report_mouse_t){}; |
425 | mousekey_repeat = 0; | 424 | mousekey_repeat = 0; |
426 | mousekey_wheel_repeat = 0; | 425 | mousekey_wheel_repeat = 0; |
427 | mousekey_accel = 0; | 426 | mousekey_accel = 0; |
428 | } | 427 | } |
429 | 428 | ||
430 | static void mousekey_debug(void) { | 429 | static void mousekey_debug(void) { |