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 07c00f7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions quantum/mousekey.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ inline int8_t times_inv_sqrt2(int8_t x) {
return (x * 181) >> 8;
}

static report_mouse_t mouse_report = {0};
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,7 @@ 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 07c00f7

Please sign in to comment.