Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mousekey doesn't work with trackpoint #18474

Merged
merged 8 commits into from
Nov 13, 2022
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};
klesh marked this conversation as resolved.
Show resolved Hide resolved
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;
klesh marked this conversation as resolved.
Show resolved Hide resolved
}