Skip to content

Commit

Permalink
fix: mousekey doesn't work with trackpoint
Browse files Browse the repository at this point in the history
  Related to #18277
  • Loading branch information
klesh committed Sep 25, 2022
1 parent 431c928 commit f5a7c42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion quantum/mousekey.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ inline int8_t times_inv_sqrt2(int8_t x) {
}

static report_mouse_t mouse_report = {0};
static report_mouse_t previous_mouse_report = {0};
static void mousekey_debug(void);
static uint8_t mousekey_accel = 0;
static uint8_t mousekey_repeat = 0;
Expand Down Expand Up @@ -502,5 +503,11 @@ report_mouse_t mousekey_get_report(void) {
}

bool should_mousekey_report_send(report_mouse_t *mouse_report) {
return mouse_report->x || mouse_report->y || mouse_report->v || mouse_report->h;
bool changed = mouse_report->x != previous_mouse_report.x
|| mouse_report->y != previous_mouse_report.y
|| mouse_report->v != previous_mouse_report.v
|| mouse_report->h != previous_mouse_report.h
|| mouse_report->buttons != previous_mouse_report.buttons;
previous_mouse_report = *mouse_report;
return changed;
}

0 comments on commit f5a7c42

Please sign in to comment.