Ignore menu mouse startup position before moving (#17951)

This commit is contained in:
sonninnos 2025-05-27 16:48:03 +03:00 committed by GitHub
parent 4529d06a5a
commit 0f664c739b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -1862,6 +1862,8 @@ static void menu_input_get_mouse_hw_state(
rarch_joypad_info_t joypad_info;
static int16_t last_x = 0;
static int16_t last_y = 0;
static int16_t initial_x = 0;
static int16_t initial_y = 0;
bool is_select_pressed = false;
bool is_cancel_pressed = false;
static bool last_select_pressed = false;
@ -1920,6 +1922,16 @@ static void menu_input_get_mouse_hw_state(
hw_state->flags |= MENU_INP_PTR_FLG_ACTIVE;
}
/* Start reading mouse position after moving it once */
initial_x = (initial_x) ? initial_x : hw_state->x;
initial_y = (initial_y) ? initial_y : hw_state->y;
if ((hw_state->x == initial_x && hw_state->y == initial_y))
{
hw_state->flags &= ~MENU_INP_PTR_FLG_ACTIVE;
return;
}
last_x = hw_state->x;
last_y = hw_state->y;