mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Refactor input_keyboard_event
This commit is contained in:
parent
b4a26e2e30
commit
61f28bc000
@ -222,22 +222,29 @@ void input_keyboard_event(bool down, unsigned code,
|
||||
|
||||
if (deferred_wait_keys)
|
||||
{
|
||||
if (!down)
|
||||
{
|
||||
if (down)
|
||||
return;
|
||||
|
||||
input_keyboard_wait_keys_cancel();
|
||||
deferred_wait_keys = false;
|
||||
}
|
||||
}
|
||||
else if (g_keyboard_press_cb)
|
||||
{
|
||||
if (down && code != RETROK_UNKNOWN
|
||||
&& !g_keyboard_press_cb(g_keyboard_press_data, code))
|
||||
if (!down)
|
||||
return;
|
||||
if (code == RETROK_UNKNOWN)
|
||||
return;
|
||||
if (g_keyboard_press_cb(g_keyboard_press_data, code))
|
||||
return;
|
||||
deferred_wait_keys = true;
|
||||
}
|
||||
else if (g_keyboard_line)
|
||||
{
|
||||
if (down && input_keyboard_line_event(g_keyboard_line, character))
|
||||
{
|
||||
if (!down)
|
||||
return;
|
||||
if (!input_keyboard_line_event(g_keyboard_line, character))
|
||||
return;
|
||||
|
||||
/* Line is complete, can free it now. */
|
||||
input_keyboard_line_free(g_keyboard_line);
|
||||
g_keyboard_line = NULL;
|
||||
@ -245,7 +252,6 @@ void input_keyboard_event(bool down, unsigned code,
|
||||
/* Unblock all hotkeys. */
|
||||
driver.block_input = false;
|
||||
}
|
||||
}
|
||||
else if (g_extern.system.key_event)
|
||||
g_extern.system.key_event(down, code, character, mod);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user