Ignore menu mouse startup position before moving (#17951)
This commit is contained in:
parent
4529d06a5a
commit
0f664c739b
|
@ -1862,6 +1862,8 @@ static void menu_input_get_mouse_hw_state(
|
||||||
rarch_joypad_info_t joypad_info;
|
rarch_joypad_info_t joypad_info;
|
||||||
static int16_t last_x = 0;
|
static int16_t last_x = 0;
|
||||||
static int16_t last_y = 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_select_pressed = false;
|
||||||
bool is_cancel_pressed = false;
|
bool is_cancel_pressed = false;
|
||||||
static bool last_select_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;
|
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_x = hw_state->x;
|
||||||
last_y = hw_state->y;
|
last_y = hw_state->y;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue