mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 17:43:02 +00:00
Create menu_driver_toggle_binds
This commit is contained in:
parent
00ff63e0bb
commit
7b460c14b7
@ -206,6 +206,24 @@ static void menu_input_key_event(bool down, unsigned keycode,
|
|||||||
menu_entry_action(NULL, 0, MENU_ACTION_SEARCH);
|
menu_entry_action(NULL, 0, MENU_ACTION_SEARCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_driver_toggle_binds(bool latch)
|
||||||
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
if (!settings)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (latch)
|
||||||
|
{
|
||||||
|
memcpy(settings->input.binds[0], retro_keybinds_menu,
|
||||||
|
sizeof(retro_keybinds_1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memcpy(settings->input.binds[0], retro_keybinds_1,
|
||||||
|
sizeof(retro_keybinds_1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void menu_driver_toggle(bool latch)
|
static void menu_driver_toggle(bool latch)
|
||||||
{
|
{
|
||||||
retro_keyboard_event_t *key_event = NULL;
|
retro_keyboard_event_t *key_event = NULL;
|
||||||
@ -246,9 +264,7 @@ static void menu_driver_toggle(bool latch)
|
|||||||
runloop_ctl(RUNLOOP_CTL_SET_FRAME_TIME_LAST, NULL);
|
runloop_ctl(RUNLOOP_CTL_SET_FRAME_TIME_LAST, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings)
|
menu_driver_toggle_binds(true);
|
||||||
memcpy(settings->input.binds[0], retro_keybinds_menu,
|
|
||||||
sizeof(retro_keybinds_1));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -265,9 +281,7 @@ static void menu_driver_toggle(bool latch)
|
|||||||
if (key_event && frontend_key_event)
|
if (key_event && frontend_key_event)
|
||||||
*key_event = *frontend_key_event;
|
*key_event = *frontend_key_event;
|
||||||
|
|
||||||
if (settings)
|
menu_driver_toggle_binds(false);
|
||||||
memcpy(settings->input.binds[0], retro_keybinds_1,
|
|
||||||
sizeof(retro_keybinds_1));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,6 +421,8 @@ extern unsigned int rdb_entry_start_game_selection_ptr;
|
|||||||
|
|
||||||
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data);
|
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data);
|
||||||
|
|
||||||
|
void menu_driver_toggle_binds(bool latch);
|
||||||
|
|
||||||
extern menu_ctx_driver_t menu_ctx_xui;
|
extern menu_ctx_driver_t menu_ctx_xui;
|
||||||
extern menu_ctx_driver_t menu_ctx_rgui;
|
extern menu_ctx_driver_t menu_ctx_rgui;
|
||||||
extern menu_ctx_driver_t menu_ctx_mui;
|
extern menu_ctx_driver_t menu_ctx_mui;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user