Roll this back

This commit is contained in:
twinaphex 2017-01-16 22:32:39 +01:00
parent 8958e02b54
commit 0b1a204949

@ -381,16 +381,9 @@ bool menu_input_key_bind_set_min_max(menu_input_ctx_bind_limits_t *lim)
bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
{
struct menu_bind_state binds = {0};
/* single binds can have latching issues,
* single_bind_delay = 0 (single bind not yet bound)
* single_bind_delay = 1 (latching procedure)
* single_bind_delay = 2 (second iteration, will quit iteration loop)
*/
static unsigned single_bind_delay = 0;
bool trigger_found = false;
bool timed_out = false;
settings_t *settings = config_get_ptr();
struct menu_bind_state binds;
bool timed_out = false;
settings_t *settings = config_get_ptr();
rarch_timer_tick(&menu_input_binds.timer);
@ -407,27 +400,12 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
timed_out = true;
}
if (single_bind_delay > 0)
{
snprintf(bind->s, bind->len, "Confirming key %s ...",
input_config_bind_map_get_desc(
menu_input_binds.begin - MENU_SETTINGS_BIND_BEGIN)
);
single_bind_delay++;
}
else
snprintf(bind->s, bind->len,
"[%s]\npress keyboard or joypad\n(timeout %d %s)",
input_config_bind_map_get_desc(
menu_input_binds.begin - MENU_SETTINGS_BIND_BEGIN),
rarch_timer_get_timeout(&menu_input_binds.timer),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SECONDS));
if (single_bind_delay == 2)
{
single_bind_delay = 0;
return true;
}
snprintf(bind->s, bind->len,
"[%s]\npress keyboard or joypad\n(timeout %d %s)",
input_config_bind_map_get_desc(
menu_input_binds.begin - MENU_SETTINGS_BIND_BEGIN),
rarch_timer_get_timeout(&menu_input_binds.timer),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SECONDS));
/* binds.begin is updated in keyboard_press callback. */
if (menu_input_binds.begin > menu_input_binds.last)
@ -439,13 +417,6 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
if (timed_out)
input_keyboard_ctl(RARCH_INPUT_KEYBOARD_CTL_CANCEL_WAIT_KEYS, NULL);
/* If this is a single bind, add another delay of one second */
if (!timed_out && (binds.begin == binds.last))
{
single_bind_delay = 1;
return false;
}
return true;
}
@ -454,23 +425,14 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
input_driver_keyboard_mapping_set_block(true);
menu_input_key_bind_poll_bind_state(&binds, menu_bind_port, timed_out);
if (single_bind_delay == 0)
trigger_found = menu_input_key_bind_poll_find_trigger(&menu_input_binds, &binds);
if ((binds.skip && !menu_input_binds.skip) || trigger_found)
if ((binds.skip && !menu_input_binds.skip) ||
menu_input_key_bind_poll_find_trigger(&menu_input_binds, &binds))
{
input_driver_keyboard_mapping_set_block(false);
/* Avoid new binds triggering things right away. */
input_driver_set_flushing_input();
/* If this is a single bind, add a latching delay */
if (binds.begin == binds.last)
{
single_bind_delay = 1;
return false;
}
binds.begin++;
if (binds.begin > binds.last)