From 5337e494c6b23bc7289431a5c5e7490edb757919 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 03:01:21 +0100 Subject: [PATCH] More small cleanups --- input/input_driver.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index f23ba4f42a..a9ef6981f5 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -561,7 +561,7 @@ static bool check_input_driver_block_hotkey(bool enable_hotkey) /* If we hold ENABLE_HOTKEY button, block all libretro input to allow * hotkeys to be bound to same keys as RetroPad. */ - return (use_hotkey_enable && enable_hotkey); + return use_hotkey_enable; } static const unsigned buttons[] = { @@ -678,14 +678,13 @@ static INLINE bool input_keys_pressed_internal(unsigned i, uint64_t input_keys_pressed(void) { unsigned i; - uint64_t ret = 0; - settings_t *settings = config_get_ptr(); + uint64_t ret = 0; + settings_t *settings = config_get_ptr(); const struct retro_keybind *binds = settings->input.binds[0]; + bool enable_hotkey = current_input->input_state(current_input_data, &binds, 0, + RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY); - if ( - check_input_driver_block_hotkey( - current_input->input_state(current_input_data, &binds, 0, - RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY))) + if (check_input_driver_block_hotkey(enable_hotkey) && enable_hotkey) input_driver_block_libretro_input = true; else input_driver_block_libretro_input = false; @@ -785,6 +784,7 @@ uint64_t input_menu_keys_pressed(void) { unsigned i; uint64_t ret = 0; + bool enable_hotkey = false; settings_t *settings = config_get_ptr(); const struct retro_keybind *binds[MAX_USERS] = {NULL}; @@ -795,10 +795,10 @@ uint64_t input_menu_keys_pressed(void) input_push_analog_dpad(settings->input.autoconf_binds[i], ANALOG_DPAD_LSTICK); - if ( - check_input_driver_block_hotkey( - current_input->input_state(current_input_data, &binds[0], 0, - RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY))) + enable_hotkey = current_input->input_state(current_input_data, &binds[0], 0, + RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY); + + if (check_input_driver_block_hotkey(enable_hotkey) && enable_hotkey) input_driver_block_libretro_input = true; else input_driver_block_libretro_input = false;