mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
(Menu) A long press will reset a setting to its default value
This commit is contained in:
parent
002928c399
commit
013bf29fff
@ -439,6 +439,8 @@ static int menu_input_pointer_post_iterate(
|
||||
|
||||
video_context_driver_get_metrics(&metrics);
|
||||
|
||||
menu_input->pointer.counter++;
|
||||
|
||||
if (!pointer_oldpressed[0])
|
||||
{
|
||||
menu_input->pointer.accel = 0;
|
||||
@ -507,9 +509,20 @@ static int menu_input_pointer_post_iterate(
|
||||
}
|
||||
else
|
||||
{
|
||||
menu_driver_ctl(RARCH_MENU_CTL_POINTER_UP, &point);
|
||||
menu_driver_ctl(RARCH_MENU_CTL_POINTER_TAP, &point);
|
||||
ret = point.retcode;
|
||||
if (menu_input->pointer.counter > 32)
|
||||
{
|
||||
size_t selection;
|
||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection);
|
||||
if (cbs && cbs->action_start)
|
||||
return menu_entry_action(entry, (unsigned)selection, MENU_ACTION_START);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
menu_driver_ctl(RARCH_MENU_CTL_POINTER_UP, &point);
|
||||
menu_driver_ctl(RARCH_MENU_CTL_POINTER_TAP, &point);
|
||||
ret = point.retcode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,6 +533,7 @@ static int menu_input_pointer_post_iterate(
|
||||
pointer_old_y = 0;
|
||||
menu_input->pointer.dx = 0;
|
||||
menu_input->pointer.dy = 0;
|
||||
menu_input->pointer.counter = 0;
|
||||
|
||||
menu_input_ctl(MENU_INPUT_CTL_UNSET_POINTER_DRAGGED, NULL);
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ typedef struct menu_input
|
||||
bool pressed[2];
|
||||
bool back;
|
||||
unsigned ptr;
|
||||
unsigned counter;
|
||||
} pointer;
|
||||
} menu_input_t;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user