mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
Reimplement FLUSH_INPUT
This commit is contained in:
parent
aa6d779fbc
commit
eec0724175
1
driver.h
1
driver.h
@ -484,6 +484,7 @@ typedef struct driver
|
||||
unsigned block_hotkey_until;
|
||||
bool block_input;
|
||||
bool block_libretro_input;
|
||||
unsigned block_libretro_input_until;
|
||||
bool nonblock_state;
|
||||
|
||||
/* Opaque handles to currently running window.
|
||||
|
@ -181,8 +181,11 @@ static int16_t input_state(unsigned port, unsigned device,
|
||||
g_settings.input.binds[15],
|
||||
};
|
||||
|
||||
if (!driver.block_libretro_input && (id < RARCH_FIRST_META_KEY ||
|
||||
device == RETRO_DEVICE_KEYBOARD))
|
||||
if (!driver.block_libretro_input &&
|
||||
((id < RARCH_FIRST_META_KEY ||
|
||||
device == RETRO_DEVICE_KEYBOARD) &&
|
||||
(g_extern.frame_count > driver.block_libretro_input_until))
|
||||
)
|
||||
res = driver.input->input_state(driver.input_data, binds, port,
|
||||
device, index, id);
|
||||
|
||||
|
@ -2866,10 +2866,7 @@ void rarch_main_set_state(unsigned cmd)
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_QUIT);
|
||||
break;
|
||||
case RARCH_ACTION_STATE_FLUSH_INPUT:
|
||||
driver.retro_ctx.poll_cb();
|
||||
#ifdef HAVE_MENU
|
||||
menu_input();
|
||||
#endif
|
||||
driver.block_libretro_input_until = g_extern.frame_count + (5);
|
||||
/* Restore libretro keyboard callback. */
|
||||
g_extern.system.key_event = g_extern.frontend_key_event;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user