(Menu) A long press will reset a setting to its default value

This commit is contained in:
Jean-André Santoni 2017-03-04 15:35:05 +01:00
parent 002928c399
commit 013bf29fff
2 changed files with 18 additions and 3 deletions

View File

@ -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);
}

View File

@ -98,6 +98,7 @@ typedef struct menu_input
bool pressed[2];
bool back;
unsigned ptr;
unsigned counter;
} pointer;
} menu_input_t;