From 78ee9926873d2315d6c56b422abb9ec1a0cf5591 Mon Sep 17 00:00:00 2001 From: chris-010 <10660568+chris-010@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:00:17 +0200 Subject: [PATCH] add config MOUSE_PARKING_POSITION --- src/mouse.c | 5 ++++- src/user_config.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/mouse.c b/src/mouse.c index 07b8318..0a35175 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -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); diff --git a/src/user_config.h b/src/user_config.h index aa45b76..d7ab84a 100644 --- a/src/user_config.h +++ b/src/user_config.h @@ -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 ============== * * ================================================== *