mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
Properly handle key down latch instead of hoky timer stuff
This commit is contained in:
parent
410e750d24
commit
28ddefc467
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user