diff --git a/binaries/board_A.uf2 b/binaries/board_A.uf2 index 2ac7412..fa09221 100644 Binary files a/binaries/board_A.uf2 and b/binaries/board_A.uf2 differ diff --git a/binaries/board_B.uf2 b/binaries/board_B.uf2 index e68f09a..546f5fc 100644 Binary files a/binaries/board_B.uf2 and b/binaries/board_B.uf2 differ diff --git a/src/main.h b/src/main.h index 925da53..fd07b04 100644 --- a/src/main.h +++ b/src/main.h @@ -149,6 +149,7 @@ typedef struct { /********* Screen **********/ #define MIN_SCREEN_COORD 0 #define MAX_SCREEN_COORD 32767 +#define SCREEN_MIDPOINT 16384 /********* Configuration storage definitions **********/ diff --git a/src/mouse.c b/src/mouse.c index f122e98..75ae968 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -135,7 +135,7 @@ void switch_desktop(device_t *state, output_t *output, int new_index, int direct /* Fix for MACOS: Send relative mouse movement here, one or two pixels in the direction of movement, BEFORE absolute report sets X to 0 */ mouse_report_t move_relative_one - = {.x = (direction == LEFT) ? 16384 - 2 : 16384 + 2, .mode = RELATIVE}; + = {.x = (direction == LEFT) ? SCREEN_MIDPOINT - 2 : SCREEN_MIDPOINT + 2, .mode = RELATIVE}; switch (output->os) { case MACOS: @@ -233,8 +233,8 @@ mouse_report_t create_mouse_report(device_t *state, mouse_values_t *values) { /* Workaround for Windows multiple desktops */ if (state->relative_mouse) { - mouse_report.x = 16384 + values->move_x; - mouse_report.y = 16384 + values->move_y; + mouse_report.x = SCREEN_MIDPOINT + values->move_x; + mouse_report.y = SCREEN_MIDPOINT + values->move_y; mouse_report.mode = RELATIVE; mouse_report.buttons = values->buttons; mouse_report.wheel = values->wheel;