mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-03-06 10:27:13 +00:00
Roll this back
This commit is contained in:
parent
8958e02b54
commit
0b1a204949
@ -381,14 +381,7 @@ 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;
|
||||
struct menu_bind_state binds;
|
||||
bool timed_out = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
@ -407,15 +400,6 @@ 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(
|
||||
@ -423,12 +407,6 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
|
||||
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;
|
||||
}
|
||||
|
||||
/* 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user