aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2020-03-13 17:24:38 +0000
committerQMK Bot <hello@qmk.fm>2020-03-13 17:24:38 +0000
commitf89439ae09c06d0e85f59af2bc5e020d141f23d6 (patch)
treeec6d01493813e51bbde7a766d7dc310b777e7803 /tmk_core
parent3cd2a27ac0f963bc2023c3004f6f8eff0eb62a81 (diff)
downloadfirmware-f89439ae09c06d0e85f59af2bc5e020d141f23d6.tar.gz
firmware-f89439ae09c06d0e85f59af2bc5e020d141f23d6.tar.bz2
firmware-f89439ae09c06d0e85f59af2bc5e020d141f23d6.zip
format code according to conventions [skip ci]
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/mousekey.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/tmk_core/common/mousekey.c b/tmk_core/common/mousekey.c
index 00357f5f6..74fa88abd 100644
--- a/tmk_core/common/mousekey.c
+++ b/tmk_core/common/mousekey.c
@@ -39,8 +39,8 @@ static uint16_t last_timer = 0;
#ifndef MK_3_SPEED
-static uint16_t last_timer_c = 0;
-static uint16_t last_timer_w = 0;
+static uint16_t last_timer_c = 0;
+static uint16_t last_timer_w = 0;
/*
* Mouse keys acceleration algorithm
@@ -62,7 +62,7 @@ uint8_t mk_time_to_max = MOUSEKEY_TIME_TO_MAX;
/* milliseconds between the initial key press and first repeated motion event (0-2550) */
uint8_t mk_wheel_delay = MOUSEKEY_WHEEL_DELAY / 10;
/* milliseconds between repeated motion events (0-255) */
-uint8_t mk_wheel_interval = MOUSEKEY_WHEEL_INTERVAL;
+uint8_t mk_wheel_interval = MOUSEKEY_WHEEL_INTERVAL;
uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED;
uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX;
@@ -105,8 +105,7 @@ static uint8_t wheel_unit(void) {
void mousekey_task(void) {
// report cursor and scroll movement independently
report_mouse_t const tmpmr = mouse_report;
- if ((mouse_report.x || mouse_report.y) &&
- timer_elapsed(last_timer_c) > (mousekey_repeat ? mk_interval : mk_delay * 10)) {
+ if ((mouse_report.x || mouse_report.y) && timer_elapsed(last_timer_c) > (mousekey_repeat ? mk_interval : mk_delay * 10)) {
if (mousekey_repeat != UINT8_MAX) mousekey_repeat++;
mouse_report.v = 0;
mouse_report.h = 0;
@@ -117,16 +116,19 @@ void mousekey_task(void) {
/* diagonal move [1/sqrt(2)] */
if (mouse_report.x && mouse_report.y) {
mouse_report.x = times_inv_sqrt2(mouse_report.x);
- if (mouse_report.x == 0) { mouse_report.x = 1; }
+ if (mouse_report.x == 0) {
+ mouse_report.x = 1;
+ }
mouse_report.y = times_inv_sqrt2(mouse_report.y);
- if (mouse_report.y == 0) { mouse_report.y = 1; }
+ if (mouse_report.y == 0) {
+ mouse_report.y = 1;
+ }
}
mousekey_send();
last_timer_c = last_timer;
mouse_report = tmpmr;
}
- if ((mouse_report.v || mouse_report.h) &&
- timer_elapsed(last_timer_w) > (mousekey_repeat ? mk_wheel_interval: mk_wheel_delay * 10)) {
+ if ((mouse_report.v || mouse_report.h) && timer_elapsed(last_timer_w) > (mousekey_repeat ? mk_wheel_interval : mk_wheel_delay * 10)) {
if (mousekey_repeat != UINT8_MAX) mousekey_repeat++;
mouse_report.x = 0;
mouse_report.y = 0;
@@ -137,9 +139,13 @@ void mousekey_task(void) {
/* diagonal move [1/sqrt(2)] */
if (mouse_report.v && mouse_report.h) {
mouse_report.v = times_inv_sqrt2(mouse_report.v);
- if (mouse_report.v == 0) { mouse_report.v = 1; }
+ if (mouse_report.v == 0) {
+ mouse_report.v = 1;
+ }
mouse_report.h = times_inv_sqrt2(mouse_report.h);
- if (mouse_report.h == 0) { mouse_report.h = 1; }
+ if (mouse_report.h == 0) {
+ mouse_report.h = 1;
+ }
}
mousekey_send();
last_timer_w = last_timer;