Call button combo toggle for quick menu toggle from runloop_check_state

This commit is contained in:
twinaphex 2017-05-21 20:53:33 +02:00
parent 3e00c632bd
commit 4d4b00f877
3 changed files with 8 additions and 25 deletions

View File

@ -608,7 +608,7 @@ static INLINE bool input_menu_keys_pressed_internal(
return false;
}
static bool input_driver_toggle_button_combo(
bool input_driver_toggle_button_combo(
unsigned mode, uint64_t input)
{
switch (mode)
@ -728,20 +728,6 @@ uint64_t input_menu_keys_pressed(
input_driver_block_hotkey = true;
}
#ifdef HAVE_MENU
{
const struct retro_keybind *mtkey = &input_config_binds[0][RARCH_MENU_TOGGLE];
if ( ((settings->uints.input_menu_toggle_gamepad_combo != INPUT_TOGGLE_NONE) &&
input_driver_toggle_button_combo(
settings->uints.input_menu_toggle_gamepad_combo, old_input))
|| input_menu_keys_pressed_internal(
binds, settings, joypad_info, RARCH_MENU_TOGGLE, max_users,
mtkey->valid,
settings->bools.input_all_users_control_menu))
ret |= (UINT64_C(1) << RARCH_MENU_TOGGLE);
}
#endif
for (i = 0; i < RARCH_BIND_LIST_END; i++)
{
const struct retro_keybind *mtkey = &input_config_binds[0][i];
@ -956,15 +942,6 @@ uint64_t input_keys_pressed(
input_driver_block_hotkey = false;
}
#ifdef HAVE_MENU
if (
((settings->uints.input_menu_toggle_gamepad_combo != INPUT_TOGGLE_NONE) &&
input_driver_toggle_button_combo(
settings->uints.input_menu_toggle_gamepad_combo, old_input))
|| input_keys_pressed_internal(settings, joypad_info, RARCH_MENU_TOGGLE, binds))
ret |= (UINT64_C(1) << RARCH_MENU_TOGGLE);
#endif
for (i = 0; i < RARCH_BIND_LIST_END; i++)
{
if ( (i != RARCH_MENU_TOGGLE) &&

View File

@ -343,6 +343,9 @@ bool input_driver_grab_mouse(void);
bool input_driver_ungrab_mouse(void);
bool input_driver_toggle_button_combo(
unsigned mode, uint64_t input);
float *input_driver_get_float(enum input_action action);
unsigned *input_driver_get_uint(enum input_action action);

View File

@ -2420,8 +2420,11 @@ static enum runloop_state runloop_check_state(
/* Check menu toggle */
{
static bool old_pressed = false;
unsigned mode = settings->uints.input_menu_toggle_gamepad_combo;
bool pressed = runloop_cmd_press(
current_input, RARCH_MENU_TOGGLE);
current_input, RARCH_MENU_TOGGLE) ||
((mode != INPUT_TOGGLE_NONE) &&
input_driver_toggle_button_combo(mode, current_input));
if (menu_event_kb_is_set(RETROK_F1) == 1)
{