diff options
| author | Drashna Jaelre <drashna@live.com> | 2022-06-28 15:28:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-28 15:28:44 -0700 |
| commit | 43f8d365ba01b1e61b0c6cbbf6ef28eea9dee2b9 (patch) | |
| tree | 2d9bab8c6ee6e64701fc61a946c4f5dac04c3628 /quantum | |
| parent | 1e402060a668d8edf72279c84c4083d9e3c0dacd (diff) | |
[Bug] Fix issue with mousekey movement getting stuck (#17493)
* [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; | |||
| 70 | uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED; | 70 | uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED; |
| 71 | uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX; | 71 | uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX; |
| 72 | 72 | ||
| 73 | bool should_mousekey_report_send(report_mouse_t *mouse_report) { | ||
| 74 | return mouse_report->x || mouse_report->y || mouse_report->v || mouse_report->h; | ||
| 75 | } | ||
| 76 | |||
| 73 | # ifndef MK_COMBINED | 77 | # ifndef MK_COMBINED |
| 74 | 78 | ||
| 75 | static uint8_t move_unit(void) { | 79 | static uint8_t move_unit(void) { |
| @@ -252,7 +256,7 @@ void mousekey_task(void) { | |||
| 252 | } | 256 | } |
| 253 | } | 257 | } |
| 254 | 258 | ||
| 255 | if (has_mouse_report_changed(&mouse_report, &tmpmr)) { | 259 | if (has_mouse_report_changed(&mouse_report, &tmpmr) || should_mousekey_report_send(&mouse_report)) { |
| 256 | mousekey_send(); | 260 | mousekey_send(); |
| 257 | } | 261 | } |
| 258 | memcpy(&mouse_report, &tmpmr, sizeof(tmpmr)); | 262 | memcpy(&mouse_report, &tmpmr, sizeof(tmpmr)); |
| @@ -358,7 +362,7 @@ void mousekey_task(void) { | |||
| 358 | mouse_report.h = tmpmr.h; | 362 | mouse_report.h = tmpmr.h; |
| 359 | } | 363 | } |
| 360 | 364 | ||
| 361 | if (has_mouse_report_changed(&mouse_report, &tmpmr)) { | 365 | if (has_mouse_report_changed(&mouse_report, &tmpmr) || should_mousekey_report_send(&mouse_report)) { |
| 362 | mousekey_send(); | 366 | mousekey_send(); |
| 363 | } | 367 | } |
| 364 | memcpy(&mouse_report, &tmpmr, sizeof(tmpmr)); | 368 | memcpy(&mouse_report, &tmpmr, sizeof(tmpmr)); |
