Skip to content

Commit

Permalink
Minor fix and update binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrvoje Cavrak committed Mar 31, 2024
1 parent b44ef2d commit 1a91b4d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Binary file modified binaries/board_A.uf2
Binary file not shown.
Binary file modified binaries/board_B.uf2
Binary file not shown.
1 change: 1 addition & 0 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ typedef struct {
/********* Screen **********/
#define MIN_SCREEN_COORD 0
#define MAX_SCREEN_COORD 32767
#define SCREEN_MIDPOINT 16384

/********* Configuration storage definitions **********/

Expand Down
6 changes: 3 additions & 3 deletions src/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1a91b4d

Please sign in to comment.