From b4ac13cc5a393d29fd2d57d5e337730445ae94ea Mon Sep 17 00:00:00 2001 From: Dylan Scott Date: Tue, 14 Jul 2020 03:33:55 -0400 Subject: [PATCH] (Emscripten) Fix input code to ignore unknown keys --- input/drivers/rwebinput_input.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/input/drivers/rwebinput_input.c b/input/drivers/rwebinput_input.c index e8272f8317..f4f8e29fc8 100644 --- a/input/drivers/rwebinput_input.c +++ b/input/drivers/rwebinput_input.c @@ -636,10 +636,12 @@ static void rwebinput_process_keyboard_events(rwebinput_input_t *rwebinput, else if (translated_keycode == RETROK_TAB) character = '\t'; - input_keyboard_event(keydown, translated_keycode, character, mod, - RETRO_DEVICE_KEYBOARD); - - if (translated_keycode < RETROK_LAST) + if (translated_keycode != RETROK_UNKNOWN) { + input_keyboard_event(keydown, translated_keycode, character, mod, + RETRO_DEVICE_KEYBOARD); + } + + if (translated_keycode < RETROK_LAST && translated_keycode != RETROK_UNKNOWN) { rwebinput->keys[translated_keycode] = keydown; }