Skip to content

Commit

Permalink
Merge pull request #103 from chris-010/mouse-parking-position
Browse files Browse the repository at this point in the history
add config MOUSE_PARKING_POSITION
  • Loading branch information
hrvach authored Jun 18, 2024
2 parents 375f324 + 78ee992 commit 29b29ba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ int16_t scale_y_coordinate(int screen_from, int screen_to, device_t *state) {

void switch_screen(
device_t *state, output_t *output, int new_x, int output_from, int output_to, int direction) {
mouse_report_t hidden_pointer = {.y = MIN_SCREEN_COORD, .x = MAX_SCREEN_COORD};
unsigned mouse_y = (MOUSE_PARKING_POSITION == 0) ? MIN_SCREEN_COORD : /*TOP*/
(MOUSE_PARKING_POSITION == 1) ? MAX_SCREEN_COORD : /*BOTTOM*/
state->mouse_y; /*PREVIOUS*/
mouse_report_t hidden_pointer = {.y = mouse_y, .x = MAX_SCREEN_COORD};

output_mouse_report(&hidden_pointer, state);
switch_output(state, output_to);
Expand Down
14 changes: 14 additions & 0 deletions src/user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@
/* Mouse acceleration */
#define ENABLE_ACCELERATION 1


/**================================================== *
* =========== Mouse General Settings ============= *
* ================================================== *
*
* MOUSE_PARKING_POSITION: [0, 1, 2 ] 0 means park mouse on TOP
* 1 means park mouse on BOTTOM
* 2 means park mouse on PREVIOUS position
*
* */

#define MOUSE_PARKING_POSITION 0


/**================================================== *
* ============== Screensaver Config ============== *
* ================================================== *
Expand Down

0 comments on commit 29b29ba

Please sign in to comment.