Properly handle key down latch instead of hoky timer stuff

This commit is contained in:
Twinaphex 2016-02-12 08:10:35 +01:00
parent 410e750d24
commit 28ddefc467

View File

@ -192,9 +192,6 @@ static menu_ctx_iterate_t pending_iter;
static void menu_input_key_event(bool down, unsigned keycode,
uint32_t character, uint16_t mod)
{
static unsigned timeout = 0;
static bool block_pending = false;
(void)down;
(void)keycode;
(void)mod;
@ -202,35 +199,19 @@ static void menu_input_key_event(bool down, unsigned keycode,
if (character == '/')
menu_entry_action(NULL, 0, MENU_ACTION_SEARCH);
if (!block_pending)
if (down)
{
switch (keycode)
{
case RETROK_RETURN:
pending_iter.action = MENU_ACTION_OK;
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_ACTION, NULL);
timeout = 1;
block_pending = true;
break;
case RETROK_BACKSPACE:
pending_iter.action = MENU_ACTION_CANCEL;
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_ACTION, NULL);
timeout = 1;
block_pending = true;
break;
}
return;
}
if (timeout >= 1)
{
timeout++;
if (timeout > 2)
{
timeout = 0;
block_pending = false;
}
}
}