Skip to content

Commit

Permalink
[Bug] Fix issue with mousekey movement getting stuck (#17493)
Browse files Browse the repository at this point in the history
* [Bug] Fix issue with mousekey movement getting stuck

* Lint
  • Loading branch information
drashna authored Jun 28, 2022
1 parent 1e40206 commit 43f8d36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions quantum/mousekey.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 43f8d36

Please sign in to comment.