mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Move rarch_check_block_hotkey to input/input_common.c and make
the function static
This commit is contained in:
parent
c25bc493ab
commit
8a1f15c460
@ -791,7 +791,6 @@ void rarch_main_command(unsigned action);
|
||||
bool rarch_main_iterate(void);
|
||||
void rarch_main_deinit(void);
|
||||
void rarch_render_cached_frame(void);
|
||||
void rarch_check_block_hotkey(bool pressed);
|
||||
bool rarch_check_fullscreen(bool pressed);
|
||||
void rarch_disk_control_set_eject(bool state, bool log);
|
||||
void rarch_disk_control_set_index(unsigned index);
|
||||
|
@ -1463,6 +1463,29 @@ void input_pop_analog_dpad(struct retro_keybind *binds)
|
||||
}
|
||||
|
||||
#if !defined(IS_JOYCONFIG) && !defined(IS_RETROLAUNCH)
|
||||
static void check_block_hotkey(bool enable_hotkey)
|
||||
{
|
||||
bool use_hotkey_enable;
|
||||
static const struct retro_keybind *bind =
|
||||
&g_settings.input.binds[0][RARCH_ENABLE_HOTKEY];
|
||||
|
||||
/* Don't block the check to RARCH_ENABLE_HOTKEY
|
||||
* unless we're really supposed to. */
|
||||
driver.block_hotkey = driver.block_input;
|
||||
|
||||
// If we haven't bound anything to this, always allow hotkeys.
|
||||
use_hotkey_enable = bind->key != RETROK_UNKNOWN ||
|
||||
bind->joykey != NO_BTN ||
|
||||
bind->joyaxis != AXIS_NONE;
|
||||
|
||||
driver.block_hotkey = driver.block_input ||
|
||||
(use_hotkey_enable && !enable_hotkey);
|
||||
|
||||
/* If we hold ENABLE_HOTKEY button, block all libretro input to allow
|
||||
* hotkeys to be bound to same keys as RetroPad. */
|
||||
driver.block_libretro_input = use_hotkey_enable && enable_hotkey;
|
||||
}
|
||||
|
||||
/* Returns a 64-bit mask of all pressed meta keys, starting
|
||||
* from the specified key up until the last queryable key
|
||||
* (key_end).
|
||||
@ -1479,10 +1502,8 @@ retro_input_t meta_input_keys_pressed(unsigned key,
|
||||
retro_input_t ret = 0;
|
||||
int i;
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
rarch_check_block_hotkey(driver.input->key_pressed(driver.input_data,
|
||||
check_block_hotkey(driver.input->key_pressed(driver.input_data,
|
||||
RARCH_ENABLE_HOTKEY));
|
||||
#endif
|
||||
|
||||
input_push_analog_dpad((struct retro_keybind*)binds[0],
|
||||
(g_settings.input.analog_dpad_mode[0] == ANALOG_DPAD_NONE) ?
|
||||
|
23
retroarch.c
23
retroarch.c
@ -2239,29 +2239,6 @@ static void check_netplay_flip(bool pressed, bool fullscreen_toggle_pressed)
|
||||
}
|
||||
#endif
|
||||
|
||||
void rarch_check_block_hotkey(bool enable_hotkey)
|
||||
{
|
||||
static const struct retro_keybind *bind =
|
||||
&g_settings.input.binds[0][RARCH_ENABLE_HOTKEY];
|
||||
bool use_hotkey_enable;
|
||||
|
||||
/* Don't block the check to RARCH_ENABLE_HOTKEY
|
||||
* unless we're really supposed to. */
|
||||
driver.block_hotkey = driver.block_input;
|
||||
|
||||
// If we haven't bound anything to this, always allow hotkeys.
|
||||
use_hotkey_enable = bind->key != RETROK_UNKNOWN ||
|
||||
bind->joykey != NO_BTN ||
|
||||
bind->joyaxis != AXIS_NONE;
|
||||
|
||||
driver.block_hotkey = driver.block_input ||
|
||||
(use_hotkey_enable && !enable_hotkey);
|
||||
|
||||
/* If we hold ENABLE_HOTKEY button, block all libretro input to allow
|
||||
* hotkeys to be bound to same keys as RetroPad. */
|
||||
driver.block_libretro_input = use_hotkey_enable && enable_hotkey;
|
||||
}
|
||||
|
||||
static void check_grab_mouse_toggle(void)
|
||||
{
|
||||
static bool grab_mouse_state = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user