diff options
author | Drashna Jaelre <drashna@live.com> | 2022-06-28 16:24:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 08:24:07 +0900 |
commit | 6b42067a3830df4ef2e1f131de40d0402174e3ba (patch) | |
tree | fd158a3a5ffd9f62ce6a81c02880e43c86bb820d /quantum | |
parent | 7d5eb53524b951384e4e1bb5c69cef08528a1fb5 (diff) |
[Bug] Fix issue with mousekey movement getting stuck (#17493) (#347)
* [Bug] Fix issue with mousekey movement getting stuck
* Lint
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/mousekey.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/quantum/mousekey.c b/quantum/mousekey.c index 64d0e66682..33d71af083 100644 --- a/quantum/mousekey.c +++ b/quantum/mousekey.c @@ -70,6 +70,10 @@ 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; +bool should_mousekey_report_send(report_mouse_t *mouse_report) { + return mouse_report->x || mouse_report->y || mouse_report->v || mouse_report->h; +} + # ifndef MK_COMBINED static uint8_t move_unit(void) { @@ -252,7 +256,7 @@ void mousekey_task(void) { } } - if (has_mouse_report_changed(&mouse_report, &tmpmr)) { + if (has_mouse_report_changed(&mouse_report, &tmpmr) || should_mousekey_report_send(&mouse_report)) { mousekey_send(); } memcpy(&mouse_report, &tmpmr, sizeof(tmpmr)); @@ -358,7 +362,7 @@ void mousekey_task(void) { mouse_report.h = tmpmr.h; } - if (has_mouse_report_changed(&mouse_report, &tmpmr)) { + if (has_mouse_report_changed(&mouse_report, &tmpmr) || should_mousekey_report_send(&mouse_report)) { mousekey_send(); } memcpy(&mouse_report, &tmpmr, sizeof(tmpmr)); |