Move block_hotkey to input_driver.c

This commit is contained in:
twinaphex 2015-11-29 17:12:38 +01:00
parent 178e52bca5
commit 23d63d0b5a
2 changed files with 5 additions and 4 deletions

View File

@ -266,7 +266,6 @@ typedef struct driver
#ifdef HAVE_NETWORK_GAMEPAD
rarch_remote_t *remote;
#endif
bool block_hotkey;
bool block_libretro_input;
bool flushing_input;
bool nonblock_state;

View File

@ -82,6 +82,7 @@ struct turbo_buttons
unsigned count;
};
static bool block_hotkey;
static turbo_buttons_t turbo_btns;
/**
@ -282,7 +283,7 @@ static retro_input_t input_driver_keys_pressed(void)
{
bool state = false;
if ((!driver->block_libretro_input && ((key < RARCH_FIRST_META_KEY)))
|| !driver->block_hotkey)
|| !block_hotkey)
state = input_driver_key_pressed(key);
if (key >= RARCH_FIRST_META_KEY)
@ -561,7 +562,7 @@ static bool check_block_hotkey(bool enable_hotkey)
/* Don't block the check to RARCH_ENABLE_HOTKEY
* unless we're really supposed to. */
driver->block_hotkey = input_driver_ctl(RARCH_INPUT_CTL_KB_MAPPING_IS_BLOCKED, NULL);
block_hotkey = input_driver_ctl(RARCH_INPUT_CTL_KB_MAPPING_IS_BLOCKED, NULL);
/* If we haven't bound anything to this,
* always allow hotkeys. */
@ -573,7 +574,7 @@ static bool check_block_hotkey(bool enable_hotkey)
|| (autoconf_bind->joykey != NO_BTN)
|| (autoconf_bind->joyaxis != AXIS_NONE);
driver->block_hotkey =
block_hotkey =
input_driver_ctl(RARCH_INPUT_CTL_KB_MAPPING_IS_BLOCKED, NULL) ||
(use_hotkey_enable && !enable_hotkey);
@ -686,6 +687,7 @@ bool input_driver_ctl(enum rarch_input_ctl_state state, void *data)
driver->input->free(driver->input_data);
return true;
case RARCH_INPUT_CTL_DESTROY:
block_hotkey = false;
memset(&turbo_btns, 0, sizeof(turbo_buttons_t));
if (!driver)
return false;