mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(Windows) Windows likes autorepeating of keys too much - have to do
some ugly timer stuff here
This commit is contained in:
parent
cf4d31cd80
commit
b9fde7bb24
@ -192,6 +192,7 @@ static menu_ctx_iterate_t pending_iter;
|
|||||||
static void menu_input_key_event(bool down, unsigned keycode,
|
static void menu_input_key_event(bool down, unsigned keycode,
|
||||||
uint32_t character, uint16_t mod)
|
uint32_t character, uint16_t mod)
|
||||||
{
|
{
|
||||||
|
static unsigned timeout = 0;
|
||||||
static bool block_pending = false;
|
static bool block_pending = false;
|
||||||
|
|
||||||
(void)down;
|
(void)down;
|
||||||
@ -208,18 +209,29 @@ static void menu_input_key_event(bool down, unsigned keycode,
|
|||||||
case RETROK_RETURN:
|
case RETROK_RETURN:
|
||||||
pending_iter.action = MENU_ACTION_OK;
|
pending_iter.action = MENU_ACTION_OK;
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_ACTION, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_ACTION, NULL);
|
||||||
|
timeout = 1;
|
||||||
block_pending = true;
|
block_pending = true;
|
||||||
break;
|
break;
|
||||||
case RETROK_BACKSPACE:
|
case RETROK_BACKSPACE:
|
||||||
pending_iter.action = MENU_ACTION_CANCEL;
|
pending_iter.action = MENU_ACTION_CANCEL;
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_ACTION, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_ACTION, NULL);
|
||||||
|
timeout = 1;
|
||||||
block_pending = true;
|
block_pending = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
block_pending = false;
|
if (timeout >= 1)
|
||||||
|
{
|
||||||
|
timeout++;
|
||||||
|
|
||||||
|
if (timeout > 2)
|
||||||
|
{
|
||||||
|
timeout = 0;
|
||||||
|
block_pending = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_driver_toggle(bool latch)
|
static void menu_driver_toggle(bool latch)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user