mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +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);
|
bool rarch_main_iterate(void);
|
||||||
void rarch_main_deinit(void);
|
void rarch_main_deinit(void);
|
||||||
void rarch_render_cached_frame(void);
|
void rarch_render_cached_frame(void);
|
||||||
void rarch_check_block_hotkey(bool pressed);
|
|
||||||
bool rarch_check_fullscreen(bool pressed);
|
bool rarch_check_fullscreen(bool pressed);
|
||||||
void rarch_disk_control_set_eject(bool state, bool log);
|
void rarch_disk_control_set_eject(bool state, bool log);
|
||||||
void rarch_disk_control_set_index(unsigned index);
|
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)
|
#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
|
/* Returns a 64-bit mask of all pressed meta keys, starting
|
||||||
* from the specified key up until the last queryable key
|
* from the specified key up until the last queryable key
|
||||||
* (key_end).
|
* (key_end).
|
||||||
@ -1479,10 +1502,8 @@ retro_input_t meta_input_keys_pressed(unsigned key,
|
|||||||
retro_input_t ret = 0;
|
retro_input_t ret = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#ifdef RARCH_INTERNAL
|
check_block_hotkey(driver.input->key_pressed(driver.input_data,
|
||||||
rarch_check_block_hotkey(driver.input->key_pressed(driver.input_data,
|
|
||||||
RARCH_ENABLE_HOTKEY));
|
RARCH_ENABLE_HOTKEY));
|
||||||
#endif
|
|
||||||
|
|
||||||
input_push_analog_dpad((struct retro_keybind*)binds[0],
|
input_push_analog_dpad((struct retro_keybind*)binds[0],
|
||||||
(g_settings.input.analog_dpad_mode[0] == ANALOG_DPAD_NONE) ?
|
(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
|
#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 void check_grab_mouse_toggle(void)
|
||||||
{
|
{
|
||||||
static bool grab_mouse_state = false;
|
static bool grab_mouse_state = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user